Skip to content

Commit

Permalink
[MIG] l10n_pt_account_invoicexpress: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dreispt committed Sep 19, 2024
1 parent e507d65 commit 363fc06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion l10n_pt_account_invoicexpress/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Portugal InvoiceXpress Integration",
"summary": "Portuguese certified invoices using InvoiceXpress",
"version": "16.0.1.2.3",
"version": "17.0.1.0.0",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/l10n-portugal",
Expand Down
10 changes: 6 additions & 4 deletions l10n_pt_account_invoicexpress/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _get_invoicexpress_prefix(self, doctype):
def _prepare_invoicexpress_lines(self):
# FIXME: set user lang, based on country?
lines = self.invoice_line_ids.filtered(
lambda l: l.display_type not in ("line_section", "line_note")
lambda x: x.display_type not in ("line_section", "line_note")
)
# Ensure Taxes are created on InvoiceXpress
lines.mapped("tax_ids").action_invoicexpress_tax_create()
Expand All @@ -119,8 +119,10 @@ def _prepare_invoicexpress_lines(self):
tax = line.tax_ids[:1]
# If not tax set, force zero VAT
tax_detail = {"name": tax.name or "IVA0", "value": tax.amount or 0.0}
# Because InvoiceXpress expects unit_price in EUR, check if we need to convert
# line currency to company currency (company should use EUR as default currency)
# Because InvoiceXpress expects unit_price in EUR,
# check if we need to convert
# line currency to company currency
# (company should use EUR as default currency)
if line.currency_id == line.company_id.currency_id:
price_unit = line.price_unit
else:
Expand Down Expand Up @@ -238,7 +240,7 @@ def action_create_invoicexpress_invoice(self):
)
)
prefix = self._get_invoicexpress_prefix(doctype)
invx_number = "%s %s" % (prefix, seqnum) if prefix else seqnum
invx_number = f"{'prefix'}, {'seqnum'}" if prefix else seqnum
if invoice.payment_reference == invoice.name:
invoice.payment_reference = invx_number
invoice.name = invx_number
Expand Down

0 comments on commit 363fc06

Please sign in to comment.