Skip to Content
Menú
This question has been flagged
1 Respondre
1151 Vistes

Hello guys i created a custom module in odoo 18 that can modify some standard reports like invoices  , sales , purchase order , etc 
so in the custom module i dont declare a new report i just inherit the templates of the reports and do what i need to modify the reports now i want to change the print_report_name using the custom module and i did't figure something out yet i tried overwriting the report action and nothing worked i used some python but i just made a lot of erros so if some one can help me with this i'll appreciate it 😊

Avatar
Descartar
Best Answer

Hi,

Here is an example of Purchase Report in Odoo 18:-


<record id="purchase.report_purchase_quotation" model="ir.actions.report">


        <field name="name">Purchase Report</field>


        <field name="print_report_name">'Purchase Report - %s' % (object.name)</field>


</record>


Please provide the external ID of the report that needs to change as the id in the record. And you can provide the new name for the report in print_report_name.


Hope it helps

Avatar
Descartar
Autor

hello , thanks for responding , in the xml file i had inherited the template of the purchase order report here is the code
<template id="bon_commande_report_id" inherit_id="purchase.report_purchaseorder_document" >
<xpath expr="//t[@t-call='web.external_layout']" position="replace">
<t t-call="web.external_layout">

when i tried the code u gave me i got this
odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/document_report/views/views.xml:175

For external id purchase.report_purchaseorder_document when trying to create/update a record of model ir.actions.report found record of different model ir.ui.view (33779)

Related Posts Respostes Vistes Activitat
0
de jul. 25
280
0
de jul. 25
909
1
de maig 25
1347
1
d’abr. 25
1313
1
de juny 25
931