[FIX] subtype_xml_id -> subtype in message_post.

bzr revid: tde@openerp.com-20120920145405-vwi1kt1ttkd2w8sz
This commit is contained in:
Thibault Delavallée 2012-09-20 16:54:05 +02:00
parent 84fbc3b7da
commit cb806332be
20 changed files with 75 additions and 75 deletions

View File

@ -1307,12 +1307,12 @@ class account_invoice(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=_("%s <b>created</b>.") % (self._get_document_type(obj.type)),
subtype_xml_id="mt_invoice_new", context=context)
subtype="mt_invoice_new", 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 <b>paid</b>.") % (self._get_document_type(obj.type)),
subtype_xml_id="mt_invoice_paid", context=context)
subtype="mt_invoice_paid", context=context)
def invoice_cancel_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):

View File

@ -1295,17 +1295,17 @@ class account_voucher(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s <b>created</b>." % self._document_type[obj.type or False]
self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="mt_voucher_new", context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="mt_voucher_new", context=context)
def post_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s '%s' is <b>posted</b>." % (self._document_type[obj.type or False], obj.move_id.name)
self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="mt_voucher_post", context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="mt_voucher_post", context=context)
def reconcile_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
message = "%s <b>reconciled</b>." % self._document_type[obj.type or False]
self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="mt_voucher_reconciled", context=context)
self.message_post(cr, uid, [obj.id], body=message, subtype="mt_voucher_reconciled", context=context)
account_voucher()

View File

@ -282,7 +282,7 @@ class account_analytic_account(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=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name),
subtype_xml_id="mt_account_new", context=context)
subtype="mt_account_new", context=context)
account_analytic_account()

View File

