Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3990 Weergaven

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

Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer
Beste antwoord

Hello

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

AJ

Avatar
Annuleer
Auteur

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

Gerelateerde posts Antwoorden Weergaven Activiteit
2
feb. 24
1030
1
jul. 23
1335
1
feb. 24
1212
2
nov. 22
2882
2
feb. 24
1260