diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 9dcbd877c67..b8f3a9071a0 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -1306,15 +1306,15 @@ 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 created.") % (self._get_document_type(obj.type)), subtype="new", context=context)
+ self.message_post(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), subtype_xml_id="analytic_subtype_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 paid.") % (self._get_document_type(obj.type)), subtype="paid", context=context)
+ self.message_post(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), subtype_xml_id="invoice_subtype_paid", 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)), subtype="cancelled", context=context)
+ self.message_post(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), subtype_xml_id="invoice_subtype_cancelled", context=context)
account_invoice()
class account_invoice_line(osv.osv):
diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml
index bf3b3152552..7689ca2c253 100644
--- a/addons/account/data/account_data.xml
+++ b/addons/account/data/account_data.xml
@@ -560,28 +560,20 @@
Invoice
account.invoice
-
+
+
new
-
+ account.invoice
-
+
paid
-
+ account.invoice
-
+
cancelled
-
+ account.invoice
-
-
-
-
-
-
-
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index ae670b3d0b7..05a75f5847d 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -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 created." % self._document_type[obj.type or False]
- self.message_post(cr, uid, [obj.id], body=message, subtype="new", context=context)
+ self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="voucher_subtype_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 posted." % (self._document_type[obj.type or False], obj.move_id.name)
- self.message_post(cr, uid, [obj.id], body=message, subtype="post", context=context)
+ self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="voucher_subtype_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 reconciled." % self._document_type[obj.type or False]
- self.message_post(cr, uid, [obj.id], body=message, subtype="reconcile", context=context)
+ self.message_post(cr, uid, [obj.id], body=message, subtype_xml_id="voucher_subtype_reconcile", context=context)
account_voucher()
diff --git a/addons/account_voucher/account_voucher_data.xml b/addons/account_voucher/account_voucher_data.xml
index a99a8735842..a59993aae6b 100644
--- a/addons/account_voucher/account_voucher_data.xml
+++ b/addons/account_voucher/account_voucher_data.xml
@@ -13,27 +13,19 @@ If you want to use advanced accounting features, you should install the "Account
Module eInvoicing & Payments has been installed.
-
-
+
+ new
+ account.voucher
-
+
post
-
+ account.voucher
-
+
reconcile
-
+ account.voucher
-
-
-
-
-
-
-
diff --git a/addons/analytic/__openerp__.py b/addons/analytic/__openerp__.py
index 10762a1d2be..d90b2fd62ac 100644
--- a/addons/analytic/__openerp__.py
+++ b/addons/analytic/__openerp__.py
@@ -38,7 +38,8 @@ that have no counterpart in the general financial accounts.
'security/analytic_security.xml',
'security/ir.model.access.csv',
'analytic_sequence.xml',
- 'analytic_view.xml'
+ 'analytic_view.xml',
+ 'analytic_data.xml'
],
'demo': [],
'installable': True,
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index a44fcb01653..250ad98a603 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -281,7 +281,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 %s has been created.") % (obj.partner_id.name), subtype="new", context=context)
+ self.message_post(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), subtype_xml_id="analytic_subtype_new", context=context)
account_analytic_account()
diff --git a/addons/analytic/analytic_data.xml b/addons/analytic/analytic_data.xml
new file mode 100644
index 00000000000..cfd3b5e9b78
--- /dev/null
+++ b/addons/analytic/analytic_data.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ new
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/base_status/base_stage.py b/addons/base_status/base_stage.py
index 9bb2764d8bd..2695567e0a1 100644
--- a/addons/base_status/base_stage.py
+++ b/addons/base_status/base_stage.py
@@ -362,17 +362,30 @@ class base_stage(object):
msg = _('%s has been opened.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
self.message_post(cr, uid, [id], body=msg, context=context)
return True
+
+ def find_xml_id(self,cr,uid,ids,name,context=None):
+ subtype_obj = self.pool.get('mail.message.subtype')
+ ir_model_data_obj = self.pool.get('ir.model.data')
+ subtype_ids = subtype_obj.search(cr,uid,[('res_model','=',self._name),('name','=',name)])
+ ir_data_ids = ir_model_data_obj.search(cr,uid,[('model','=','mail.message.subtype'),('res_id','in',subtype_ids)])
+ xml_id = 'mail_subtype_comment'
+ ir_model_data_record = ir_model_data_obj.browse(cr,uid,ir_data_ids)
+ if ir_model_data_record:
+ xml_id = ir_model_data_record[0].name
+ return xml_id
def case_close_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been closed.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
- self.message_post(cr, uid, [id], body=msg, subtype="closed", context=context)
+ xml_id = self.find_xml_id(cr, uid, ids, name="closed", context=context)
+ self.message_post(cr, uid, [id], body=msg, subtype_xml_id=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 cancelled.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
- self.message_post(cr, uid, [id], body=msg, subtype="cancelled", context=context)
+ xml_id = self.find_xml_id(cr, uid, ids, name="cancelled", context=context)
+ self.message_post(cr, uid, [id], body=msg, subtype_xml_id=xml_id, context=context)
return True
def case_pending_send_note(self, cr, uid, ids, context=None):
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index b7cc0f840d9..81ca828dc76 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -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 %s.") % (stage_name), subtype="stage change",context=context)
+ return self.message_post(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype_xml_id="crm_subtype_stage_change",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 created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context))
- self.message_post(cr, uid, [id], body=message, subtype="new", context=context)
+ self.message_post(cr, uid, [id], body=message, subtype_xml_id="crm_subtype_new", context=context)
return True
def case_mark_lost_send_note(self, cr, uid, ids, context=None):
message = _("Opportunity has been lost.")
- return self.message_post(cr, uid, ids, body=message,subtype="lost", context=context)
+ return self.message_post(cr, uid, ids, body=message,subtype_xml_id="crm_subtype_lost", context=context)
def case_mark_won_send_note(self, cr, uid, ids, context=None):
message = _("Opportunity has been won.")
- return self.message_post(cr, uid, ids, body=message, subtype="won", context=context)
+ return self.message_post(cr, uid, ids, body=message, subtype_xml_id="crm_subtype_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]
diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml
index 9b3f5d7ec75..633782ed233 100644
--- a/addons/crm/crm_lead_data.xml
+++ b/addons/crm/crm_lead_data.xml
@@ -155,32 +155,29 @@
-
+
new
-
+ crm.lead
-
+
won
-
+ crm.lead
-
+
lost
-
-
-
- stage change
-
+ crm.lead
-
-
+
+ stage change
+ crm.lead
+
-
-
-
+
+ cancelled
+ crm.lead
+
diff --git a/addons/crm/test/process/crm_message_subtype.yml b/addons/crm/test/process/crm_message_subtype.yml
index 3dd042c1279..a1ad9a9c39a 100644
--- a/addons/crm/test/process/crm_message_subtype.yml
+++ b/addons/crm/test/process/crm_message_subtype.yml
@@ -3,25 +3,14 @@
-
!record {model: mail.message.subtype, id: mail.mail_subtype_won }:
name: won
- model_ids:
- - crm.model_crm_lead
+ res_model: crm.lead
default: False
--
- I have add the sub_type name email with default true
--
- !record {model: mail.message.subtype, id: mail.mail_subtype_email }:
- name: email
- model_ids:
- - crm.model_crm_lead
- default: True
-
I have add the sub_type name comment with default true
-
!record {model: mail.message.subtype, id: mail.mail_subtype_comment }:
name: comment
- model_ids:
- - crm.model_crm_lead
- default: True
+ res_model: crm.lead
-
I have add the subtypes as won in feeds
-
diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py
index 535f6d20367..ce2427b9752 100644
--- a/addons/crm_claim/crm_claim.py
+++ b/addons/crm_claim/crm_claim.py
@@ -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 created.')
- return self.message_post(cr, uid, ids, body=msg, context=context)
+ return self.message_post(cr, uid, ids, body=msg, subtype_xml_id='claim_subtype_new', context=context)
def case_refuse_send_note(self, cr, uid, ids, context=None):
msg = _('Claim has been refused.')
- return self.message_post(cr, uid, ids, body=msg, context=context)
+ return self.message_post(cr, uid, ids, body=msg, subtype_xml_id='claim_subtype_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 %s.") % (stage_name), context=context)
+ return self.message_post(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype_xml_id='claim_subtype_stage_change', context=context)
class res_partner(osv.osv):
diff --git a/addons/crm_claim/crm_claim_data.xml b/addons/crm_claim/crm_claim_data.xml
index 33bd280c364..e68bc3ad6cb 100644
--- a/addons/crm_claim/crm_claim_data.xml
+++ b/addons/crm_claim/crm_claim_data.xml
@@ -75,6 +75,31 @@
+
+
+
+ new
+ crm.claim
+
+
+
+ refused
+ crm.claim
+
+
+
+ stage change
+ crm.claim
+
+
+ cancelled
+ crm.claim
+
+
+
+ closed
+ crm.claim
+
diff --git a/addons/event/event.py b/addons/event/event.py
index 8c755456d9c..82c0390ee03 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -287,27 +287,27 @@ class event_event(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
message = _("Event has been created.")
- self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_new", context=context)
return True
def button_cancel_send_note(self, cr, uid, ids, context=None):
message = _("Event has been cancelled.")
- self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_cancelled", context=context)
return True
def button_draft_send_note(self, cr, uid, ids, context=None):
message = _("Event has been set to draft.")
- self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_new", context=context)
return True
def button_done_send_note(self, cr, uid, ids, context=None):
message = _("Event has been done.")
- self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_closed", context=context)
return True
def button_confirm_send_note(self, cr, uid, ids, context=None):
message = _("Event has been confirmed.")
- self.message_post(cr, uid, ids, body=message, subtype="confirmed", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="event_subtype_confirmed", context=context)
return True
event_event()
@@ -353,7 +353,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'), context=context)
+ self.message_post(cr, uid, ids, body=_('State set to open'),subtype_xml_id="registration_subtype_confirmed", context=context)
return self.write(cr, uid, ids, {'state': 'open'},context=context)
def create(self, cr, uid, vals, context=None):
@@ -383,13 +383,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'), subtype="closed", context=context)
+ self.message_post(cr, uid, ids, body=_('State set to Done'), subtype_xml_id="registration_subtype_closed", 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'), subtype="cancelled", context=context)
+ self.message_post(cr, uid, ids, body=_('State set to Cancel'), subtype_xml_id="registration_subtype_cancelled", context=context)
return self.write(cr, uid, ids, {'state': 'cancel'})
def mail_user(self, cr, uid, ids, context=None):
@@ -459,12 +459,12 @@ class event_registration(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
message = _("Registration has been created.")
- self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", context=context)
return True
def do_draft_send_note(self, cr, uid, ids, context=None):
message = _("Registration has been set as draft.")
- self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
+ self.message_post(cr, uid, ids, body=message, subtype_xml_id="registration_subtype_new", context=context)
return True
event_registration()
diff --git a/addons/event/event_data.xml b/addons/event/event_data.xml
index 608dcdb4e8f..bc7f71ef664 100644
--- a/addons/event/event_data.xml
+++ b/addons/event/event_data.xml
@@ -12,34 +12,47 @@
automatic
100
-
+
+
new
-
+ event.event
-
+
closed
-
+ event.event
-
+
cancelled
-
+ event.event
-
+
confirmed
-
+ event.event
-
-
-
-