diff --git a/l10n_pt_account_invoicexpress/models/account_move.py b/l10n_pt_account_invoicexpress/models/account_move.py index df4ba1bd..e8124986 100644 --- a/l10n_pt_account_invoicexpress/models/account_move.py +++ b/l10n_pt_account_invoicexpress/models/account_move.py @@ -76,6 +76,13 @@ def _compute_invoicexpress_doc_type(self): " If unset, InvoiceXpress will not be used.", ) + def _compute_is_l10npt_vat_enabled(self): + super()._compute_is_l10npt_vat_enabled() + # Disable VAT PT options is InvoiceXpress is disabled + for invoice in self.filtered("invoice.is_l10npt_vat_enabled"): + if not invoice.can_invoicexpress: + invoice.is_l10npt_vat_enabled = False + @api.constrains("journal_id", "company_id") def _check_invoicexpress_doctype_config(self): """