콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2329 화면

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

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
2월 24
3303
1
7월 23
1665
1
5월 24
1745
1
4월 24
1422
0
4월 24
1326