summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-12-18 15:03:33 +0000
committerYannick Tivisse <yti@odoo.com>2018-12-18 15:04:22 +0000
commitfd23d93be2fadc2ac4495b4db746f13cb65b4d94 (patch)
treedcafc4e7e906771e16a35e10db6a28147a95c8ba
parent939f8e05347e2a07bf2639b652c7deaa6c00c837 (diff)
[IMP] hr_payroll_account: Don't erase journal_id if already set
If the journal_id is already set on the payslip and if there are no journal_id on the contract, don't erase the value on the onchange method closes odoo/odoo#29616
-rw-r--r--addons/hr_payroll_account/models/hr_payroll_account.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/hr_payroll_account/models/hr_payroll_account.py b/addons/hr_payroll_account/models/hr_payroll_account.py
index 1e21ae1a83a..25188a4dc40 100644
--- a/addons/hr_payroll_account/models/hr_payroll_account.py
+++ b/addons/hr_payroll_account/models/hr_payroll_account.py
@@ -42,7 +42,7 @@ class HrPayslip(models.Model):
@api.onchange('contract_id')
def onchange_contract(self):
super(HrPayslip, self).onchange_contract()
- self.journal_id = self.contract_id.journal_id.id or (not self.contract_id and self.default_get(['journal_id'])['journal_id'])
+ self.journal_id = self.contract_id.journal_id.id or self.default_get(['journal_id'])['journal_id']
@api.multi
def action_payslip_cancel(self):