diff --git a/addons/account/i18n/es.po b/addons/account/i18n/es.po index 391db02e8d6..c06407ce158 100644 --- a/addons/account/i18n/es.po +++ b/addons/account/i18n/es.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n" +"X-Launchpad-Export-Date: 2010-07-01 03:45+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 229e7b11fc7..cc22143782f 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -576,7 +576,7 @@ property or property parameter."), if not vals.get("email") and vals.get("cn"): cnval = vals.get("cn").split(':') email = filter(lambda x:x.__contains__('@'), cnval) - vals['email'] = email[0] + vals['email'] = email and email[0] or '' vals['cn'] = vals.get("cn") res = super(calendar_attendee, self).create(cr, uid, vals, context) return res @@ -629,6 +629,7 @@ true, it will allow you to hide the event alarm information without removing it. if not context: context = {} alarm_obj = self.pool.get('calendar.alarm') + res_alarm_obj = self.pool.get('res.alarm') ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] @@ -636,6 +637,30 @@ true, it will allow you to hide the event alarm information without removing it. for data in model_obj.browse(cr, uid, ids, context): basic_alarm = data.alarm_id + cal_alarm = data.base_calendar_alarm_id + if (not basic_alarm and cal_alarm) or (basic_alarm and cal_alarm): + new_res_alarm = None + # Find for existing res.alarm + duration = cal_alarm.trigger_duration + interval = cal_alarm.trigger_interval + occurs = cal_alarm.trigger_occurs + related = cal_alarm.trigger_related + domain = [('trigger_duration', '=', duration), ('trigger_interval', '=', interval), ('trigger_occurs', '=', occurs), ('trigger_related', '=', related)] + alarm_ids = res_alarm_obj.search(cr, uid, domain, context=context) + if not alarm_ids: + val = { + 'trigger_duration': duration, + 'trigger_interval': interval, + 'trigger_occurs': occurs, + 'trigger_related': related, + 'name': str(duration) + ' ' + str(interval) + ' ' + str(occurs) + } + new_res_alarm = res_alarm_obj.create(cr, uid, val, context=context) + else: + new_res_alarm = alarm_ids[0] + cr.execute('Update %s set base_calendar_alarm_id=%s, alarm_id=%s \ + where id=%s' % (model_obj._table, \ + cal_alarm.id, new_res_alarm, data.id)) if not context.get('alarm_id', False): self.do_alarm_unlink(cr, uid, [data.id], model) return True @@ -1463,7 +1488,7 @@ true, it will allow you to hide the event alarm information without removing it. context = {} res = super(calendar_event, self).copy(cr, uid, base_calendar_id2real_id(id), default, context) alarm_obj = self.pool.get('res.alarm') - alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date') + alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context) return res @@ -1514,7 +1539,7 @@ true, it will allow you to hide the event alarm information without removing it. context = {} res = super(calendar_event, self).create(cr, uid, vals, context) alarm_obj = self.pool.get('res.alarm') - alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date') + alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context) return res calendar_event() diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 409ffa6b5ad..c9f40e418a1 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -117,7 +117,7 @@ def get_attribute_mapping(cr, uid, calname, context={}): res['uid']['type'] = "integer" return res -def map_data(cr, uid, obj): +def map_data(cr, uid, obj, context=None): """ Map Data @param self: The object pointer @param cr: the current row, from the database cursor,""" @@ -144,7 +144,7 @@ def map_data(cr, uid, obj): model = obj.__attribute__[map_dict].get('object', False) modobj = obj.pool.get(model) for map_vall in map_val: - id = modobj.create(cr, uid, map_vall) + id = modobj.create(cr, uid, map_vall, context=context) ids.append(id) vals[field] = [(6, 0, ids)] continue @@ -155,7 +155,15 @@ def map_data(cr, uid, obj): continue model = obj.__attribute__[map_dict].get('object', False) modobj = obj.pool.get(model) - id = modobj.create(cr, uid, map_val) + # check if the record exists or not + key1 = map_val.keys() + value1 = map_val.values() + domain = [(key1[i], '=', value1[i]) for i in range(len(key1)) if value1[i]] + exist_id = modobj.search(cr, uid, domain, context=context) + if exist_id: + id = exist_id[0] + else: + id = modobj.create(cr, uid, map_val, context=context) vals[field] = id continue if field_type == 'timedelta': @@ -245,7 +253,7 @@ class CalDAV(object): if cal_data.params.get('X-VOBJ-ORIGINAL-TZID'): self.ical_set('vtimezone', cal_data.params.get('X-VOBJ-ORIGINAL-TZID'), 'value') self.ical_set(cal_data.name.lower(), cal_data.value, 'value') - vals = map_data(cr, uid, self) + vals = map_data(cr, uid, self, context=context) return vals def create_ics(self, cr, uid, datas, name, ical, context=None): @@ -874,7 +882,7 @@ class Timezone(CalDAV, osv.osv_memory): if child.name.lower() == 'tzid': tzname = child.value self.ical_set(child.name.lower(), tzname, 'value') - vals = map_data(cr, uid, self) + vals = map_data(cr, uid, self, context=context) return vals Timezone() @@ -969,7 +977,7 @@ class Alarm(CalDAV, osv.osv_memory): self.ical_set('trigger_related', child.params.get('related')[0].lower(), 'value') else: self.ical_set(child.name.lower(), child.value.lower(), 'value') - vals = map_data(cr, uid, self) + vals = map_data(cr, uid, self, context=context) return vals Alarm() @@ -1013,7 +1021,7 @@ class Attendee(CalDAV, osv.osv_memory): self.ical_set(para.lower(), ical_data.params[para][0].lower(), 'value') if not ical_data.params.get('CN'): self.ical_set('cn', ical_data.value, 'value') - vals = map_data(cr, uid, self) + vals = map_data(cr, uid, self, context=context) return vals def export_cal(self, cr, uid, model, attendee_ids, vevent, context={}): diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index 01e14375d89..e158c2177b8 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -170,17 +170,17 @@ class crm_send_new_email(osv.osv_memory): for case in mod_obj.browse(cr, uid, res_id): if 'email_to' in fields: - res.update({'email_to': case.email_from}) + res.update({'email_to': tools.ustr(case.email_from)}) if 'email_from' in fields: - res.update({'email_from': user_mail_from}) + res.update({'email_from': tools.ustr(user_mail_from)}) if 'subject' in fields: res.update({'subject': tools.ustr(context.get('subject', case.name) or '')}) if 'email_cc' in fields: - res.update({'email_cc': case.email_cc or ''}) + res.update({'email_cc': tools.ustr(case.email_cc or '')}) if 'text' in fields: - res.update({'text': '\n\n'+(case.user_id.signature or '')}) + res.update({'text': u'\n\n'+(tools.ustr(case.user_id.signature or ''))}) if 'state' in fields: - res.update({'state': 'pending'}) + res.update({'state': u'pending'}) return res @@ -207,28 +207,28 @@ class crm_send_new_email(osv.osv_memory): res_id = hist.res_id case = model_pool.browse(cr, uid, res_id) if 'email_to' in fields: - res.update({'email_to': hist.email_from or False}) + res.update({'email_to': case.email_from and tools.ustr(case.email_from) or False}) if 'email_from' in fields: - res.update({'email_from': user_mail_from}) + res.update({'email_from': user_mail_from and tools.ustr(user_mail_from) or False}) - signature = '\n' + (case.user_id.signature or '') + signature = u'\n' + (tools.ustr(case.user_id.signature or '')) original = [signature] if include_original == True and 'text' in fields: - header = '-------- Original Message --------' - sender = 'From: %s' %(hist.email_from or '') - to = 'To: %s' % (hist.email_to or '') - sentdate = 'Date: %s' % (hist.date) - desc = '\n%s'%(hist.description) + header = u'-------- Original Message --------' + sender = u'From: %s' %(tools.ustr(hist.email_from or '')) + to = u'To: %s' % (tools.ustr(hist.email_to or '')) + sentdate = u'Date: %s' % (tools.ustr(hist.date)) + desc = u'\n%s'%(tools.ustr(hist.description)) original = [header, sender, to, sentdate, desc, signature] - res['text']= '\n\n\n' + '\n'.join(original) + res['text']= u'\n\n\n' + u'\n'.join(original) if 'subject' in fields: - res.update({'subject': 'Re: %s' %(hist.name or '')}) + res.update({u'subject': u'Re: %s' %(tools.ustr(hist.name or ''))}) if 'state' in fields: - res['state']='pending' + res['state'] = u'pending' return res def view_init(self, cr, uid, fields_list, context=None): diff --git a/addons/hr_evaluation/i18n/es.po b/addons/hr_evaluation/i18n/es.po index 5dd4b64fb11..87a362033f9 100644 --- a/addons/hr_evaluation/i18n/es.po +++ b/addons/hr_evaluation/i18n/es.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n" +"X-Launchpad-Export-Date: 2010-07-01 03:45+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_evaluation diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index cdd1c61ee67..95b95489c6b 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -371,16 +371,14 @@ class mailgate_tool(osv.osv_memory): if part.get_content_subtype() == 'html': body = tools.ustr(tools.html2plaintext(content)) elif part.get_content_subtype() == 'plain': - body = tools.ustr(content) + body = content elif part.get_content_maintype() in ('application', 'image', 'text'): filename = part.get_filename(); if filename : attachments[filename] = part.get_payload(decode=True) else: res = part.get_payload(decode=True) - if encoding: - res = tools.ustr(res, encoding) - body += res + body += tools.ustr(res) msg['body'] = body msg['attachments'] = attachments diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 9f28cff4594..9ed07cb5f38 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -20,8 +20,7 @@ ############################################################################## from mx import DateTime -from osv import fields -from osv import osv +from osv import osv, fields from tools.translate import _ import ir import netsvc @@ -520,14 +519,17 @@ class mrp_production(osv.osv): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Production Order(s) which are in %s State!' % s['state'])) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) - def copy(self, cr, uid, id, default=None,context=None): - if not default: + def copy(self, cr, uid, id, default=None, context=None): + if default is None: default = {} default.update({ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.production'), 'move_lines' : [], - 'move_created_ids': [], - 'state': 'draft' + 'move_lines2' : [], + 'move_created_ids' : [], + 'move_created_ids2' : [], + 'product_lines' : [], + 'picking_id': False }) return super(mrp_production, self).copy(cr, uid, id, default, context) diff --git a/addons/survey/i18n/es.po b/addons/survey/i18n/es.po index 76d1e5a66eb..3b860411c3b 100644 --- a/addons/survey/i18n/es.po +++ b/addons/survey/i18n/es.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-30 03:34+0000\n" +"X-Launchpad-Export-Date: 2010-07-01 03:45+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: survey diff --git a/addons/wiki/data/wiki_main.xml b/addons/wiki/data/wiki_main.xml index 772528f0949..5aa94eb0ae3 100644 --- a/addons/wiki/data/wiki_main.xml +++ b/addons/wiki/data/wiki_main.xml @@ -6,6 +6,8 @@ help, quick start, wiki, formatting 0 1 + + 0 Initial Page =The Open ERP wiki= diff --git a/addons/wiki/data/wiki_quickstart.xml b/addons/wiki/data/wiki_quickstart.xml index 665179114ce..defd3a315df 100644 --- a/addons/wiki/data/wiki_quickstart.xml +++ b/addons/wiki/data/wiki_quickstart.xml @@ -8,6 +8,8 @@ Basic Wiki Editing help, quick start, wiki, formatting + + 0 1 1.1 diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index a9b623611b8..3fe9d25fcc5 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -32,7 +32,6 @@ import difflib class Wiki(osv.osv): """ wiki """ - _name = "wiki.wiki" Wiki() @@ -78,7 +77,7 @@ class GroupLink(osv.osv): GroupLink() -class Wiki(osv.osv): +class Wiki2(osv.osv): """ Wiki Page """ _inherit = "wiki.wiki" @@ -87,19 +86,22 @@ class Wiki(osv.osv): _columns = { 'name': fields.char('Title', size=256, select=True, required=True), - 'write_uid': fields.many2one('res.users', "Last Author"), + 'write_uid': fields.many2one('res.users', "Last Contributor", select=True), 'text_area': fields.text("Content"), 'create_uid': fields.many2one('res.users', 'Author', select=True), 'create_date': fields.datetime("Created on", select=True), 'write_date': fields.datetime("Modification Date", select=True), - 'tags': fields.char('Tags', size=1024), + 'tags': fields.char('Tags', size=1024, select=True), 'history_id': fields.one2many('wiki.wiki.history', 'wiki_id', 'History Lines'), 'minor_edit': fields.boolean('Minor edit', select=True), 'summary': fields.char('Summary', size=256), - 'section': fields.char('Sequence', size=32, help="Use page section code like 1.2.1"), - 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null'), - 'toc': fields.boolean('Table of Contents'), - 'review': fields.boolean('Need Review'), + 'section': fields.char('Section', size=32, help="Use page section code like 1.2.1", select=True), + 'group_id': fields.many2one('wiki.groups', 'Wiki Group', select=1, ondelete='set null', + help="Topic, also called Wiki Group"), + 'toc': fields.boolean('Table of Contents', + help="Indicates that this pages is a table of contents (linking to other pages)"), + 'review': fields.boolean('Needs Review', select=True, + help="Indicates that this page should be reviewed, raising the attention of other contributors"), 'parent_id': fields.many2one('wiki.wiki', 'Parent Page'), 'child_ids': fields.one2many('wiki.wiki', 'parent_id', 'Child Pages'), } @@ -176,29 +178,7 @@ class Wiki(osv.osv): history.create(cr, uid, res) return result - def open_wiki_page(self, cr, uid, ids, context): - - """ Opens Wiki Page for Editing - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of wiki page’s IDs - - """ - pages = self.pool.get('wiki.wiki').search(cr, uid, [('name', '=', 'Basic Wiki Editing')]) - if not pages: - raise osv.except_osv(_('Warning !'), _("No Help page is defined")) - value = { - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': 'wiki.wiki', - 'view_id': False, - 'res_id': pages[0], - 'type': 'ir.actions.act_window', - 'nodestroy': True, - } - return value - -Wiki() +Wiki2() class History(osv.osv): diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index c1baa5cda20..5a0a3d557bf 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -123,18 +123,13 @@
- -