-
-
Notifications
You must be signed in to change notification settings - Fork 554
[17.0][MIG] l10n_es_atc_mod420: Migration to 17.0 #3871
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
Conversation
No consigo replicar el error en los tests cuando los ejecuto en local, pareciera que el código en l10n-spain/l10n_es_igic/models/template_es_canary.py Lines 34 to 54 in 661ede8
No se está ejecutando y está recogiendo los account.tax vacíos de https://github.com/odoo/odoo/blob/17.0/addons/l10n_es_edi_facturae/data/template/account.tax-es_common.csv dando así el error de ERROR: null value in column "name" violates not-null constraint .
Cualquier ayuda es bienvenida |
Christian, me he copiado la consulta SQL de insert y limpiado para ver qué ocurre, y a partir de cierto punto, se añaden un montón de impuestos "falsos" que no tienen los datos adecuados: Algo está haciendo que se añadan incorrectamente a la hora de crear un plan contable. Para replicarlo en local, tendrías que instalarte poco a poco cada módulo, hasta que te dé el error, y entonces será ese módulo el que lo provoca. ¿Puede que el REAV? |
f722781
to
bee8cae
Compare
Después de mucho rebuscar parece que el test presente en https://github.com/OCA/l10n-spain/blob/17.0/l10n_es_aeat/tests/test_l10n_es_aeat_report.py está bloqueando la actualización del modelo |
bee8cae
to
01f4dd4
Compare
80985cb
to
29981df
Compare
29981df
to
e92c5e5
Compare
Finalmente parece que esto está listo para fusionar. Ya que el error no tenía que ver con la funcionalidad en sí, tenemos clientes utilizando este modelo y el que está en #3870 desde principio de año. Te agradecería un último esfuerzo @pedrobaeza para cerrar este tema. Gracias de antemano |
/ocabot migration l10n_es_atc_mod420 |
e92c5e5
to
509b5a1
Compare
col="3" | ||
> | ||
<group> | ||
<field | ||
name="casilla_23" | ||
widget="monetary" | ||
readonly="state == 'done'" | ||
options="{'currency_field': 'currency_id'}" |
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.
Por qué definir el widget y las options para cada campo en lugar de poner el campo directamente como Monetary
y que haga todo automáticamente?
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.
Buena pregunta, en principio se hizo siguiendo como ejemplo otros modelos
l10n-spain/l10n_es_aeat_mod303/views/mod303_view.xml
Lines 200 to 222 in 7818a06
<field | |
name="regularizacion_anual" | |
widget="monetary" | |
readonly="period_type not in ('4T', '12') or state == 'done'" | |
options="{'currency_field': 'currency_id'}" | |
/> | |
<field | |
name="casilla_77" | |
widget="monetary" | |
options="{'currency_field': 'currency_id'}" | |
/> | |
<field | |
name="casilla_69" | |
widget="monetary" | |
options="{'currency_field': 'currency_id'}" | |
/> | |
<field | |
name="previous_result" | |
widget="monetary" | |
readonly="statement_type != 'C' or state == 'done'" | |
required="statement_type == 'C'" | |
options="{'currency_field': 'currency_id'}" | |
/> |
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.
Pues ninguno fuera del histórico, que antes no existía el campo Monetary
y se hizo así inicialmente. Creo que es un buen momento para "modernizar".
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.
Please add the security rule for multi-company support. Currently, the records are visible across all companies.
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.
@api.depends("tax_line_ids", "tax_line_ids.amount") | ||
def _compute_total_devengado(self): | ||
casillas_devengado = (3, 6, 9, 12, 15, 18, 20, 22, 24) | ||
for report in self: | ||
tax_lines = report.tax_line_ids.filtered( | ||
lambda x: x.field_number in casillas_devengado | ||
) | ||
report.total_devengado = sum(tax_lines.mapped("amount")) |
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.
La casilla 23 y 24
no existen dentro del mapeo de impuestos, por lo que esto no se esta calculando bien este valor. Se deberían tomar de los campos que existen en el modelo.
Adicional, este valor se resta en lugar de sumar
@api.depends("tax_line_ids", "tax_line_ids.amount") | |
def _compute_total_devengado(self): | |
casillas_devengado = (3, 6, 9, 12, 15, 18, 20, 22, 24) | |
for report in self: | |
tax_lines = report.tax_line_ids.filtered( | |
lambda x: x.field_number in casillas_devengado | |
) | |
report.total_devengado = sum(tax_lines.mapped("amount")) | |
@api.depends("tax_line_ids", "tax_line_ids.amount", "casilla_23", "casilla_24") | |
def _compute_total_devengado(self): | |
casillas_devengado = (3, 6, 9, 12, 15, 18, 20, 22) | |
for report in self: | |
tax_lines = report.tax_line_ids.filtered( | |
lambda x: x.field_number in casillas_devengado | |
) | |
report.total_devengado = sum(tax_lines.mapped("amount")) | |
if not float_is_zero(report.casilla_23, precision_digits=2): | |
report.total_devengado -= report.casilla_24 |
No description provided.