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

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

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

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.

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

Hello

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

AJ

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

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 24
1048
1
thg 7 23
1342
1
thg 2 24
1222
2
thg 11 22
2913
2
thg 2 24
1281