Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4057 มุมมอง

Hello,

please How to print two different invoice layouts ? when i choose the edit botton i want to see tow possibles layouts (invoice1, invoice2 for exemple)

thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You could even achieve that with one report. Let's take a webkit report example (same princple can be aplied to rml reports): If you need two different layouts:

Add a boolean field for the object, and then in report, make a condition:

if object.my_boolean:
    $object.this}
else:
    ${object.that}

If two options is not enough, you can use selection field, and apply conditions for each selection;

if object.selection == 'this':
    ${object.this}
elif object.selection == 'that':
    ${object.that}
elif object.selection == 'something else':
    ${object.something_else}

You can actually put under such condition anything you like- not only tags, but html elements also.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello

It's possible to have multiple reports for one model. You can develop one report for every layout you need.

AJ

อวตาร
ละทิ้ง
ผู้เขียน

thank you for yor reponse,can you please explane this solution?

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 24
1062
Update the commercial forms ... แก้ไขแล้ว
1
ก.ค. 23
1399
1
ก.พ. 24
1243
2
พ.ย. 22
2963
2
ก.พ. 24
1298