@ -359,7 +359,7 @@ class base_stage(object):
"""
return ''
def find_subtype_xml_id(self, cr, uid, ids, name, context=None):
def find_subtype(self, cr, uid, ids, name, context=None):
ir_model_data_obj = self.pool.get('ir.model.data')
subtype_ids = self.pool.get('mail.message.subtype').search(cr, uid, [('res_model', '=', self._name), ('name', '=', name)], context=context)
ir_data_ids = ir_model_data_obj.search(cr, uid, [('model', '=', 'mail.message.subtype'), ('res_id', 'in', subtype_ids)], context=context)
@ -379,22 +379,22 @@ class base_stage(object):
def case_open_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been <b>opened</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
xml_id = self.find_subtype_xml_id(cr, uid, ids, name="open", context=context)
self.message_post(cr, uid, [id], body=msg, subtype_xml_id=xml_id, context=context)
xml_id = self.find_subtype(cr, uid, ids, name="open", context=context)
self.message_post(cr, uid, [id], body=msg, subtype=xml_id, context=context)
return True
def case_close_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been <b>closed</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
xml_id = self.find_subtype_xml_id(cr, uid, ids, name="closed", context=context)
self.message_post(cr, uid, [id], body=msg, subtype_xml_id=xml_id, context=context)
xml_id = self.find_subtype(cr, uid, ids, name="closed", context=context)
self.message_post(cr, uid, [id], body=msg, subtype=xml_id, context=context)
return True
def case_cancel_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been <b>cancelled</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
xml_id = self.find_subtype_xml_id(cr, uid, ids, name="cancel", context=context)
self.message_post(cr, uid, [id], body=msg, subtype_xml_id=xml_id, context=context)
xml_id = self.find_subtype(cr, uid, ids, name="cancel", context=context)
self.message_post(cr, uid, [id], body=msg, subtype=xml_id, context=context)
return True
def case_pending_send_note(self, cr, uid, ids, context=None):

View File

@ -842,7 +842,7 @@ class crm_lead(base_stage, format_address, osv.osv):
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Override of the (void) default notification method. """
stage_name = self.pool.get('crm.case.stage').name_get(cr, uid, [stage_id], context=context)[0][1]
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="mt_crm_stage",context=context)
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype="mt_crm_stage",context=context)
def case_get_note_msg_prefix(self, cr, uid, lead, context=None):
if isinstance(lead, (int, long)):
@ -852,16 +852,16 @@ class crm_lead(base_stage, format_address, osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for id in ids:
message = _("%s has been <b>created</b>.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context))
self.message_post(cr, uid, [id], body=message, subtype_xml_id="mt_crm_new", context=context)
self.message_post(cr, uid, [id], body=message, subtype="mt_crm_new", context=context)
return True
def case_mark_lost_send_note(self, cr, uid, ids, context=None):
message = _("Opportunity has been <b>lost</b>.")
return self.message_post(cr, uid, ids, body=message,subtype_xml_id="mt_crm_lost", context=context)
return self.message_post(cr, uid, ids, body=message,subtype="mt_crm_lost", context=context)
def case_mark_won_send_note(self, cr, uid, ids, context=None):
message = _("Opportunity has been <b>won</b>.")
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_crm_won", context=context)
return self.message_post(cr, uid, ids, body=message, subtype="mt_crm_won", context=context)
def schedule_phonecall_send_note(self, cr, uid, ids, phonecall_id, action, context=None):
phonecall = self.pool.get('crm.phonecall').browse(cr, uid, [phonecall_id], context=context)[0]

View File

@ -238,16 +238,16 @@ class crm_claim(base_stage, osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
msg = _('Claim has been <b>created</b>.')
return self.message_post(cr, uid, ids, body=msg, subtype_xml_id='mt_claim_new', context=context)
return self.message_post(cr, uid, ids, body=msg, subtype='mt_claim_new', context=context)
def case_refuse_send_note(self, cr, uid, ids, context=None):
msg = _('Claim has been <b>refused</b>.')
return self.message_post(cr, uid, ids, body=msg, subtype_xml_id='mt_claim_refused', context=context)
return self.message_post(cr, uid, ids, body=msg, subtype='mt_claim_refused', context=context)
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Override of the (void) default notification method. """
stage_name = self.pool.get('crm.claim.stage').name_get(cr, uid, [stage_id], context=context)[0][1]
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id='mt_claim_stage', context=context)
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype='mt_claim_stage', context=context)
class res_partner(osv.osv):

View File

@ -293,17 +293,17 @@ class event_event(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
message = _("Event has been <b>created</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_new", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_event_new", context=context)
return True
def button_cancel_send_note(self, cr, uid, ids, context=None):
message = _("Event has been <b>cancelled</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_cancel", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_event_cancel", context=context)
return True
def button_draft_send_note(self, cr, uid, ids, context=None):
message = _("Event has been set to <b>draft</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_new", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_event_new", context=context)
return True
def button_done_send_note(self, cr, uid, ids, context=None):
@ -313,7 +313,7 @@ class event_event(osv.osv):
def button_confirm_send_note(self, cr, uid, ids, context=None):
message = _("Event has been <b>confirmed</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_event_confirm", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_event_confirm", context=context)
return True
event_event()
@ -359,7 +359,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'),subtype_xml_id="mt_registration_confirm", context=context)
self.message_post(cr, uid, ids, body=_('State set to open'),subtype="mt_registration_confirm", context=context)
return self.write(cr, uid, ids, {'state': 'open'},context=context)
def create(self, cr, uid, vals, context=None):
@ -395,7 +395,7 @@ class event_registration(osv.osv):
return True
def button_reg_cancel(self, cr, uid, ids, context=None, *args):
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype_xml_id="mt_registration_cancel", context=context)
self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype="mt_registration_cancel", context=context)
return self.write(cr, uid, ids, {'state': 'cancel'})
def mail_user(self, cr, uid, ids, context=None):

View File

@ -368,7 +368,7 @@ class hr_holidays(osv.osv):
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 request has been <b>submitted</b> and is waiting for validation by the manager."), subtype_xml_id="mt_holidays_confirm", context=context)
_("The request has been <b>submitted</b> and is waiting for validation by the manager."), subtype="mt_holidays_confirm", context=context)
def holidays_first_validate_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
@ -382,12 +382,12 @@ class hr_holidays(osv.osv):
_("The request has been <b>double validated</b>. The validation process is now over."), context=context)
else:
self.message_post(cr, uid, [obj.id],
_("The request has been <b>approved</b>. The validation process is now over."), subtype_xml_id="mt_holidays_closed", context=context)
_("The request has been <b>approved</b>. The validation process is now over."), subtype="mt_holidays_closed", context=context)
def holidays_refuse_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids):
self.message_post(cr, uid, [obj.id],
_("The request has been <b>refused</b>. The validation process is now over."), subtype_xml_id="mt_holidays_refused", context=context)
_("The request has been <b>refused</b>. The validation process is now over."), subtype="mt_holidays_refused", context=context)
class resource_calendar_leaves(osv.osv):

View File

@ -476,23 +476,23 @@ class hr_applicant(base_stage, osv.Model):
for applicant in self.browse(cr, uid, ids, context=context):
if applicant.emp_id:
message = _("Applicant has been <b>hired</b> and created as an employee.")
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="mt_recruitment_hired", context=context)
self.message_post(cr, uid, [applicant.id], body=message, subtype="mt_recruitment_hired", context=context)
else:
message = _("Applicant has been <b>hired</b>.")
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="mt_recruitment_hired", context=context)
self.message_post(cr, uid, [applicant.id], body=message, subtype="mt_recruitment_hired", context=context)
return True
def case_cancel_send_note(self, cr, uid, ids, context=None):
msg = 'Applicant <b>refused</b>.'
return self.message_post(cr, uid, ids, body=msg, subtype_xml_id="mt_recruitment_refused", context=context)
return self.message_post(cr, uid, ids, body=msg, subtype="mt_recruitment_refused", context=context)
def case_reset_send_note(self, cr, uid, ids, context=None):
message =_("Applicant has been set as <b>new</b>.")
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_recruitment_new", context=context)
return self.message_post(cr, uid, ids, body=message, subtype="mt_recruitment_new", context=context)
def create_send_note(self, cr, uid, ids, context=None):
message = _("Applicant has been <b>created</b>.")
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_recruitment_new", context=context)
return self.message_post(cr, uid, ids, body=message, subtype="mt_recruitment_new", context=context)
class hr_job(osv.osv):

View File

@ -95,13 +95,13 @@ class account_analytic_account(osv.osv):
def set_close(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'close'}, context=context)
message = _("Contract has been <b>closed</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_account_closed", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_account_closed", context=context)
return True
def set_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'cancelled'}, context=context)
message = _("Contract has been <b>canceled</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_account_canceled", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_account_canceled", context=context)
return True
def set_open(self, cr, uid, ids, context=None):

View File

@ -1044,12 +1044,12 @@ class mrp_production(osv.osv):
# ---------------------------------------------------
def create_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype_xml_id="mt_mrp_order_new", context=context)
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype="mt_mrp_order_new", context=context)
return True
def action_cancel_send_note(self, cr, uid, ids, context=None):
message = _("Manufacturing order has been <b>canceled</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_mrp_order_canceled", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_mrp_order_canceled", context=context)
return True
def action_ready_send_note(self, cr, uid, ids, context=None):
@ -1064,7 +1064,7 @@ class mrp_production(osv.osv):
def action_done_send_note(self, cr, uid, ids, context=None):
message = _("Manufacturing order has been <b>done</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_mrp_order_closed", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mt_mrp_order_closed", context=context)
return True
def action_confirm_send_note(self, cr, uid, ids, context=None):

View File

@ -224,7 +224,7 @@ class mrp_production_workcenter_line(osv.osv):
for workorder in self.browse(cr, uid, ids):
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
message = _("Work order has been <b>created</b> for production order <em>%s</em>.") % (prod.id.name)
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mt_workcenter_new", context=context)
self.message_post(cr, uid, [workorder.id], body=message, subtype="mt_workcenter_new", context=context)
return True
def action_start_send_note(self, cr, uid, ids, context=None):
@ -240,7 +240,7 @@ class mrp_production_workcenter_line(osv.osv):
for workorder in self.browse(cr, uid, ids):
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
message = _("Work order has been <b>done</b> for production order <em>%s</em>.") % (prod.id.name)
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mt_workcenter_closed", context=context)
self.message_post(cr, uid, [workorder.id], body=message, subtype="mt_workcenter_closed", context=context)
return True
def action_pending_send_note(self, cr, uid, ids, context=None):
@ -256,7 +256,7 @@ class mrp_production_workcenter_line(osv.osv):
for workorder in self.browse(cr, uid, ids):
for prod in prod_obj.browse(cr, uid, [workorder.production_id]):
message = _("Work order has been <b>cancelled</b> for production order <em>%s</em>.") % (prod.id.name)
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mt_workcenter_canceled", context=context)
self.message_post(cr, uid, [workorder.id], body=message, subtype="mt_workcenter_canceled", context=context)
return True
mrp_production_workcenter_line()

View File

@ -571,40 +571,40 @@ class mrp_repair(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for repair in self.browse(cr, uid, ids, context):
message = _("Repair Order for <em>%s</em> has been <b>created</b>." % (repair.product_id.name))
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="mrp_repair_subtype_new", context=context)
self.message_post(cr, uid, [repair.id], body=message, subtype="mrp_repair_subtype_new", context=context)
return True
def set_start_send_note(self, cr, uid, ids, context=None):
for repair in self.browse(cr, uid, ids, context):
message = _("Repair Order for <em>%s</em> has been <b>started</b>." % (repair.product_id.name))
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="mrp_repair_subtype_started", context=context)
self.message_post(cr, uid, [repair.id], body=message, subtype="mrp_repair_subtype_started", context=context)
return True
def set_toinvoiced_send_note(self, cr, uid, ids, context=None):
for repair in self.browse(cr, uid, ids, context):
message = _("Draft Invoice of %s %s <b>waiting for validation</b>.") % (repair.invoice_id.amount_total, repair.invoice_id.currency_id.symbol)
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="mrp_repair_subtype_pending", context=context)
self.message_post(cr, uid, [repair.id], body=message, subtype="mrp_repair_subtype_pending", context=context)
return True
def set_confirm_send_note(self, cr, uid, ids, context=None):
for repair in self.browse(cr, uid, ids, context):
message = _( "Repair Order for <em>%s</em> has been <b>accepted</b>." % (repair.product_id.name))
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="mrp_repair_subtype_accepted", context=context)
self.message_post(cr, uid, [repair.id], body=message, subtype="mrp_repair_subtype_accepted", context=context)
return True
def set_cancel_send_note(self, cr, uid, ids, context=None):
message = _("Repair has been <b>cancelled</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_repair_subtype_cancelled", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mrp_repair_subtype_cancelled", context=context)
return True
def set_ready_send_note(self, cr, uid, ids, context=None):
message = _("Repair Order is now <b>ready</b> to repair.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_repair_subtype_ready", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mrp_repair_subtype_ready", context=context)
return True
def set_done_send_note(self, cr, uid, ids, context=None):
message = _("Repair Order is <b>closed</b>.")
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_repair_subtype_closed", context=context)
self.message_post(cr, uid, ids, body=message, subtype="mrp_repair_subtype_closed", context=context)
return True
mrp_repair()

View File

@ -496,22 +496,22 @@ class procurement_order(osv.osv):
return obj_id
def create_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been <b>created</b>."), subtype_xml_id="procurement_subtype_new", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been <b>created</b>."), subtype="procurement_subtype_new", context=context)
def confirm_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been <b>confirmed</b>."), subtype_xml_id="procurement_subtype_confirmed", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been <b>confirmed</b>."), subtype="procurement_subtype_confirmed", context=context)
def running_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>running</b>."), subtype_xml_id="procurement_subtype_running", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>running</b>."), subtype="procurement_subtype_running", context=context)
def ready_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>ready</b>."), subtype_xml_id="procurement_subtype_ready", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>ready</b>."), subtype="procurement_subtype_ready", context=context)
def cancel_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been <b>cancelled</b>."), subtype_xml_id="procurement_subtype_cancelled", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been <b>cancelled</b>."), subtype="procurement_subtype_cancelled", context=context)
def done_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Procurement has been <b>done</b>."), subtype_xml_id="procurement_subtype_closed", context=context)
self.message_post(cr, uid, ids, body=_("Procurement has been <b>done</b>."), subtype="procurement_subtype_closed", context=context)
procurement_order()

View File

@ -515,7 +515,7 @@ def Project():
return project_id
def create_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Project has been <b>created</b>."), subtype_xml_id="mt_project_new", context=context)
return self.message_post(cr, uid, ids, body=_("Project has been <b>created</b>."), subtype="mt_project_new", context=context)
def set_open_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Project has been <b>opened</b>."), context=context)
@ -527,7 +527,7 @@ def Project():
return self.message_post(cr, uid, ids, body=_("Project has been <b>canceled</b>."), context=context)
def set_close_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Project has been <b>closed</b>."), subtype_xml_id="mt_project_closed", context=context)
return self.message_post(cr, uid, ids, body=_("Project has been <b>closed</b>."), subtype="mt_project_closed", context=context)
def write(self, cr, uid, ids, vals, context=None):
# if alias_model has been changed, update alias_model_id accordingly
@ -1229,13 +1229,13 @@ class task(base_stage, osv.osv):
""" Override of the (void) default notification method. """
stage_name = self.pool.get('project.task.type').name_get(cr, uid, [stage_id], context=context)[0][1]
return self.message_post(cr, uid, ids, body=_("Stage changed to <b>%s</b>.") % (stage_name),
subtype_xml_id="mt_task_change", context=context)
subtype="mt_task_change", context=context)
def create_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), subtype_xml_id="mt_task_new", context=context)
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), subtype="mt_task_new", context=context)
def case_draft_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_('Task has been set as <b>draft</b>.'), subtype_xml_id="mt_task_new", context=context)
return self.message_post(cr, uid, ids, body=_('Task has been set as <b>draft</b>.'), subtype="mt_task_new", context=context)
def do_delegation_send_note(self, cr, uid, ids, context=None):
for task in self.browse(cr, uid, ids, context=context):

View File

@ -503,7 +503,7 @@ class project_issue(base_stage, osv.osv):
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Override of the (void) default notification method. """
stage_name = self.pool.get('project.task.type').name_get(cr, uid, [stage_id], context=context)[0][1]
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="mt_issue_new", context=context)
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype="mt_issue_new", context=context)
def case_get_note_msg_prefix(self, cr, uid, id, context=None):
""" Override of default prefix for notifications. """
@ -515,7 +515,7 @@ class project_issue(base_stage, osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
message = _("Project issue <b>created</b>.")
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_issue_new", context=context)
return self.message_post(cr, uid, ids, body=message, subtype="mt_issue_new", context=context)
def case_escalate_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):

View File

@ -746,7 +746,7 @@ class purchase_order(osv.osv):
return [('state', '=', 'draft')]
def create_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Request for quotation <b>created</b>."), subtype_xml_id="mt_purchase_new", context=context)
return self.message_post(cr, uid, ids, body=_("Request for quotation <b>created</b>."), subtype="mt_purchase_new", context=context)
def confirm_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
@ -767,13 +767,13 @@ class purchase_order(osv.osv):
self.message_post(cr, uid, [order.id], body=_("Draft Invoice of %s %s is <b>waiting for validation</b>.") % (invoice.amount_total, invoice.currency_id.symbol), context=context)
def shipment_done_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("""Shipment <b>received</b>."""), subtype_xml_id="mt_purchase_received", context=context)
self.message_post(cr, uid, ids, body=_("""Shipment <b>received</b>."""), subtype="mt_purchase_received", context=context)
def invoice_done_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype_xml_id="mt_purchase_paid", context=context)
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype="mt_purchase_paid", context=context)
def draft_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Purchase Order has been set to <b>draft</b>."), subtype_xml_id="mt_purchase_new", context=context)
return self.message_post(cr, uid, ids, body=_("Purchase Order has been set to <b>draft</b>."), subtype="mt_purchase_new", context=context)
def cancel_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):

