[Add]hr_holidays:improved code of subtype

bzr revid: kbh@tinyerp.com-20121120071911-z6saaldgglcr1bz2
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-11-20 12:49:11 +05:30
parent 4f14cb1dae
commit a56728dbc7
2 changed files with 9 additions and 3 deletions

View File

@ -431,7 +431,7 @@ class hr_holidays(osv.osv):
def holidays_confirm_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids):
self.message_post(cr, uid, [obj.id],
_("Request <b>submitted</b>, waiting for validation by the manager."), context=context)
_("Request <b>submitted</b>, waiting for validation by the manager."), subtype="hr_holidays.mt_approve", context=context)
def holidays_first_validate_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
@ -445,12 +445,12 @@ class hr_holidays(osv.osv):
_("Request <b>validated</b>."), context=context)
else:
self.message_post(cr, uid, [obj.id],
_("The request has been <b>approved</b>."), context=context)
_("The request has been <b>approved</b>."), subtype="hr_holidays.mt_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],
_("Request <b>refused</b>"), context=context)
_("Request <b>refused</b>"), subtype="hr_holidays.mt_refused", context=context)
class resource_calendar_leaves(osv.osv):

View File

@ -48,14 +48,20 @@
<!--subtype for leaves -->
<record id="mt_approve" model="mail.message.subtype">
<field name="name">To Approve</field>
<field name="res_model">hr.holidays</field>
<field name="default" eval="False"/>
</record>
<record id="mt_approved" model="mail.message.subtype">
<field name="name">Approved</field>
<field name="res_model">hr.holidays</field>
<field name="default" eval="False"/>
</record>
<record id="mt_refused" model="mail.message.subtype">
<field name="name">Refused</field>
<field name="res_model">hr.holidays</field>
<field name="default" eval="False"/>
</record>
</data>