Skip to content

Commit

Permalink
[OU-IMP] l10n_be: debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
remytms committed Apr 11, 2024
1 parent 53c9969 commit 2b08607
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion addons/l10n_be/migrations/13.0.2.0/post-02-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def update_tags_on_move_line(env):
# then it's a base line, so apply base repartition line from
# taxes.
elif tax_ids and not tax_base_amount:
repartition_line_ids = env["account.tax.repartition.line"]
_logger.info(
"Processing %s", move_line_id
)
if "invoice" in move_id.type:
repartition_line_ids = tax_ids.mapped(
"invoice_repartition_line_ids"
Expand All @@ -109,13 +111,29 @@ def update_tags_on_move_line(env):
repartition_line_ids = tax_ids.mapped(
"refund_repartition_line_ids"
)
else:
repartition_line_ids = env["account.tax.repartition.line"]
_logger.info(
"Found repartition line: %s",
repartition_line_ids
)
base_repartition_ids = repartition_line_ids.filtered(
lambda r: r.repartition_type == "base"
)
_logger.info(
"Found base repartition line: %s",
repartition_line_ids
)
new_tag_ids = base_repartition_ids.mapped("tag_ids")
_logger.info(
"Applying new tags %s on %s",
new_tag_ids,
move_line_id,
)

else:
new_tag_ids = env["account.account.tag"]
_logger.info("No tag to apply on %s", move_line_id)

# Write new tags
openupgrade.logged_query(
Expand Down

0 comments on commit 2b08607

Please sign in to comment.