I'm currently using Odoo v8 and working on a custom module. I want to dynamically change the name of the downloaded report such as string+FieldValue where FieldValue is the value of a specific field on my model. How To ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
1
Odpowiedz
5012
Widoki
Hi,
You can change the report name like this,
<record id="module_name.report_gst" model="ir.actions.report.xml">
<field name="print_report_name">(object.type == 'out_invoice' and object.state == 'draft' and 'Draft %s.pdf' % (object.journal_id.name) or
object.type == 'out_invoice' and object.state in ('open','paid') and '%s - %s.pdf' % (object.journal_id.name, object.number) or
object.type == 'out_refund' and object.state == 'draft' and 'Refund.pdf' or
object.type == 'out_refund' and '%s - %s.pdf' % ('Refund', object.number) or
object.type == 'in_invoice' and object.state == 'draft' and 'Vendor Bill.pdf' or
object.type == 'in_invoice' and object.state in ('open','paid') and '%s - %s.pdf' % (object.journal_id.name, object.number) or
object.type == 'in_refund' and object.state == 'draft' and 'Vendor Refund.pdf' or
object.type == 'in_refund' and '%s - %s.pdf' % ('Vendor Refund', object.number))</field>
</record>
This is a sample, change it accordingly,
Thanks
Could you please suggest on how to dynamically change the report name in case of multiple document report?
If we select multiple records from the tree view and print the report, I do not get the value i set in "print_report_name"
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
gru 17
|
3534 | ||
|
2
lut 17
|
7059 | ||
|
1
sie 16
|
16463 | ||
|
0
sty 16
|
3268 | ||
[8] Odoo Custom Report Page
Rozwiązane
|
|
3
lip 15
|
3856 |