[REM] hr_payroll, hr_payroll_account: removed unused onchange method
This commit is contained in:
@@ -579,21 +579,6 @@ class HrPayslip(models.Model):
|
||||
})
|
||||
return res
|
||||
|
||||
# YTO TODO: employee_id and contract_id could be browse records
|
||||
@api.multi
|
||||
def onchange_contract_id(self, date_from, date_to, employee_id=False, contract_id=False):
|
||||
# TODO it seems to be the mess in the onchanges
|
||||
# we should have onchange_employee => onchange_contract => doing all the things
|
||||
res = {
|
||||
'value': {
|
||||
'line_ids': [],
|
||||
'name': '',
|
||||
}
|
||||
}
|
||||
if not contract_id:
|
||||
res['value'].update({'struct_id': False})
|
||||
return self.with_context(contract=True).onchange_employee_id(date_from=date_from, date_to=date_to, employee_id=employee_id, contract_id=contract_id)
|
||||
|
||||
@api.onchange('employee_id', 'date_from')
|
||||
def onchange_employee(self):
|
||||
|
||||
|
||||
@@ -64,13 +64,6 @@ class hr_payslip(osv.osv):
|
||||
vals.update({'journal_id': context.get('journal_id')})
|
||||
return super(hr_payslip, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def onchange_contract_id(self, cr, uid, ids, date_from, date_to, employee_id=False, contract_id=False, context=None):
|
||||
contract_obj = self.pool.get('hr.contract')
|
||||
res = super(hr_payslip, self).onchange_contract_id(cr, uid, ids, date_from=date_from, date_to=date_to, employee_id=employee_id, contract_id=contract_id, context=context)
|
||||
journal_id = contract_id and contract_obj.browse(cr, uid, contract_id, context=context).journal_id.id or (not contract_id and self._get_default_journal(cr, uid, context=None))
|
||||
res['value'].update({'journal_id': journal_id})
|
||||
return res
|
||||
|
||||
@api.onchange('contract_id')
|
||||
def onchange_contract(self):
|
||||
super(hr_payslip, self).onchange_contract()
|
||||
|
||||
@@ -76,7 +76,6 @@
|
||||
}
|
||||
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']]
|
||||
res_contract = self.onchange_contract_id(cr, uid, [ref('hr_payslip_0')], date_from, date_to, ref('hr_employee_john'), ref('hr_contract_john'), None)
|
||||
vals.update({'contract_id': ref('hr_contract_john')})
|
||||
self.write(cr, uid, ref("hr_payslip_0"), vals)
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user