Hi I am trying to create a new report, very similar to the order report, in fact only change 1 word.
To do that I have been created a new module with a new report --> "report_albaran.xml"
<odoo>
<data>
<report id="report_albaran"
string="Imprimir albarán"
model="sale.order"
report_type="qweb-pdf"
name="print_albaran_from_confirmed_order.report_albaran_template"
print_report_name="'A- %s' % (object.name)"
/>
<template id="report_albaran_template" inherit_id="sale.report_saleorder_document">
<xpath expr="//h2[@class='mt16']//span" position="replace">
<span t-field="doc.name"/>
</xpath>
</template>
</data>
</odoo>
The objective is to create a new button in the quotations/orders view and throw xpath method parse the "sale.report_saleorder_document" report to change the variable <span t-field="doc.name"/> for the string "Albarán".
The code presented does not change anything it is only to show that the error occurs anyway.
Can you help me with it?
Regards,
Amadeo
ERROR:
after few lines...
AttributeError: 'NoneType' object has no attribute 'with_context' Error to render compiling AST AttributeError: 'NoneType' object has no attribute 'with_context' Template: sale.report_saleorder_document Path: /t/t/t[1] Node: <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
It seems that the error is when is trying to look in the parent model.. I don't know why.