[12.0][FIX] - Run onchange contract_type when changing the contract template

Fix this use-case:

If the contract journal is not set on the contract template the contract is created
without a journal when confirming the sale order
This commit is contained in:
sbejaoui
2019-11-26 09:54:55 +01:00
committed by Francisco Ivan Anton Prieto
parent 3fcae72d8a
commit b30a41b2da

View File

@@ -209,7 +209,8 @@ class ContractContract(models.Model):
field.name in self.NO_SYNC, field.name in self.NO_SYNC,
) )
): ):
self[field_name] = self.contract_template_id[field_name] if self.contract_template_id[field_name]:
self[field_name] = self.contract_template_id[field_name]
@api.onchange('partner_id') @api.onchange('partner_id')
def _onchange_partner_id(self): def _onchange_partner_id(self):