bzr revid: fp@tinyerp.com-20111114224213-asq9x16vsnhv33ap
This commit is contained in:
Fabien Pinckaers 2011-11-14 23:42:13 +01:00
parent a60ca41282
commit db8da808ff
2 changed files with 2 additions and 22 deletions

View File

@ -646,7 +646,7 @@ class hr_payslip(osv.osv):
'struct_id': False,
}
}
if not employee_id:
if (not employee_id) or (not date_from) or (not date_to):
return res
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(date_from, "%Y-%m-%d")))
employee_id = empolyee_obj.browse(cr, uid, employee_id, context=context)

View File

@ -40,25 +40,6 @@
-
!record {model: hr.payslip, id: hr_payslip_0}:
employee_id: hr_payroll.hr_employee_richard0
-
The selection of an employee fills the contract, structure, worked days and input data fields
-
!python {model: hr.payslip}: |
import time
from datetime import datetime
from dateutil import relativedelta
date_from = time.strftime('%Y-%m-01')
worked_days_obj = self.pool.get('hr.payslip.worked_days')
date_to = str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10]
res = self.onchange_employee_id(cr, uid, [], date_from, date_to, ref("hr_employee_richard0"), False, None)
vals = {
'struct_id': res['value']['struct_id'],
'contract_id': res['value']['contract_id'],
'name': res['value']['name'],
}
vals['worked_days_line_ids'] = [(0,0,i) for i in res['value']['worked_days_line_ids']]
vals['input_line_ids'] = [(0, 0, i) for i in res['value']['input_line_ids']]
self.write(cr, uid, ref("hr_payslip_0"), vals)
-
I assign the amount to Input data
-
@ -69,9 +50,8 @@
I verify the payslip is in draft state
-
!python {model: hr.payslip}: |
from tools.translate import _
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
assert(payslip_brw.state == 'draft'), _('State not changed!')
assert (payslip_brw.state == 'draft'), 'State not changed!'
-
I click on 'Compute Sheet' button on payslip
-