Skip to content

[IMP] l10n_ar_tax: add monthly cron to clean old padron files#1375

Closed
pablohmontenegro wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-t-65316-pam
Closed

[IMP] l10n_ar_tax: add monthly cron to clean old padron files#1375
pablohmontenegro wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-t-65316-pam

Conversation

@pablohmontenegro
Copy link
Copy Markdown
Contributor

@pablohmontenegro pablohmontenegro commented Apr 21, 2026

  1. Add _cron_clean_old_padron_files method to delete old records.
  2. Create cron in data (noupdate="1") with monthly execution.
  3. Add test_cron_deletes_only_old_padrons test ( odoo-argentina/l10n_ar_tax/tests/test_padron_cleanup_cron.py ) to verify old records are deleted after cron execution.
    Task Adhoc side: 65316

Copilot AI review requested due to automatic review settings April 21, 2026 12:39
@roboadhoc
Copy link
Copy Markdown
Contributor

Pull request status dashboard

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Este PR incorpora un mantenimiento automático en l10n_ar_tax para eliminar registros de padrón antiguos (ARBA / Santa Fe) y así reducir el uso de almacenamiento del módulo.

Changes:

  • Se agrega el método _cron_clean_old_padron_files() en el modelo res.company.jurisdiction.padron para borrar padrones con vigencia anterior a ~1 año.
  • Se crea un ir.cron mensual (en data con noupdate="1") para ejecutar la limpieza automáticamente.
  • Se referencia el nuevo XML de cron en el __manifest__.py.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
l10n_ar_tax/models/res_company_jurisdiction_padron.py Implementa la lógica de limpieza por fecha y hace el unlink() de registros antiguos.
l10n_ar_tax/data/ir_cron_data.xml Define el cron mensual que ejecuta el método de limpieza.
l10n_ar_tax/__manifest__.py Incluye el nuevo archivo de datos del cron en la carga del módulo.

Comment thread l10n_ar_tax/models/res_company_jurisdiction_padron.py
Comment thread l10n_ar_tax/models/res_company_jurisdiction_padron.py
@pablohmontenegro pablohmontenegro force-pushed the 18.0-t-65316-pam branch 2 times, most recently from 0557fa4 to cfee88c Compare April 21, 2026 13:21
Copy link
Copy Markdown
Contributor

@zaoral zaoral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @pablohmontenegro
I leave you some comments to check

Comment thread l10n_ar_tax/models/res_company_jurisdiction_padron.py Outdated
Comment thread l10n_ar_tax/models/res_company_jurisdiction_padron.py Outdated
Comment thread l10n_ar_tax/models/res_company_jurisdiction_padron.py Outdated
Comment thread l10n_ar_tax/i18n/es.po Outdated
@pablohmontenegro pablohmontenegro force-pushed the 18.0-t-65316-pam branch 2 times, most recently from 98b3ca6 to 356487b Compare April 22, 2026 19:32
1) Add _cron_clean_old_padron_files method to delete old records.
2) Create cron in data (noupdate="1") with monthly execution.
3) Add test_cron_deletes_only_old_padrons test ( odoo-argentina/l10n_ar_tax/tests/test_padron_cleanup_cron.py ) to verify old records are deleted after cron execution.
Task Adhoc side: 65316
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@zaoral zaoral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablohmontenegro
Thank you for the PR and the changes!

@roboadhoc bump r+

roboadhoc pushed a commit that referenced this pull request Apr 23, 2026
1) Add _cron_clean_old_padron_files method to delete old records.
2) Create cron in data (noupdate="1") with monthly execution.
3) Add test_cron_deletes_only_old_padrons test ( odoo-argentina/l10n_ar_tax/tests/test_padron_cleanup_cron.py ) to verify old records are deleted after cron execution.
Task Adhoc side: 65316

closes #1375

Signed-off-by: Katherine Zaoral - kz (#l10n) <kz@adhoc.com.ar>
roboadhoc added a commit that referenced this pull request Apr 23, 2026
@roboadhoc roboadhoc closed this Apr 23, 2026
@roboadhoc roboadhoc deleted the 18.0-t-65316-pam branch April 23, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants