[MERGE]:subtype
bzr revid: apa@tinyerp.com-20120914094435-s1pchztypph55qae
This commit is contained in:
@@ -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 <b>created</b>.") % (self._get_document_type(obj.type)), subtype="new", context=context)
|
||||
self.message_post(cr, uid, [obj.id],body=_("%s <b>created</b>.") % (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 <b>paid</b>.") % (self._get_document_type(obj.type)), subtype="paid", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (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 <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype_xml_id="invoice_subtype_cancelled", context=context)
|
||||
account_invoice()
|
||||
|
||||
class account_invoice_line(osv.osv):
|
||||
|
||||
@@ -560,28 +560,20 @@
|
||||
<field name="name">Invoice</field>
|
||||
<field name="object">account.invoice</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
|
||||
<record id="mail.invoice_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('analytic.model_account_analytic_account')),(4,ref('account.model_account_invoice'))]"/>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_paid" model="mail.message.subtype">
|
||||
<record id="mail.invoice_subtype_paid" model="mail.message.subtype">
|
||||
<field name="name">paid</field>
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
|
||||
<field name="res_model">account.invoice</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.invoice_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice')), (4,ref('analytic.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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="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 <b>posted</b>." % (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 <b>reconciled</b>." % 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()
|
||||
|
||||
|
||||
@@ -13,27 +13,19 @@ If you want to use advanced accounting features, you should install the "Account
|
||||
<value>Module eInvoicing & Payments has been installed.</value>
|
||||
</function>
|
||||
<!-- Message Sub Type -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
<record id="mail.voucher_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">account.voucher</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_post" model="mail.message.subtype">
|
||||
<record id="mail.voucher_subtype_post" model="mail.message.subtype">
|
||||
<field name="name">post</field>
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_reconcile" model="mail.message.subtype">
|
||||
<record id="mail.voucher_subtype_reconcile" model="mail.message.subtype">
|
||||
<field name="name">reconcile</field>
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('account_voucher.model_account_voucher'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), subtype="new", 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="analytic_subtype_new", context=context)
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="mail.analytic_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -362,17 +362,30 @@ class base_stage(object):
|
||||
msg = _('%s has been <b>opened</b>.') % (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 <b>closed</b>.') % (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 <b>cancelled</b>.') % (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):
|
||||
|
||||
@@ -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="stage change",context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (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 <b>created</b>.")% (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 <b>lost</b>.")
|
||||
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 <b>won</b>.")
|
||||
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]
|
||||
|
||||
@@ -155,32 +155,29 @@
|
||||
</record>
|
||||
|
||||
<!-- mail subtype -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.crm_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_won" model="mail.message.subtype">
|
||||
<record id="mail.crm_subtype_won" model="mail.message.subtype">
|
||||
<field name="name">won</field>
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
<field name="res_model">crm.lead</field>
|
||||
</record>
|
||||
<record id="mail_subtype_lost" model="mail.message.subtype">
|
||||
<record id="mail.crm_subtype_lost" model="mail.message.subtype">
|
||||
<field name="name">lost</field>
|
||||
<field name="model_ids" eval="[(4, ref('crm.model_crm_lead'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
<record id="mail.crm_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('crm.model_crm_lead'))]"/>
|
||||
<record id="mail.crm_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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
|
||||
-
|
||||
|
||||
@@ -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, 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 <b>refused</b>.')
|
||||
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 <b>%s</b>.") % (stage_name), context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id='claim_subtype_stage_change', context=context)
|
||||
|
||||
|
||||
class res_partner(osv.osv):
|
||||
|
||||
@@ -75,6 +75,31 @@
|
||||
<field name="case_default" eval="True"/>
|
||||
<field name="fold" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.claim_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">crm.claim</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.claim_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="res_model">crm.claim</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.claim_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="res_model">crm.claim</field>
|
||||
</record>
|
||||
<record id="mail.claim_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">crm.claim</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.claim_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">crm.claim</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+10
-10
@@ -287,27 +287,27 @@ 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="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 <b>cancelled</b>.")
|
||||
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 <b>draft</b>.")
|
||||
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 <b>done</b>.")
|
||||
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 <b>confirmed</b>.")
|
||||
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 <b>created</b>.")
|
||||
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 <b>draft</b>.")
|
||||
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()
|
||||
|
||||
+28
-15
@@ -12,34 +12,47 @@
|
||||
<field name="type">automatic</field>
|
||||
<field name="sequence">100</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<!-- Event subtype -->
|
||||
<record id="mail.event_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="res_model">event.event</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_confirmed" model="mail.message.subtype">
|
||||
<record id="mail.event_subtype_confirmed" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
|
||||
<!-- Event registration subtype -->
|
||||
<record id="mail.registration_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('event.model_event_event')),(4,ref('event.model_event_registration'))]"/>
|
||||
<record id="mail.registration_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">event.event</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.registration_subtype_confirmed" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
<function model="mail.group" name="message_post">
|
||||
|
||||
@@ -364,7 +364,7 @@ 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 request has been <b>created</b> and is waiting confirmation."),subtype="new", context=context)
|
||||
_("The request has been <b>created</b> and is waiting confirmation."),subtype_xml_id="hr_holidays_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
def holidays_confirm_notificate(self, cr, uid, ids, context=None):
|
||||
@@ -384,12 +384,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="approved", context=context)
|
||||
_("The request has been <b>approved</b>. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_approved", 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="refused", context=context)
|
||||
_("The request has been <b>refused</b>. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_refused", context=context)
|
||||
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
|
||||
@@ -50,28 +50,19 @@ Once validated, they are visible in the employee's calendar. HR officers can def
|
||||
<field name="color_name">brown</field>
|
||||
</record>
|
||||
<!--Sub type data -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_approved" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_approved" model="mail.message.subtype">
|
||||
<field name="name">approved</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -461,14 +461,14 @@ class hr_applicant(base_stage, osv.Model):
|
||||
""" Override of the (void) default notification method. """
|
||||
if not stage_id: return True
|
||||
stage_name = self.pool.get('hr.recruitment.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="stage change", context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="hr_recruitment_subtype_stage_change", context=context)
|
||||
|
||||
def case_get_note_msg_prefix(self, cr, uid, id, context=None):
|
||||
return 'Applicant'
|
||||
|
||||
def case_open_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Applicant has been set <b>in progress</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="in progress", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_in_progress", context=context)
|
||||
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
@@ -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="hired", context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_hired", context=context)
|
||||
else:
|
||||
message = _("Applicant has been <b>hired</b>.")
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype="hired", context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_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="refused", context=context)
|
||||
return self.message_post(cr, uid, ids, body=msg, subtype_xml_id="hr_recruitment_subtype_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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_new", context=context)
|
||||
|
||||
|
||||
class hr_job(osv.osv):
|
||||
|
||||
@@ -462,38 +462,29 @@ You can automatically receive job application though an email gateway, see the H
|
||||
</record>
|
||||
|
||||
<!--Data for the sub type -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_hired" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_hired" model="mail.message.subtype">
|
||||
<field name="name">hired</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_in_progress" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_in_progress" model="mail.message.subtype">
|
||||
<field name="name">in progress</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -95,25 +95,25 @@ 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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_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>cancelled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_invoice_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
def set_open(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'open'}, context=context)
|
||||
message = _("Contract has been <b>opened</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="open", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_open", context=context)
|
||||
return True
|
||||
|
||||
def set_pending(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'pending'}, context=context)
|
||||
message = _("Contract has been set as <b>pending</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="pending", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_pending", context=context)
|
||||
return True
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
@@ -17,32 +17,23 @@
|
||||
<field name="factor">50.0</field>
|
||||
</record>
|
||||
<!-- Sub Type Data -->
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_invoice_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+4
-4
@@ -67,21 +67,21 @@ class idea_idea(osv.osv):
|
||||
|
||||
def idea_cancel(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, { 'state': 'cancel' })
|
||||
self.message_post(cr, uid, ids, body=_('Idea cancelled.'), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea cancelled.'), subtype_xml_id="idea_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
def idea_open(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, { 'state': 'open'})
|
||||
self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype="open", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype_xml_id="idea_subtype_open", context=context)
|
||||
return True
|
||||
|
||||
def idea_close(self, cr, uid, ids, context={}):
|
||||
self.message_post(cr, uid, ids, body=_('Idea closed.'), subtype="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea closed.'), subtype_xml_id="idea_subtype_closed", context=context)
|
||||
self.write(cr, uid, ids, { 'state': 'close' })
|
||||
return True
|
||||
|
||||
def idea_draft(self, cr, uid, ids, context={}):
|
||||
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype_xml_id="idea_subtype_new", context=context)
|
||||
self.write(cr, uid, ids, { 'state': 'draft' })
|
||||
return True
|
||||
idea_idea()
|
||||
|
||||
@@ -17,32 +17,23 @@
|
||||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.idea_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
<field name="res_model">idea.idea</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<record id="mail.idea_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
<field name="res_model">idea.idea</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.idea_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
<field name="res_model">idea.idea</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.idea_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('idea.model_idea_idea'))]"/>
|
||||
<field name="res_model">idea.idea</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -13,18 +13,8 @@
|
||||
<field eval="'()'" name="args"/>
|
||||
</record>
|
||||
|
||||
<record id="mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="name">other</field>
|
||||
<field name="model_ids" eval="[(4,ref('mail.model_mail_group'))]"/>
|
||||
<field name="default" eval='False'/>
|
||||
</record>
|
||||
<record id="mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="name">email</field>
|
||||
<field name="model_ids" eval="[(4,ref('mail.model_mail_group'))]"/>
|
||||
</record>
|
||||
<record id="mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="name">comment</field>
|
||||
<field name="model_ids" eval="[(4,ref('mail.model_mail_group'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -344,6 +344,9 @@ class mail_message(osv.Model):
|
||||
follow_ids = followers_obj.search(cr, uid, [('partner_id','=',p_id),('subtype_ids','in',[message.subtype_id.id]),('res_model','=',message.model),('res_id','=',message.res_id)], context=context)
|
||||
if follow_ids and len(follow_ids):
|
||||
missing_follow_ids.append(p_id)
|
||||
subtype_record = self.pool.get('mail.message.subtype').browse(cr, uid, message.subtype_id.id,context=context)
|
||||
if not subtype_record.res_model:
|
||||
missing_follow_ids.append(p_id)
|
||||
message.write({'partner_ids': [(4, p_id) for p_id in missing_follow_ids]})
|
||||
partners_to_notify |= extra_notified
|
||||
self.pool.get('mail.notification').notify(cr, uid, list(partners_to_notify), newid, context=context)
|
||||
|
||||
@@ -29,15 +29,9 @@ class mail_message_subtype(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Message Subtype ', size = 128,
|
||||
required = True, help = 'Message subtype, gives a more precise type on the message, especially for system notifications. For example, it can be a notification related to a new record (New), or to a stage change in a process (Stage change). Message subtypes allow to precisely tune the notifications the user want to receive on its wall.'),
|
||||
'model_ids': fields.many2many('ir.model',
|
||||
'mail_message_subtyp_message_rel',
|
||||
'message_subtype_id', 'model_id', 'Model',
|
||||
help = "link some subtypes to several models, for projet/task"),
|
||||
'res_model': fields.char('Model',size = 128, help = "link subtype to model"),
|
||||
'default': fields.boolean('Default', help = "When subscribing to the document, users will receive by default messages related to this subtype unless they uncheck this subtype"),
|
||||
}
|
||||
_defaults = {
|
||||
'default': True,
|
||||
}
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', 'The name of the message subtype must be unique !')
|
||||
]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Subtype">
|
||||
<field name="name"/>
|
||||
<field name="model_ids" invisible="1"/>
|
||||
<field name="res_model" invisible="1"/>
|
||||
<field name="default"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -30,13 +30,12 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="res_model"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="default"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="Models"/>
|
||||
<field name="model_ids" widget="many2many"/>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
+11
-10
@@ -562,7 +562,7 @@ class mail_thread(osv.AbstractModel):
|
||||
self.message_post(cr, uid, [id], message, context=context)
|
||||
|
||||
def message_post(self, cr, uid, thread_id, body='', subject=False,
|
||||
type='notification', parent_id=False, attachments=None, subtype='comment', context=None, **kwargs):
|
||||
type='notification', parent_id=False, attachments=None, subtype_xml_id='mail_subtype_comment', context=None, **kwargs):
|
||||
""" Post a new message in an existing thread, returning the new
|
||||
mail.message ID. Extra keyword arguments will be used as default
|
||||
column values for the new mail.message record.
|
||||
@@ -599,12 +599,13 @@ class mail_thread(osv.AbstractModel):
|
||||
|
||||
values = kwargs
|
||||
subtype_obj = self.pool.get('mail.message.subtype')
|
||||
if subtype:
|
||||
subtypes = subtype_obj.name_search(cr, uid, subtype,context=context)
|
||||
if len(subtypes):
|
||||
subtype_browse = subtype_obj.browse(cr, uid, subtypes[0][0],context=context)
|
||||
if self._name in [model.model for model in subtype_browse.model_ids]:
|
||||
values['subtype_id']=subtype_browse.id
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', subtype_xml_id)
|
||||
if subtype_xml_id:
|
||||
subtype_browse = subtype_obj.browse(cr, uid, ref[1],context=context)
|
||||
if self._name == subtype_browse.res_model:
|
||||
values['subtype_id']=subtype_browse.id
|
||||
if not subtype_browse.res_model:
|
||||
values['subtype_id']=subtype_browse.id
|
||||
values.update({
|
||||
'model': context.get('thread_model', self._name) if thread_id else False,
|
||||
'res_id': thread_id or False,
|
||||
@@ -628,11 +629,11 @@ class mail_thread(osv.AbstractModel):
|
||||
partner_ids = [user.partner_id.id for user in self.pool.get('res.users').browse(cr, uid, user_ids, context=context)]
|
||||
return self.message_subscribe(cr, uid, ids, partner_ids, context=context)
|
||||
|
||||
def message_subscribe(self, cr, uid, ids, partner_ids, context=None):
|
||||
def message_subscribe(self, cr, uid, ids, partner_ids,subtype_ids=None, context=None):
|
||||
""" Add partners to the records followers. """
|
||||
if not subtype_ids:
|
||||
subtype_obj = self.pool.get('mail.message.subtype')
|
||||
subtype_ids = subtype_obj.search(cr, uid, [('default', '=', 'true'),('model_ids.model', '=', self._name)],context=context)
|
||||
subtype_ids = subtype_obj.search(cr, uid, [('default', '=', 'true'),('res_model', '=', self._name)],context=context)
|
||||
if subtype_ids:
|
||||
self.message_subscribe_udpate_subtypes(cr, uid, ids, partner_ids, subtype_ids, context=context)
|
||||
return self.write(cr, uid, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context)
|
||||
@@ -679,6 +680,6 @@ class mail_thread(osv.AbstractModel):
|
||||
def message_subscribe_udpate_subtypes(self, cr, uid, ids, user_id, subtype_ids,context=None):
|
||||
followers_obj = self.pool.get('mail.followers')
|
||||
followers_ids = followers_obj.search(cr, uid, [('res_model', '=', self._name), ('res_id', 'in', ids)], context=context)
|
||||
return followers_obj.write(cr, uid, followers_ids, {'subtype_ids': [(6, 0 , subtype_ids)]}, context = context) #overright or add new one
|
||||
return followers_obj.write(cr, uid, followers_ids, {'subtype_ids': [(6, 0 , subtype_ids)]}, context = context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -156,7 +156,7 @@ openerp_mail_followers = function(session, mail) {
|
||||
//fetch subtype from subtype model
|
||||
fetch_subtype: function () {
|
||||
var self = this
|
||||
var subtype_object = this.sub_model.call('search', [[['model_ids.model','=',this.view.model]]]);
|
||||
var subtype_object = this.sub_model.call('search', [[['res_model','=',this.view.model]]]);
|
||||
subtype_object.then(function (subtype_ids){
|
||||
self.sub_model.call('read', [subtype_ids || self.get_value(),['name', 'default']]).then(self.proxy('display_subtype'));
|
||||
});
|
||||
|
||||
@@ -673,10 +673,6 @@ class test_mail(TestMailMockups):
|
||||
_mail_bodyalt2 = 'Pigs rules\nAdmin\n'
|
||||
filter_subtype_id = self.mail_message_subtype.search(cr, uid, [('default','=',True)])
|
||||
# Post comment with body and subject, comment preference
|
||||
msg_id = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body1, subject=_subject, type='comment',subtype='email')
|
||||
msg_id = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body1, subject=_subject, type='comment',subtype_xml_id='mail_subtype_comment')
|
||||
notif_ids = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id)])
|
||||
self.assertTrue(len(notif_ids) >= 1,"subtype is email and show notification on wall")
|
||||
# New post: test automatic subject, signature in html, add a partner, email preference, parent_id previous message
|
||||
msg_id2 = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body2,subject=_subject, type='email', subtype='other')
|
||||
notif_ids2 = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id2)])
|
||||
self.assertTrue(len(notif_ids2) == 0,"subtype is false cannot show notification on wall")
|
||||
|
||||
+5
-5
@@ -1044,27 +1044,27 @@ 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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), subtype_xml_id="mrp_subtype_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="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
def action_ready_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>ready to produce</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="ready", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_ready", context=context)
|
||||
return True
|
||||
|
||||
def action_in_production_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Manufacturing order is <b>in production</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="production", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_production", context=context)
|
||||
return True
|
||||
|
||||
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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
def action_confirm_send_note(self, cr, uid, ids, context=None):
|
||||
|
||||
+10
-19
@@ -27,38 +27,29 @@ From the Manufacturing Settings, you can choose to compute production schedules
|
||||
<field name="number_increment">1</field>
|
||||
</record>
|
||||
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_ready" model="mail.message.subtype">
|
||||
<field name="name">ready</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_production" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_production" model="mail.message.subtype">
|
||||
<field name="name">production</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mrp_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp.model_mrp_production'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -58,6 +58,7 @@ So, that we can compare the theoretic delay and real delay.
|
||||
'depends': ['mrp'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'mrp_operation_data.xml',
|
||||
'mrp_operations_workflow.xml',
|
||||
'mrp_operations_view.xml',
|
||||
'mrp_operations_report.xml',
|
||||
@@ -65,7 +66,7 @@ So, that we can compare the theoretic delay and real delay.
|
||||
'process/mrp_operation_process.xml',
|
||||
'mrp_operations_workflow_instance.xml'
|
||||
],
|
||||
'demo': ['mrp_operation_data.xml',
|
||||
'demo': [
|
||||
'mrp_operations_demo.yml'
|
||||
],
|
||||
'test': [
|
||||
|
||||
@@ -31,38 +31,29 @@
|
||||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_started" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_started" model="mail.message.subtype">
|
||||
<field name="name">started</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mrp_operations_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
<field name="res_model">mrp.production.workcenter.line</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_operations.model_mrp_production_workcenter_line'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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="new", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mrp_operations_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
def action_start_send_note(self, cr, uid, ids, context=None):
|
||||
@@ -232,7 +232,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>started</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="started", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mrp_operations_subtype_started", context=context)
|
||||
return True
|
||||
|
||||
def action_done_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="closed", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mrp_operations_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
def action_pending_send_note(self, cr, uid, ids, context=None):
|
||||
@@ -248,7 +248,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 is <b>pending</b> for production order <em>%s</em>.") % (prod.id.name)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype="pending", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mrp_operations_subtype_pending", context=context)
|
||||
return True
|
||||
|
||||
def action_cancel_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="cancelled", context=context)
|
||||
self.message_post(cr, uid, [workorder.id], body=message, subtype_xml_id="mrp_operations_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
mrp_production_workcenter_line()
|
||||
|
||||
@@ -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="new", context=context)
|
||||
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="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="started", context=context)
|
||||
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="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="pending", context=context)
|
||||
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="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="accepted", context=context)
|
||||
self.message_post(cr, uid, [repair.id], body=message, subtype_xml_id="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="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="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="ready", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_repair_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
mrp_repair()
|
||||
|
||||
@@ -1,47 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_started" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_started" model="mail.message.subtype">
|
||||
<field name="name">started</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_ready" model="mail.message.subtype">
|
||||
<field name="name">ready</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_accepted" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_accepted" model="mail.message.subtype">
|
||||
<field name="name">accepted</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mrp_repair_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
<field name="res_model">mrp.repair</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('mrp_repair.model_mrp_repair'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been <b>created</b>."), subtype_xml_id="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="confirmed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been <b>confirmed</b>."), subtype_xml_id="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="running", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>running</b>."), subtype_xml_id="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="ready", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been set to <b>ready</b>."), subtype_xml_id="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="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been <b>cancelled</b>."), subtype_xml_id="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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Procurement has been <b>done</b>."), subtype_xml_id="procurement_subtype_closed", context=context)
|
||||
|
||||
procurement_order()
|
||||
|
||||
|
||||
@@ -32,36 +32,29 @@
|
||||
<!--
|
||||
Mail: mail.message.subtype
|
||||
-->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<record id="mail.procurement_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_confirmed" model="mail.message.subtype">
|
||||
<record id="mail.procurement_subtype_confirmed" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_ready" model="mail.message.subtype">
|
||||
<record id="mail.procurement_subtype_ready" model="mail.message.subtype">
|
||||
<field name="name">ready</field>
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_running" model="mail.message.subtype">
|
||||
<record id="mail.procurement_subtype_running" model="mail.message.subtype">
|
||||
<field name="name">running</field>
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<record id="mail.procurement_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.procurement_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('procurement.model_procurement_order'))]"/>
|
||||
<field name="res_model">procurement.order</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -514,23 +514,23 @@ 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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Project has been <b>created</b>."), subtype_xml_id="project_subtype_new", context=context)
|
||||
|
||||
def set_open_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Project has been <b>opened</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="open", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="project_subtype_open", context=context)
|
||||
|
||||
def set_pending_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Project is now <b>pending</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="pending", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="project_subtype_pending", context=context)
|
||||
|
||||
def set_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Project has been <b>cancelled</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="project_subtype_cancelled", context=context)
|
||||
|
||||
def set_close_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Project has been <b>closed</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="project_subtype_closed", context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
# if alias_model has been changed, update alias_model_id accordingly
|
||||
@@ -1231,10 +1231,10 @@ class task(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="stage change", context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="task_subtype_stage_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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), subtype_xml_id="task_subtype_new", context=context)
|
||||
|
||||
def case_draft_send_note(self, cr, uid, ids, context=None):
|
||||
msg = _('Task has been set as <b>draft</b>.')
|
||||
|
||||
@@ -85,43 +85,48 @@
|
||||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.project_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<record id="mail.task_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.project_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project'))]"/>
|
||||
<field name="res_model">project.project</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.project_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project'))]"/>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.project_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
<field name="res_model">project.project</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.task_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">project.task</field>
|
||||
</record>
|
||||
<record id="mail.project_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<record id="mail.task_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.task_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_task'))]"/>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project.model_project_project')),(4,ref('project.model_project_task'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
<record model="mail.message" id="module_install_notification">
|
||||
|
||||
@@ -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="stage change", context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="issue_subtype_stage_change", 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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="issue_subtype_new", context=context)
|
||||
|
||||
def case_escalate_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
@@ -32,33 +32,24 @@
|
||||
</record>
|
||||
|
||||
<!--Sub type Data -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.issue_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<record id="mail.issue_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.issue_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.issue_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('project_issue.model_project_issue'))]"/>
|
||||
<field name="res_model">project.issue</field>
|
||||
</record>
|
||||
<!-- notify all employees of module installation -->
|
||||
<record model="mail.message" id="module_install_notification">
|
||||
|
||||
@@ -740,7 +740,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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Request for quotation <b>created</b>."), subtype_xml_id="purchase_subtype_new", context=context)
|
||||
|
||||
def confirm_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
@@ -758,20 +758,20 @@ class purchase_order(osv.osv):
|
||||
def invoice_send_note(self, cr, uid, ids, invoice_id, context=None):
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id):
|
||||
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), subtype="pending", context=context)
|
||||
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), subtype_xml_id="purchase_subtype_pending", 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="received", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("""Shipment <b>received</b>."""), subtype_xml_id="purchase_subtype_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="paid", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype_xml_id="purchase_subtype_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>."), context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Purchase Order has been set to <b>draft</b>."), subtype_xml_id="purchase_subtype_new", context=context)
|
||||
|
||||
def 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=_("Purchase Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("Purchase Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), subtype_xml_id="purchase_subtype_cancelled", context=context)
|
||||
|
||||
purchase_order()
|
||||
|
||||
|
||||
@@ -49,37 +49,28 @@ You can also manage purchase requisitions, see also the Purchase Settings.</fiel
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.purchase_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_paid" model="mail.message.subtype">
|
||||
<record id="mail.purchase_subtype_paid" model="mail.message.subtype">
|
||||
<field name="name">paid</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="res_model">purchase.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.purchase_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_received" model="mail.message.subtype">
|
||||
<record id="mail.purchase_subtype_received" model="mail.message.subtype">
|
||||
<field name="name">received</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="res_model">purchase.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.purchase_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase.model_purchase_order'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -94,13 +94,13 @@ 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="new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been set to <b>draft</b>."), subtype_xml_id="requisition_subtype_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="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>done</b>."), subtype_xml_id="requisition_subtype_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>."), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>cancelled</b>."), subtype_xml_id="requisition_subtype_cancelled", context=context)
|
||||
|
||||
def _planned_date(self, requisition, delay=0.0):
|
||||
company = requisition.company_id
|
||||
@@ -184,7 +184,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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Purchase Requisition has been <b>created</b>."), subtype_xml_id="requisition_subtype_new", context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
requisition = super(purchase_requisition, self).create(cr, uid, vals, context=context)
|
||||
|
||||
@@ -7,24 +7,17 @@
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.requisition_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
<field name="res_model">purchase.requisition</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
<record id="mail.requisition_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">purchase.requisition</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('purchase_requisition.model_purchase_requisition'))]"/>
|
||||
<record id="mail.requisition_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">purchase.requisition</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
+5
-5
@@ -1032,7 +1032,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="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_xml_id="sale_subtype_new", context=context)
|
||||
|
||||
def confirm_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
@@ -1040,7 +1040,7 @@ class sale_order(osv.osv):
|
||||
|
||||
def 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=_("Sale Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("Sale Order for <em>%s</em> <b>cancelled</b>.") % (obj.partner_id.name), subtype_xml_id="sale_subtype_cancelled", context=context)
|
||||
|
||||
def delivery_send_note(self, cr, uid, ids, picking_id, context=None):
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
@@ -1052,15 +1052,15 @@ 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="delivered", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Order <b>delivered</b>."), subtype_xml_id="sale_subtype_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="paid", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Invoice <b>paid</b>."), subtype_xml_id="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):
|
||||
for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id):
|
||||
self.message_post(cr, uid, [order.id], body=_("Draft Invoice of %s %s <b>waiting for validation</b>.") % (invoice.amount_total, invoice.currency_id.symbol), subtype="pending", context=context)
|
||||
self.message_post(cr, uid, [order.id], body=_("Draft Invoice of %s %s <b>waiting for validation</b>.") % (invoice.amount_total, invoice.currency_id.symbol), subtype_xml_id="sale_subtype_pending", context=context)
|
||||
|
||||
def action_cancel_draft_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_('Sale order set to draft.'), context=context)
|
||||
|
||||
+10
-19
@@ -50,37 +50,28 @@
|
||||
If you need to manage your sales pipeline (leads, opportunities, phonecalls), you can install the module <i>CRM</i> from the top menu Settings.</value>
|
||||
</function>
|
||||
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.sale_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.sale_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_paid" model="mail.message.subtype">
|
||||
<record id="mail.sale_subtype_paid" model="mail.message.subtype">
|
||||
<field name="name">paid</field>
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
<field name="res_model">sale.order</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.sale_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_delivered" model="mail.message.subtype">
|
||||
<record id="mail.sale_subtype_delivered" model="mail.message.subtype">
|
||||
<field name="name">delivered</field>
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('sale.model_sale_order'))]"/>
|
||||
<field name="res_model">sale.order</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+13
-5
@@ -1379,13 +1379,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="new", 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="stock_in_subtype_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), subtype="moved", context=context)
|
||||
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="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Back order <em>%s</em> has been <b>created</b>.") % (back_name), subtype_xml_id="stock_in_subtype_new", context=context)
|
||||
|
||||
def ship_done_send_note(self, cr, uid, ids, context=None):
|
||||
type_dict = {
|
||||
@@ -1393,12 +1393,20 @@ class stock_picking(osv.osv):
|
||||
'in': 'received',
|
||||
'internal': 'moved',
|
||||
}
|
||||
xml_id_dict = {
|
||||
'out':'stock_out_subtype_delivered',
|
||||
'in' : 'stock_in_subtype_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=type_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=xml_id_dict.get(obj.type), context=context)
|
||||
|
||||
def ship_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
xml_id_dict = {
|
||||
'out':'stock_out_subtype_cancelled',
|
||||
'in' : 'stock_in_subtype_cancelled'
|
||||
}
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s has been <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, [obj.id], body=_("%s has been <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype_xml_id=xml_id_dict.get(obj.type), context=context)
|
||||
|
||||
|
||||
stock_picking()
|
||||
|
||||
+13
-16
@@ -170,30 +170,27 @@ watch your stock valuation, and track production lots upstream and downstream (b
|
||||
<!--
|
||||
Mail: mail.message.subtype
|
||||
-->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_in_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">stock.picking.in</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_delivered" model="mail.message.subtype">
|
||||
<record id="mail.stock_out_subtype_delivered" model="mail.message.subtype">
|
||||
<field name="name">delivered</field>
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<field name="res_model">stock.picking.out</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_received" model="mail.message.subtype">
|
||||
<record id="mail.stock_in_subtype_received" model="mail.message.subtype">
|
||||
<field name="name">received</field>
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in'))]"/>
|
||||
<field name="res_model">stock.picking.in</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_in_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">stock.picking.in</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('stock.model_stock_picking_in')),(4,ref('stock.model_stock_picking_out'))]"/>
|
||||
<record id="mail.stock_out_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">stock.picking.out</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user