Skip to content

Commit

Permalink
Merge PR #3729 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 20, 2024
2 parents e073168 + e467b7a commit 4f43a20
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions l10n_es_aeat_mod349/models/mod349.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,12 @@ def _create_349_refund_records(self):
if original_details:
# There's at least one previous 349 declaration report
report = original_details.mapped("report_id")[:1]
partner_id = original_details.mapped("partner_id")[:1]
original_details = original_details.filtered(
lambda d: d.report_id == report
)
origin_amount = sum(original_details.mapped("amount_untaxed"))
period_type = report.period_type
year = str(report.year)

# Sum all details period origin
all_details_period = detail_obj.search(
[
("partner_id", "=", partner_id.id),
("partner_record_id.operation_key", "=", op_key),
("report_id", "=", report.id),
],
order="report_id desc",
)
origin_amount = sum(all_details_period.mapped("amount_untaxed"))

# If there are intermediate periods between the original
# period and the period where the rectification is taking
# place, it's necessary to check if there is any rectification
Expand All @@ -261,7 +248,6 @@ def _create_349_refund_records(self):
)
if last_refund_detail:
origin_amount = last_refund_detail.refund_id.total_operation_amount

else:
# There's no previous 349 declaration report in Odoo
original_amls = move_line_obj.search(
Expand Down

0 comments on commit 4f43a20

Please sign in to comment.