[IMP]Add data of the subtype in accouting modules
bzr revid: rma@tinyerp.com-20120830124947-xxkah5za90oa5tuy
This commit is contained in:
@@ -1297,15 +1297,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_append_note(cr, uid, [obj.id],body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)), context=context)
|
||||
self.message_append_note(cr, uid, [obj.id],body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)), 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_append_note(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (self._get_document_type(obj.type)), context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (self._get_document_type(obj.type)), 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_append_note(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)), context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)), subtype="cancel", context=context)
|
||||
|
||||
account_invoice()
|
||||
|
||||
|
||||
@@ -563,8 +563,28 @@
|
||||
<field name="name">Invoice</field>
|
||||
<field name="object">account.invoice</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record id="mail.mail_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="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_paid" model="mail.message.subtype">
|
||||
<field name="name">paid</field>
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancel" model="mail.message.subtype">
|
||||
<field name="name">cancel</field>
|
||||
<field name="model_ids" eval="[(4,ref('account.model_account_invoice'))]"/>
|
||||
<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>
|
||||
|
||||
@@ -1293,17 +1293,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_append_note(cr, uid, [obj.id], body=message, context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=message, 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_append_note(cr, uid, [obj.id], body=message, context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=message, 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_append_note(cr, uid, [obj.id], body=message, context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=message, subtype="reconcile", context=context)
|
||||
|
||||
account_voucher()
|
||||
|
||||
|
||||
@@ -12,5 +12,28 @@ You can track customer payments easily and automate the reminders. You get an ov
|
||||
|
||||
If you want to use advanced accounting features, you should install the "Accounting and Finance" module.</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>
|
||||
<record id="mail.mail_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="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_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="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>
|
||||
|
||||
@@ -297,7 +297,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_append_note(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), context=context)
|
||||
self.message_append_note(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name), subtype="new", context=context)
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user