Skip to content

Commit

Permalink
fixup! fixup! fixup! [MIG] l10n_ch_import_cresus: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
em230418 committed Jan 20, 2025
1 parent 8a4097d commit 705f48c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions l10n_ch_import_cresus/wizard/l10n_ch_import_cresus.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def prepare_line(
cresus_tax_code,
analytic_account_code,
tax_ids,
currency_id,
):
account_obj = self.env["account.account"]
tax_obj = self.env["account.tax"]
Expand All @@ -71,13 +70,13 @@ def prepare_line(
line["name"] = name
line["debit"] = debit_amount
line["credit"] = credit_amount
if currency_id:
line["currency_id"] = currency_id

account = account_obj.search([("code", "=", account_code)], limit=1)
if not account:
raise exceptions.MissingError(_("No account with code %s") % account_code)
line["account_id"] = account.id
if account.currency_id:
line["currency_id"] = account.currency_id.id

if cresus_tax_code:
tax = tax_obj.search(
Expand Down Expand Up @@ -202,7 +201,6 @@ def _standardise_data(self, data):
cresus_tax_code=line_cresus["typtvat"],
analytic_account_code=line_cresus["analytic_account"],
tax_ids=tax_ids,
currency_id=self.journal_id.currency_id.id,
)
lines.append(line)
if "tax_line_id" in line:
Expand All @@ -217,7 +215,6 @@ def _standardise_data(self, data):
cresus_tax_code=line_cresus["typtvat"],
analytic_account_code=line_cresus["analytic_account"],
tax_ids=tax_ids,
currency_id=self.journal_id.currency_id.id,
)
lines.append(line)
if "tax_line_id" in line:
Expand Down

0 comments on commit 705f48c

Please sign in to comment.