From 1ee2b26fe319a9328faa626e8fdaee2ae3937bcb Mon Sep 17 00:00:00 2001 From: Stepan Savelyev Date: Fri, 27 Dec 2019 18:07:20 +0500 Subject: [PATCH] [ADD] domain to templates --- wizard/res_partner_contract_wizard.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wizard/res_partner_contract_wizard.py b/wizard/res_partner_contract_wizard.py index 1850249..3ecfc9a 100644 --- a/wizard/res_partner_contract_wizard.py +++ b/wizard/res_partner_contract_wizard.py @@ -104,6 +104,15 @@ class ContractWizard(models.TransientModel): for field, value in sorted(contract_context_values.items()) ] + # Set up template domain + company_type = self.partner_id.company_form if self.partner_id.is_company else 'person' + return { + 'domain': { + 'print_template_contract': [('company_type', '=', company_type)], + 'print_template_annex': [('company_type', '=', company_type)] + } + } + @api.multi def get_docx_contract(self): template = self._get_template()