[IMP]improve code
bzr revid: sgo@tinyerp.com-20121128051414-el91llx1d1i4i565
This commit is contained in:
parent
069d2878d3
commit
c5fe07802e
|
@ -128,7 +128,7 @@ class hr_expense_expense(osv.osv):
|
|||
if expense.employee_id and expense.employee_id.parent_id.user_id:
|
||||
self.message_subscribe_users(cr, uid, [expense.id], user_ids=[expense.employee_id.parent_id.user_id.id])
|
||||
self.message_post(cr, uid, ids, body=_("The request is <b>waiting for Approval</b>"),
|
||||
subtype="hr_expense.mt_expense_approve", context=context)
|
||||
subtype="hr_expense.mt_expense_approve")
|
||||
self.write(cr, uid, ids, {
|
||||
'state':'confirm',
|
||||
'date_confirm': time.strftime('%Y-%m-%d')
|
||||
|
@ -137,7 +137,7 @@ class hr_expense_expense(osv.osv):
|
|||
|
||||
def expense_accept(self, cr, uid, ids, *args):
|
||||
self.message_post(cr, uid, ids, body=_("The request has been <b>approved</b>"),
|
||||
subtype="hr_expense.mt_expense_approved", context=context)
|
||||
subtype="hr_expense.mt_expense_approved")
|
||||
self.write(cr, uid, ids, {
|
||||
'state':'accepted',
|
||||
'date_valid':time.strftime('%Y-%m-%d'),
|
||||
|
@ -147,7 +147,7 @@ class hr_expense_expense(osv.osv):
|
|||
|
||||
def expense_canceled(self, cr, uid, ids, *args):
|
||||
self.message_post(cr, uid, ids, body=_("Request <b>refused</b>"),
|
||||
subtype="hr_expense.mt_expense_refused", context=context)
|
||||
subtype="hr_expense.mt_expense_refused")
|
||||
self.write(cr, uid, ids, {'state':'cancelled'})
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue