I'm trying to add new fields in a new invoice report without modifying the original template, Any ideas about how to implement it?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Please check the below youtube:
I've already followed this tutorial, but it gave me this error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_yds_reports_invoice_report_modified_inherited_170
File "<template>", line 2, in body_call_content_168
AttributeError: 'NoneType' object has no attribute 'with_context'
Error to render compiling AST
AttributeError: 'NoneType' object has no attribute 'with_context'
Template: yds_reports.invoice_report_modified_inherited
Path: /t/t/t[1]
Node: <t t-set="o" t-value="o.with_context(lang=lang)"/>
Please post your code
here is my template:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="invoice_report_modified_inherited" inherit_id="account.report_invoice_document" primary="True">
<xpath expr="//div[@id='total']" position="after">
<span t-field="o.advanced_payment_amount" />
</xpath>
</template>
</odoo>
And here is the report :
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="action_construction_id_card" model="ir.actions.report">
<field name="name">Construction Invoice</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">yds_reports.invoice_report_modified_inherited</field>
<field name="report_file">yds_reports.invoice_report_modified_inherited</field>
<field name="print_report_name">'Construction Invoice- %s' % (object.name)</field>
<field name="binding_model_id" ref="account.model_account_move" />
<field name="binding_type">report</field>
</record>
</data>
</odoo>
I can't see the o.with_context(lang=lang) which showing in the error. I think you have another xml.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up