Skip to Content
Menu
This question has been flagged
1 Atsakyti
2339 Rodiniai

I want to create a pdf report but this xml file cause me error 

raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/aadil/src/odoo/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/aadil/src/odoo/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo\\.tools\\.convert\\.ParseError:\\ while\\ parsing\\ /home/aadil/src/custom/test_school/report/student_report\\.xml:3,\\ somewhere\\ inside
"\ rel="ugc">ir\.actions\.report">
\ Student\ Record\
test\.student
qweb\.pdf
student_record\.personal
student_record\.personal
student_record\.personal

report


Error\ ScreenShot\ Link\ \(if\ not\ properly\ pasted\) https://imgur.com/a/1yKqE7k

Kindly help me what is wrong.. I am following YT video.. If someone can refer me some tutorial as I am beginner to odoo

Portretas
Atmesti
Best Answer

Hi,

It looks like the issue might be with how the report action is defined in your XML. Here's a basic example of how a report action should look:

xml

<record id="action_for_report" model="ir.actions.report"> <field name="name">Name Of The Report</field> <field name="model">sale.order</field> <field name="report_type">qweb-pdf</field> <field name="report_file">custom_module_name.template_id</field> <field name="report_name">custom_module_name.template_id</field> <field name="binding_model_id" ref="sale.model_sale_order"/> <field name="binding_type">report</field> </record>

Here are a couple of things to keep in mind:

  • The model field should match the technical name of the model you're reporting on (e.g., sale.order).
  • If you want the report to be accessible via the Print button on the model's form view, you need to set the binding_model_id accordingly. For example, for sale.order, the reference should be sale.model_sale_order.

I recommend checking out this tutorial on creating a PDF report in Odoo 15. It explains everything step-by-step:

https://www.cybrosys.com/blog/how-to-create-a-pdf-report-in-odoo-15


Hope it helps

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
vas. 24
3312
1
liep. 23
1668
1
geg. 24
1747
1
bal. 24
1426
0
bal. 24
1335