Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions account_accountant_ux/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
account_move,
account_move_line,
account_partner_ledger,
account_return,
res_partner,
account_report,
account_followup_report,
Expand Down
16 changes: 16 additions & 0 deletions account_accountant_ux/models/account_return.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from odoo import models


class AccountReturn(models.Model):
_inherit = "account.return"

def _check_suite_annual_closing(self, check_codes_to_ignore):
checks = super()._check_suite_annual_closing(check_codes_to_ignore)

# Move "Earnings Allocation" to the bottom of the list of checks
earnings_checks = [c for c in checks if c.get("code") == "earnings_allocation"]
if earnings_checks:
checks = [c for c in checks if c.get("code") != "earnings_allocation"]
checks.extend(earnings_checks)

return checks
45 changes: 45 additions & 0 deletions l10n_ar_account_reports/models/account_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,48 @@ def _update_payment_state(self):
record.state = "submitted"
else:
record.state = "reviewed"

def _check_suite_annual_closing(self, check_codes_to_ignore):
checks = super()._check_suite_annual_closing(check_codes_to_ignore)

if self.company_id.country_id.code != "AR":
return checks

ar_checks = []

if "l10n_ar_cheques_a_fecha" not in check_codes_to_ignore:
action = self.env["ir.actions.actions"]._for_xml_id("l10n_latam_check.action_third_party_check")
ar_checks.append(
{
"name": _("Cheques a fecha"),
"message": _(
"Revisar y procesar los cheques de terceros con fecha de pago diferida "
"pendientes al cierre del período."
),
"code": "l10n_ar_cheques_a_fecha",
"action": action,
"result": "todo",
}
)

if "l10n_ar_inflation_adjustment" not in check_codes_to_ignore:
action = self.env["ir.actions.actions"]._for_xml_id("l10n_ar_account_reports.inflation_adjustment_action")
ar_checks.append(
{
"name": _("Asiento de ajuste por inflación"),
"message": _("Generar el asiento de ajuste por inflación para el período fiscal."),
"code": "l10n_ar_inflation_adjustment",
"action": action,
"result": "todo",
}
)

# Insertar los pasos AR antes de "earnings_allocation"
earnings_idx = next(
(i for i, c in enumerate(checks) if c.get("code") == "earnings_allocation"),
len(checks),
)
for offset, check in enumerate(ar_checks):
checks.insert(earnings_idx + offset, check)

return checks
Loading