Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7181 Lượt xem

Hi,

I am creating a new report via XML in a module

 <report
id="report_invoice_custom"
model="account.invoice"
string="Custom invoice report"
report_type="qweb-pdf"
name="custom_invoice_report.invoice_custom"
attachment_use="False"
file="custom_invoice_report.invoice_custom"
attachment = "(object.state in ('open','paid')) and ('F_'+(object.number or '').replace('/','')+'.pdf')"
paperformat_id = "1" <-- THIS DOES NOT WORK!
/>

paperformat_id is not a field of report but it has to be specified through relationship report.paperformat.

How could be specified such relationship through XML?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

<report

id="report_invoice_custom"

model="account.invoice"

string="Custom invoice report"

report_type="qweb-pdf"

name="custom_invoice_report.invoice_custom"

attachment_use="False"

file="custom_invoice_report.invoice_custom"

attachment = "(object.state in ('open','paid')) and ('F_'+(object.number or '').replace('/','')+'.pdf')"

/>

<record id="report_invoice_custom" model="ir.actions.report.xml">

<field name="paperformat_id" ref="custom_invoice_report.custompaperformat"/> <!-- Put Your Custom PaperFormat Id -->

</record>


Also you can refer this

<field name="paperformat_id" ref="report.paperformat_euro"/>

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you very much indeed, this is exactly what I was looking for.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 20
28980
3
thg 7 23
6934
0
thg 2 22
4522
0
thg 10 21
5051
0
thg 9 15
5557