View File

@ -94,10 +94,10 @@ class purchase_requisition(osv.osv):
self.message_post(cr, uid, ids, body=_("Draft Requisition has been <b>sent to suppliers</b>."), context=context)
def reset_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been set to <b>draft</b>."), subtype_xml_id="mt_requisition_new", context=context)
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been set to <b>draft</b>."), subtype="mt_requisition_new", context=context)
def done_to_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>done</b>."), subtype_xml_id="mt_requisition_closed", context=context)
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>done</b>."), subtype="mt_requisition_closed", context=context)
def cancel_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>cancelled</b>."), context=context)
@ -183,7 +183,7 @@ class purchase_requisition(osv.osv):
return res
def create_send_note(self, cr, uid, ids, context=None):
return self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>created</b>."), subtype_xml_id="mt_requisition_new", context=context)
return self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>created</b>."), subtype="mt_requisition_new", context=context)
def create(self, cr, uid, vals, context=None):
requisition = super(purchase_requisition, self).create(cr, uid, vals, context=context)

View File

@ -1029,7 +1029,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 <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), subtype_xml_id="mt_sale_new", context=context)
self.message_post(cr, uid, [obj.id], body=_("Quotation for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), subtype="mt_sale_new", context=context)
def confirm_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
@ -1049,10 +1049,10 @@ class sale_order(osv.osv):
self.message_post(cr, uid, [order.id], body=_("Delivery Order <em>%s</em> <b>scheduled</b> for %s.") % (picking.name, picking_date_str), context=context)
def delivery_end_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Order <b>delivered</b>."), subtype_xml_id="mt_sale_delivered", context=context)
self.message_post(cr, uid, ids, body=_("Order <b>delivered</b>."), subtype="mt_sale_delivered", context=context)
def invoice_paid_send_note(self, cr, uid, ids, context=None):
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype_xml_id="sale_subtype_paid", context=context)
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype="sale_subtype_paid", context=context)
def invoice_send_note(self, cr, uid, ids, invoice_id, context=None):
for order in self.browse(cr, uid, ids, context=context):

