Skip to content

Commit

Permalink
[FIX] account_invoice_ubl: Fix CreditNote
Browse files Browse the repository at this point in the history
Do not provide payment means & terms on a credit note
  • Loading branch information
jbaudoux committed Dec 27, 2023
1 parent c8255c5 commit fcbfb09
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions account_invoice_ubl/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,21 +439,22 @@ def generate_invoice_ubl_xml_etree(self, version="2.1"):
# the field 'partner_shipping_id' is defined in the 'sale' module
if hasattr(self, "partner_shipping_id") and self.partner_shipping_id:
self._ubl_add_delivery(self.partner_shipping_id, xml_root, ns)
# Put paymentmeans block even when invoice is paid ?
payment_identifier = self.get_payment_identifier()
self._ubl_add_payment_means(
self.partner_bank_id,
self.payment_mode_id,
self.invoice_date_due,
xml_root,
ns,
payment_identifier=payment_identifier,
version=version,
)
if self.invoice_payment_term_id:
self._ubl_add_payment_terms(
self.invoice_payment_term_id, xml_root, ns, version=version
if self.move_type == "out_invoice":
# Put paymentmeans block even when invoice is paid ?
payment_identifier = self.get_payment_identifier()
self._ubl_add_payment_means(
self.partner_bank_id,
self.payment_mode_id,
self.invoice_date_due,
xml_root,
ns,
payment_identifier=payment_identifier,
version=version,
)
if self.invoice_payment_term_id:
self._ubl_add_payment_terms(
self.invoice_payment_term_id, xml_root, ns, version=version
)
self._ubl_add_tax_total(xml_root, ns, version=version)
self._ubl_add_legal_monetary_total(xml_root, ns, version=version)

Expand Down

0 comments on commit fcbfb09

Please sign in to comment.