[ADD] domain to templates

This commit is contained in:
Stepan Savelyev 2019-12-27 18:07:20 +05:00
parent 77ca108bef
commit 1ee2b26fe3

View File

@ -104,6 +104,15 @@ class ContractWizard(models.TransientModel):
for field, value in sorted(contract_context_values.items()) 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 @api.multi
def get_docx_contract(self): def get_docx_contract(self):
template = self._get_template() template = self._get_template()