-
Notifications
You must be signed in to change notification settings - Fork 72
[IMP]l10n_ar_account_reports: Mejoras del reporte Balance General #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from openupgradelib import openupgrade | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def migrate(cr, version): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Migrate accounts from old 'ar_esp_patrimonio_neto' tag to new specific tags. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The old tag 'ar_esp_patrimonio_neto' is being removed and split into three | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| more specific tags: 'ar_esp_capital', 'ar_esp_reservas', and 'ar_esp_resultados'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This migration removes the old tag assignment from all accounts that have it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The new tags will be assigned automatically by the post-migration hook based | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on the account type. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Remove all account assignments for the old patrimonio_neto tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openupgrade.logged_query( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cr, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DELETE FROM account_account_account_tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WHERE account_account_tag_id IN ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SELECT res_id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FROM ir_model_data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WHERE module = 'l10n_ar_account_reports' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AND model = 'account.account.tag' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AND name = 'ar_esp_patrimonio_neto' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Delete the old patrimonio_neto tag record itself | |
| openupgrade.logged_query( | |
| cr, | |
| """ | |
| DELETE FROM account_account_tag | |
| WHERE id IN ( | |
| SELECT res_id | |
| FROM ir_model_data | |
| WHERE module = 'l10n_ar_account_reports' | |
| AND model = 'account.account.tag' | |
| AND name = 'ar_esp_patrimonio_neto' | |
| ) | |
| """, | |
| ) | |
| # Delete the ir_model_data entry for the old patrimonio_neto tag | |
| openupgrade.logged_query( | |
| cr, | |
| """ | |
| DELETE FROM ir_model_data | |
| WHERE module = 'l10n_ar_account_reports' | |
| AND model = 'account.account.tag' | |
| AND name = 'ar_esp_patrimonio_neto' | |
| """, | |
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <odoo noupdate="True"> | ||
| <record id="l10n_ar_account_reports.account_financial_report_l10n_ar_estado_resultados" model="account.report"> | ||
| <field name="allow_settlement" eval="True"/> | ||
| <field name="settlement_title">Asiento de refundición</field> | ||
| <field name="settlement_allow_unbalanced" eval="True"/> | ||
| </record> | ||
| <record id="l10n_ar_account_reports.account_financial_report_l10n_ar_estado_patrimonial" model="account.report"> | ||
| <field name="allow_settlement" eval="True"/> | ||
| <field name="settlement_title">Generar asiento de cierre</field> | ||
| </record> | ||
| </odoo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El docstring indica que los nuevos tags se asignan “based on the account type”, pero el split Capital/Reservas/Resultados depende del prefijo del código (3.1/3.2/3.3) además del tipo. Conviene ajustar la descripción para que refleje el criterio real (por código de cuenta), así evita confusión al mantener la migración.