Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_out: add check on invoice
Browse files Browse the repository at this point in the history
check for fiscal_document_type_id and parner_id.city
  • Loading branch information
TheMule71 committed Jan 28, 2022
1 parent 34e7183 commit 529885a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions l10n_it_fatturapa_out/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ def preventive_checks(self):
% invoice.name
)

if not invoice.fiscal_document_type_id:
raise UserError(
_(
"Invoice %s fiscal document type must be set",
invoice.name,
)
)

if (
invoice.invoice_payment_term_id
and invoice.invoice_payment_term_id.fatturapa_pt_id.code is False
Expand All @@ -81,6 +89,9 @@ def preventive_checks(self):
)
)

if not invoice.partner_id.city:
raise UserError(_("Invoice %s partner city must be set", invoice.name))

if not all(
aml.tax_ids for aml in invoice.invoice_line_ids if aml.product_id
):
Expand Down

0 comments on commit 529885a

Please sign in to comment.