[IMP]hr_timesheet_invoice:fixed the issue of traceback while closing or canceling the contract
bzr revid: ssu@tinyerp.com-20121016132012-l8cmrr873syfvr1q
This commit is contained in:
parent
164df45813
commit
809c4f1ed8
|
@ -95,13 +95,13 @@ class account_analytic_account(osv.osv):
|
|||
def set_close(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'close'}, context=context)
|
||||
message = _("Contract has been <b>closed</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="mt_account_closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="hr_timesheet_invoice.mt_account_closed", context=context)
|
||||
return True
|
||||
|
||||
def set_cancel(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state': 'cancelled'}, context=context)
|
||||
message = _("Contract has been <b>canceled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="mt_account_canceled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="hr_timesheet_invoice.mt_account_canceled", context=context)
|
||||
return True
|
||||
|
||||
def set_open(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -16,5 +16,16 @@
|
|||
<field name="customer_name">50%</field>
|
||||
<field name="factor">50.0</field>
|
||||
</record>
|
||||
|
||||
<!-- mail: subtypes -->
|
||||
<record id="mt_account_closed" model="mail.message.subtype">
|
||||
<field name="name">finished</field>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
<record id="mt_account_canceled" model="mail.message.subtype">
|
||||
<field name="name">canceled</field>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue