[FIX] hr_holidays: Second validation
lp bug: https://launchpad.net/bugs/732419 fixed bzr revid: ara@tinyerp.com-20110322100447-ey5tkdusd3l76at5
This commit is contained in:
parent
8c5349a683
commit
b71aa291ba
|
@ -214,6 +214,7 @@ class hr_holidays(osv.osv):
|
|||
self.write(cr, uid, ids, {
|
||||
'state': 'draft',
|
||||
'manager_id': False,
|
||||
'manager_id2': False,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
|
@ -232,9 +233,11 @@ class hr_holidays(osv.osv):
|
|||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state':'validate', 'manager_id2': manager})
|
||||
self.write(cr, uid, ids, {'state':'validate'})
|
||||
data_holiday = self.browse(cr, uid, ids)
|
||||
for record in data_holiday:
|
||||
if record.holiday_status_id.double_validation:
|
||||
self.write(cr, uid, ids, {'manager_id2': manager})
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
meeting_obj = self.pool.get('crm.meeting')
|
||||
vals = {
|
||||
|
@ -281,7 +284,7 @@ class hr_holidays(osv.osv):
|
|||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state': 'refuse', 'manager_id2': manager})
|
||||
self.write(cr, uid, ids, {'state': 'refuse', 'manager_id': manager})
|
||||
self.holidays_cancel(cr, uid, ids)
|
||||
return True
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
<record model="workflow.transition" id="t8">
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_validate1" />
|
||||
<field name="group_id" ref="base.group_hr_user"/>
|
||||
<field name="signal">second_validate</field>
|
||||
<field name="group_id" ref="base.group_hr_user"/>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue