Skip to content
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

Campo amount_by_group al imprimir facturas con el módulo l10n_ve_invoice_reports instalado #17

Open
fhidalgodev opened this issue Sep 6, 2022 · 6 comments

Comments

@fhidalgodev
Copy link

En odoo 15 el campo amount_by_group ya no existe. Para su homologación está el campo tax_totals_json

En el módulo l10n_ve_invoice_reports carpeta templates archivo report_invoice_ve.xml se recorre el campo inexistente amount_by_group en la línea 47, por ende, al imprimir la factura da error

@ronromero111
Copy link

#19 Se corrige el Issues homologando el campo tax_totals_json y formateando la salidas negativas.

@erik21111111
Copy link

erik21111111 commented May 4, 2023

Buenas tardes, disculpa será que me puedes guiar en el proceso para corregir este error. Actualmente se me presenta el error y no estoy familiarizado con el proceso... Si me puede ayudar dándome instrucciones de como hacerlo te lo agradecería, gracias. Estoy en Odoo 16

@ronromero111
Copy link

Saludos Erick, Odoo a tiene un campo tipo JSON donde almacenas este tipo de estructuras. Lo que debes hacer es aprender a recorrerlas en los qweb con t-foreach, te coloco el ejemplo

Usas la función json.load(o.)
<t t-set="tax_totals" t-value="json.loads(o.tax_totals_json)"/>

Usas el foreach para recorrer la estructura
<t t-foreach="tax_totals['subtotals']" t-as="subtotal">
<t t-set="subtotal_to_show" t-value="subtotal['name']"/>

Cualquier otra duda avisas.

Saludos

@erik21111111
Copy link

Muchas gracias por responder... A la hora de intentar imprimir un informe de IVA de compras me lanza este error, pero no le encuentro solución

Traceback (most recent call last):
  File "/home/odoo/src/user/reporting-engine-16.0/report_xlsx/controllers/main.py", line 63, in report_download
    response = self.report_routes(
  File "/home/odoo/src/odoo/odoo/http.py", line 696, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/odoo/src/user/reporting-engine-16.0/report_xlsx/controllers/main.py", line 37, in report_routes
    xlsx = report.with_context(**context)._render_xlsx(
  File "/home/odoo/src/user/reporting-engine-16.0/report_xlsx/models/ir_report.py", line 22, in _render_xlsx
    .create_xlsx_report(docids, data)  # noqa
  File "/home/odoo/src/user/reporting-engine-16.0/report_xlsx/report/report_abstract_xlsx.py", line 105, in create_xlsx_report
    self.generate_xlsx_report(workbook, data, objs)
  File "/home/odoo/src/user/odoo-venezuela-16.0/l10n_ve_vat_ledger/report/account_vat_ledger_xlsx.py", line 449, in generate_xlsx_report
    if invoice.tax_totals_json:
AttributeError: 'account.move' object has no attribute 'tax_totals_json'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    at makeErrorFromResponse (https://kdiacloud-sandbox01-8154253.dev.odoo.com/web/assets/1040-1327b53/web.assets_backend.min.js:977:163)
    at decoder.onload (https://kdiacloud-sandbox01-8154253.dev.odoo.com/web/assets/1040-1327b53/web.assets_backend.min.js:965:7)

@ronromero111
Copy link

OJO este campo es implementado a partir de la versión 15.... AttributeError: 'account.move' object has no attribute 'tax_totals_json'

@erik21111111
Copy link

Entiendo, pero entonces porque no me puede imprimir los reportes en los IVA de compra... Explota cuando se le asignan al reporte facturas... Disculpa las molestias.

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

No branches or pull requests

3 participants