From 406e58399fd1444cd5b83862d6493f59fcb08790 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 22 Aug 2012 13:34:39 +0200 Subject: [PATCH] [FIX] mail: unify message_post calls, fix typos, various lint cleanup bzr revid: odo@openerp.com-20120822113439-aoy7v4njs6o34tu5 --- addons/account/account_bank_statement.py | 2 +- addons/account/account_invoice.py | 17 +++--- addons/base_calendar/crm_meeting.py | 4 +- addons/base_status/base_stage.py | 2 +- addons/base_status/base_state.py | 8 +-- addons/crm/crm_action_rule.py | 4 +- addons/crm/crm_lead.py | 3 +- addons/crm/crm_meeting.py | 2 +- addons/event/event.py | 14 ++--- addons/hr/hr.py | 2 +- addons/hr_holidays/hr_holidays.py | 4 +- addons/mail/mail_mail.py | 1 - addons/mail/mail_thread.py | 67 +++++++++++++--------- addons/mail/res_users.py | 6 +- addons/mail/wizard/mail_compose_message.py | 5 +- addons/plugin/plugin_handler.py | 6 +- addons/procurement/procurement.py | 2 +- addons/project_issue/project_issue.py | 12 ++-- addons/sale/sale.py | 4 +- 19 files changed, 87 insertions(+), 78 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 911086a83e4..095d461ff3b 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -430,7 +430,7 @@ class account_bank_statement(osv.osv): 'name': st_number, 'balance_end_real': st.balance_end }, context=context) - self.message_post(cr, uid, [st.id], body=_('Statement %s is confirmed, journal items are created.') % (st_number,), context=context) + self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st_number,), context=context) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) def button_cancel(self, cr, uid, ids, context=None): diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index bca1530abae..8b86429ea1b 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1288,24 +1288,25 @@ class account_invoice(osv.osv): def _get_document_type(self, type): type_dict = { - 'out_invoice': 'Customer invoice', - 'in_invoice': 'Supplier invoice', - 'out_refund': 'Customer Refund', - 'in_refund': 'Supplier Refund', + # Translation markers will have no effect at runtime, only used to properly flag export + 'out_invoice': _('Customer invoice'), + 'in_invoice': _('Supplier invoice'), + 'out_refund': _('Customer Refund'), + 'in_refund': _('Supplier Refund'), } return type_dict.get(type, 'Invoice') def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), context=context) + self.message_post(cr, uid, [obj.id], body=_("%s created.") % (_(self._get_document_type(obj.type))), context=context) def confirm_paid_send_note(self, cr, uid, ids, context=None): - for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), context=context) + for obj in self.browse(cr, uid, ids, context=context): + self.message_post(cr, uid, [obj.id], body=_("%s paid.") % (_(self._get_document_type(obj.type))), context=context) def invoice_cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), context=context) + self.message_post(cr, uid, [obj.id], body=_("%s cancelled.") % (_(self._get_document_type(obj.type))), context=context) account_invoice() diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 4bf922a2797..5f58877a8a6 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -78,9 +78,9 @@ class crm_meeting(base_state, osv.Model): return 'Meeting' def case_open_send_note(self, cr, uid, ids, context=None): - return self.message_post(cr, uid, ids, body=_("Meeting has been confirmed."), context=context) + return self.message_post(cr, uid, ids, body=_("Meeting confirmed."), context=context) def case_close_send_note(self, cr, uid, ids, context=None): - return self.message_post(cr, uid, ids, body=_("Meeting has been done."), context=context) + return self.message_post(cr, uid, ids, body=_("Meeting completed."), context=context) diff --git a/addons/base_status/base_stage.py b/addons/base_status/base_stage.py index 6b834399dd9..26afe548217 100644 --- a/addons/base_status/base_stage.py +++ b/addons/base_status/base_stage.py @@ -428,5 +428,5 @@ class base_stage(object): msg = '%s has been escalated to %s.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context), new_section.name) else: msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) - self.message_post(cr, uid, [id], 'System Notification', msg, context=context) + self.message_post(cr, uid, [id], body=msg, context=context) return True diff --git a/addons/base_status/base_state.py b/addons/base_status/base_state.py index 098e09210f9..cebf5537485 100644 --- a/addons/base_status/base_state.py +++ b/addons/base_status/base_state.py @@ -179,9 +179,9 @@ class base_state(object): # Notifications # ****************************** - def case_get_note_msg_prefix(self, cr, uid, id, context=None): - return '' - + def case_get_note_msg_prefix(self, cr, uid, id, context=None): + return '' + def case_open_send_note(self, cr, uid, ids, context=None): for id in ids: msg = _('%s has been opened.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) @@ -194,7 +194,7 @@ class base_state(object): msg = '%s has been escalated to %s.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context), new_section.name) else: msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context)) - self.message_post(cr, uid, [id], 'System Notification', msg, context=context) + self.message_post(cr, uid, [id], body=msg, context=context) return True def case_close_send_note(self, cr, uid, ids, context=None): diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 6753484dae0..36700b5b6c2 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -105,8 +105,8 @@ class base_action_rule(osv.osv): write['email_cc'] = obj.act_email_cc # Put state change by rule in communication history - if hasattr(obj, 'state') and hasattr(obj, 'message_append') and action.act_state: - model_obj.message_post(cr, uid, [obj], _(action.act_state)) + if hasattr(obj, 'state') and hasattr(obj, 'message_post') and action.act_state: + model_obj.message_post(cr, uid, [obj], _(action.act_state), context=context) model_obj.write(cr, uid, [obj.id], write, context) super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index b1335fd91d4..39ad56e007d 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -19,7 +19,6 @@ # ############################################################################## -import binascii from base_status.base_stage import base_stage import crm from datetime import datetime @@ -476,7 +475,7 @@ class crm_lead(base_stage, osv.osv): subject = subject[0] + ", ".join(subject[1:]) details = "\n\n".join(details) - return self.message_post(cr, uid, [opportunity_id], subject=subject, body=details) + return self.message_post(cr, uid, [opportunity_id], body=details, subject=subject, context=context) def _merge_opportunity_history(self, cr, uid, opportunity_id, opportunities, context=None): message = self.pool.get('mail.message') diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index de54d8e40ac..62fc53364ee 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -53,7 +53,7 @@ class crm_meeting(osv.Model): if meeting.opportunity_id: # meeting can be create from phonecalls or opportunities, therefore checking for the parent lead = meeting.opportunity_id message = _("Meeting linked to the opportunity %s has been created and scheduled on %s.") % (lead.name, meeting_date_tz) - lead.message_post(_('System Notification'), message) + lead.message_post(body=message) elif meeting.phonecall_id: phonecall = meeting.phonecall_id message = _("Meeting linked to the phonecall %s has been created and scheduled on %s.") % (phonecall.name, meeting_date_tz) diff --git a/addons/event/event.py b/addons/event/event.py index a057fe80ac4..d347c1547d8 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -19,10 +19,8 @@ # ############################################################################## -import time from osv import fields, osv from tools.translate import _ -import decimal_precision as dp from openerp import SUPERUSER_ID class event_type(osv.osv): @@ -53,7 +51,7 @@ class event_event(osv.osv): def name_get(self, cr, uid, ids, context=None): if not ids: - return [] + return [] res = [] for record in self.browse(cr, uid, ids, context=context): date = record.date_begin.split(" ")[0] @@ -99,7 +97,6 @@ class event_event(osv.osv): return self.write(cr, uid, ids, {'state': 'done'}, context=context) def check_registration_limits(self, cr, uid, ids, context=None): - register_pool = self.pool.get('event.registration') for self.event in self.browse(cr, uid, ids, context=context): total_confirmed = self.event.register_current if total_confirmed < self.event.register_min or total_confirmed > self.event.register_max and self.event.register_max!=0: @@ -109,7 +106,7 @@ class event_event(osv.osv): for event in self.browse(cr, uid, ids, context=context): available_seats = event.register_avail if available_seats and no_of_registration > available_seats: - raise osv.except_osv(_('Warning!'),_("Only %d Seats are Available!") % (available_seats)) + raise osv.except_osv(_('Warning!'),_("Only %d Seats are Available!") % (available_seats)) elif available_seats == 0: raise osv.except_osv(_('Warning!'),_("No Tickets Available!")) @@ -139,7 +136,6 @@ class event_event(osv.osv): @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ - register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context=context): res[event.id] = {} @@ -334,7 +330,7 @@ class event_registration(osv.osv): return self.write(cr, uid, ids, {'state': 'draft'}, context=context) def confirm_registration(self, cr, uid, ids, context=None): - self.message_post(cr, uid, ids, body=_('State set to open')) + self.message_post(cr, uid, ids, body=_('State set to open'), context=context) return self.write(cr, uid, ids, {'state': 'open'}, context=context) def create(self, cr, uid, vals, context=None): @@ -364,13 +360,13 @@ class event_registration(osv.osv): if today >= registration.event_id.date_begin: values = {'state': 'done', 'date_closed': today} self.write(cr, uid, ids, values) - self.message_post(cr, uid, ids, body=_('State set to Done')) + self.message_post(cr, uid, ids, body=_('State set to Done'), context=context) else: raise osv.except_osv(_('Error!'),_("You must wait for the starting day of the event to do this action.") ) return True def button_reg_cancel(self, cr, uid, ids, context=None, *args): - self.message_post(cr, uid, ids,body = _('State set to Cancel')) + self.message_post(cr, uid, ids, body=_('State set to Cancel'), context=context) return self.write(cr, uid, ids, {'state': 'cancel'}) def mail_user(self, cr, uid, ids, context=None): diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 54560863dd0..3c307b9fee8 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -212,7 +212,7 @@ class hr_employee(osv.osv): try: (model, mail_group_id) = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', 'group_all_employees') employee = self.browse(cr, uid, employee_id, context=context) - self.pool.get('mail.group').message_post(cr, uid, [mail_group_id], body='Welcome to %s! Please help him make its first steps in OpenERP!' % (employee.name), context=context) + self.pool.get('mail.group').message_post(cr, uid, [mail_group_id], body='Welcome to %s! Please help them take the first steps with OpenERP!' % (employee.name), context=context) except: pass # group deleted: do not push a message return employee_id diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 5748da37c1e..2e26e72bcdc 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -367,14 +367,14 @@ class hr_holidays(osv.osv): def create_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_post(cr, uid, ids, - _("The %s request has been created and is waiting confirmation.") + _("The %s request has been created and is waiting for confirmation.") % ('leave' if obj.type == 'remove' else 'allocation',), context=context) return True def holidays_confirm_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids): self.message_post(cr, uid, [obj.id], _("The %s request has been confirmed and is waiting for validation by the manager.") - % ('leave' if obj.type == 'remove' else 'allocation',)) + % ('leave' if obj.type == 'remove' else 'allocation',), context=context) def holidays_validate_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids): diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index a016586347f..bd0bfbf33c0 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -45,7 +45,6 @@ class mail_mail(osv.Model): _columns = { 'mail_message_id': fields.many2one('mail.message', 'Message', required=True, ondelete='cascade'), 'mail_server_id': fields.many2one('ir.mail_server', 'Outgoing mail server', readonly=1), - 'subject': fields.char('Subject', size=128), 'state': fields.selection([ ('outgoing', 'Outgoing'), ('sent', 'Sent'), diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 3bc45d3af26..5795fa8b824 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -19,7 +19,6 @@ # ############################################################################## -import base64 import dateutil import email import logging @@ -27,7 +26,6 @@ from email.utils import parsedate from email.message import Message from osv import osv, fields from mail_message import decode -import re import time import tools from tools.translate import _ @@ -313,7 +311,7 @@ class mail_thread(osv.Model): model_pool.message_update(cr, user_id, [thread_id], msg, context=context) else: thread_id = model_pool.message_new(cr, user_id, msg, custom_values, context=context) - self.message_post(cr, uid, thread_id, context=context, **msg) + self.message_post(cr, uid, [thread_id], msg_txt['body'], context=context, **msg) return True def message_new(self, cr, uid, msg_dict, custom_values=None, context=None): @@ -421,7 +419,7 @@ class mail_thread(osv.Model): if save_original: msg_original = message.as_string() if isinstance(message, Message) \ else message - attachments.append(('email.eml', msg_original)) + attachments.append(('original_email.eml', msg_original)) if not message_id: # Very unusual situation, be we should be fault-tolerant here @@ -451,11 +449,11 @@ class mail_thread(osv.Model): msg['partner_ids'] = partner_ids if 'Date' in msg_fields: - date_hdr = decode(msg_txt.get('Date')) - # convert from email timezone to server timezone - date_server_datetime = dateutil.parser.parse(date_hdr).astimezone(pytz.timezone(tools.get_server_timezone())) - date_server_datetime_str = date_server_datetime.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT) - msg['date'] = date_server_datetime_str + date_hdr = decode(msg_txt.get('Date')) + # convert from email timezone to server timezone + date_server_datetime = dateutil.parser.parse(date_hdr).astimezone(pytz.timezone(tools.get_server_timezone())) + date_server_datetime_str = date_server_datetime.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT) + msg['date'] = date_server_datetime_str #if 'Content-Transfer-Encoding' in msg_fields: # msg['encoding'] = msg_txt.get('Content-Transfer-Encoding') @@ -507,38 +505,53 @@ class mail_thread(osv.Model): module instead of by the res.log mechanism. Please \ use the mail.thread OpenChatter API instead of the \ now deprecated res.log.") - self.message_post(cr, uid, id, message, context=context) + self.message_post(cr, uid, [id], message, context=context) - def message_post(self, cr, uid, res_id, body, subject=False, - mtype='notification', parent_id=False, attachments=None, context=None, **kwargs): + def message_post(self, cr, uid, thread_id, body, subject=False, + msg_type='notification', parent_id=False, attachments=None, context=None, **kwargs): + """Post a new message in an existing message thread, returning the new mail.message ID. + Extra keyword arguments will be used as default column values for the new + mail.message record. + + :param int thread_id: thread ID to post into, or list with one ID + :param str body: body of the message, usually raw HTML + :param str subject: optional subject + :param str msg_type: message type, out of the possible values for mail_message.type, + currently one of ``email, 'comment', 'notification'``. + :param int parent_id: optional ID of parent message in this thread + :param tuple(str,str) attachments: list of attachment tuples in the form ``(name,content)`` + :return: ID of newly created mail.message + """ context = context or {} attachments = attachments or {} - if type(res_id) in (list, tuple): - res_id = res_id and res_id[0] or False + assert (not thread_id) or isinstance(thread_id, (int,long)) or \ + (isinstance(thread_id, (list, tuple)) and len(thread_id) == 1), "Invalid thread_id" + if isinstance(thread_id, (list, tuple)): + thread_id = thread_id and thread_id[0] to_attach = [] - for fname, fcontent in attachments: - if isinstance(fcontent, unicode): - fcontent = fcontent.encode('utf-8') + for name, content in attachments: + if isinstance(content, unicode): + content = content.encode('utf-8') data_attach = { - 'name': fname, - 'datas': fcontent, - 'datas_fname': fname, - 'description': _('email attachment'), + 'name': name, + 'datas': content, + 'datas_fname': name, + 'description': name, } to_attach.append((0,0, data_attach)) - value = kwargs - value.update( { - 'model': res_id and self._name or False, - 'res_id': res_id, + values = kwargs + values.update( { + 'model': thread_id and self._name or False, + 'thread_id': thread_id or False, 'body': body, 'subject': subject, - 'type': mtype, + 'type': msg_type, 'parent_id': parent_id, 'attachment_ids': to_attach }) - return self.pool.get('mail.message').create(cr, uid, value, context=context) + return self.pool.get('mail.message').create(cr, uid, values, context=context) #------------------------------------------------------ diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py index 1e638251e40..d863719db77 100644 --- a/addons/mail/res_users.py +++ b/addons/mail/res_users.py @@ -110,9 +110,9 @@ class res_users(osv.Model): def _create_welcome_message(self, cr, uid, user, context=None): company_name = user.company_id.name if user.company_id else _('the company') - body = '''%s has joined %s.''' % (user.name, company_name) - # TODO change 1 into user.id but catch errors - return self.pool.get('res.partner').message_post(cr, 1, [user.partner_id.id], + body = _('%s has joined %s.') % (user.name, company_name) + # TODO change SUPERUSER_ID into user.id but catch errors + return self.pool.get('res.partner').message_post(cr, SUPERUSER_ID, [user.partner_id.id], body=body, context=context) def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 50ffd6e440e..19faaad9578 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -254,9 +254,9 @@ class mail_compose_message(osv.TransientModel): context = {} formatting = context.get('formatting') + # FIXME TODO: mass_mail_mode unused? mass_mail_mode = context.get('mail.compose.message.mode') == 'mass_mail' - mail_message_obj = self.pool.get('mail.message') for mail_wiz in self.browse(cr, uid, ids, context=context): attachment = {} for attach in mail_wiz.attachment_ids: @@ -264,6 +264,7 @@ class mail_compose_message(osv.TransientModel): # default values, according to the wizard options subject = mail_wiz.subject if formatting else False + # FIXME TODO: partner_ids not used?? partner_ids = [partner.id for partner in mail_wiz.dest_partner_ids] body = mail_wiz.body_html if mail_wiz.content_subtype == 'html' else mail_wiz.body @@ -274,7 +275,7 @@ class mail_compose_message(osv.TransientModel): active_model_pool = self.pool.get(active_model) subject = self.render_template(cr, uid, subject, active_model, active_id) body = self.render_template(cr, uid, mail_wiz.body_html, active_model, active_id) - active_model_pool.message_post(cr, uid, active_id, body, subject, 'comment', + active_model_pool.message_post(cr, uid, [active_id], body=body, subject=subject, msg_type='comment', attachments=attachment, context=context) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 6d6262ddd22..9c582a8e3bf 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -101,15 +101,15 @@ class plugin_handler(osv.osv_memory): notify = "Email already pushed" elif res_id == 0: if model == 'res.partner': - notify = 'User the button Partner to create a new partner' + notify = 'User the Partner button to create a new partner' else: res_id = model_obj.message_new(cr, uid, msg) - notify = "Mail succefully pushed, a new %s has been created " % model + notify = "Mail succesfully pushed, a new %s has been created " % model else: if model == 'res.partner': model_obj = self.pool.get('mail.thread') model_obj.message_post(cr, uid, [res_id], body=msg) - notify = "Mail succefully pushed" + notify = "Mail succesfully pushed" url = self._make_url(cr, uid, res_id, model) return (model, res_id, url, notify) diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 8efd09a1efc..db50ebd94fd 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -389,7 +389,7 @@ class procurement_order(osv.osv): ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id]) order_point_id = self.pool.get('stock.warehouse.orderpoint').search(cr, uid, [('product_id', '=', procurement.product_id.id)], context=context) if not order_point_id and not ok: - message = _("Not enough stock and no minimum orderpoint rule defined.") + message = _("Not enough stock and no minimum orderpoint rule defined.") elif not order_point_id: message = _("No minimum orderpoint rule defined.") elif not ok: diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 3b0311d8f45..93040b20af5 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -507,21 +507,21 @@ class project_issue(base_stage, osv.osv): return 'Project issue' def convert_to_task_send_note(self, cr, uid, ids, context=None): - message = _("Project issue has been converted into task.") + message = _("Project issue converted to task.") return self.message_post(cr, uid, ids, body=message, context=context) def create_send_note(self, cr, uid, ids, context=None): - message = _("Project issue has been created.") + message = _("Project issue created.") return self.message_post(cr, uid, ids, body=message, context=context) def case_escalate_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): if obj.project_id: - message = _("has been escalated to '%s'.") % (obj.project_id.name) - obj.message_post(body=message, context=context) + message = _("escalated to '%s'.") % (obj.project_id.name) + obj.message_post(body=message) else: - message = _("has been escalated.") - obj.message_post(body=message, context=context) + message = _("escalated.") + obj.message_post(body=message) return True project_issue() diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 476ee6458f0..521d7dc504f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1027,7 +1027,7 @@ class sale_order(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, [obj.id], body=_("Quotation for %s has been created.") % (obj.partner_id.name), context=context) + self.message_post(cr, uid, [obj.id], body=_("Quotation for %s created.") % (obj.partner_id.name), context=context) def confirm_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): @@ -1058,7 +1058,7 @@ class sale_order(osv.osv): self.message_post(cr, uid, [order.id], body=_("Draft Invoice of %s %s waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), context=context) def action_cancel_draft_send_note(self, cr, uid, ids, context=None): - return self.message_post(cr, uid, ids, body='Sale order has been set in draft.', context=context) + return self.message_post(cr, uid, ids, body=_('Sale order set to draft.'), context=context) sale_order()