View File

@ -1386,13 +1386,13 @@ class stock_picking(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=_("%s has been <b>created</b>.") % (self._get_document_type(obj.type)), subtype_xml_id="mt_stock_new", context=context)
self.message_post(cr, uid, [obj.id], body=_("%s has been <b>created</b>.") % (self._get_document_type(obj.type)), subtype="mt_stock_new", context=context)
def scrap_send_note(self, cr, uid, ids, quantity, uom, name, context=None):
return self.message_post(cr, uid, ids, body=_("%s %s %s has been <b>moved to</b> scrap.") % (quantity, uom, name), context=context)
def back_order_send_note(self, cr, uid, ids, back_name, context=None):
return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_name), subtype_xml_id="mt_stock_new", context=context)
return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_name), subtype="mt_stock_new", context=context)
def ship_done_send_note(self, cr, uid, ids, context=None):
type_dict = {
@ -1405,7 +1405,7 @@ class stock_picking(osv.osv):
'in': 'mt_stock_received'
}
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("Products have been <b>%s</b>.") % (type_dict.get(obj.type, 'move done')), subtype_xml_id=xml_id_dict.get(obj.type), context=context)
self.message_post(cr, uid, [obj.id], body=_("Products have been <b>%s</b>.") % (type_dict.get(obj.type, 'move done')), subtype=xml_id_dict.get(obj.type), context=context)
def ship_cancel_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):