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

We recently switched from V15 to V17.

In V15 there was a text line under the invoice with the period of the invoice, for example 01-01-2025 to 31-01-2025. Since V17 this information is under every detail line in the invoice. Can this be adjusted somewhere so that this information is gone or possibly 1 text line is created again?

I have already searched the templates but cannot find the correct QWEB report. Can someone point me in the right direction?


I can edit the _prepare_invoice_line function in "src/enterprise/sale_subscription/models/sale_oder_line.py" To change the description line but is this a good way to achieve this?

Avatar
Annuleer
Beste antwoord

WARNING: This is an approach, not necessarily a complete solution. Your Odoo Digital Advisor or Odoo Partner can help you if you don't have the skills to do this yourself.


One option is to create an Automation Rule that overrides the function that Odoo uses to add the period description with the start and end date. This function relies on the recurring_invoice field on the subscription order line.

This approach creates a new sale order line with the same name and since we are not providing a value for the recurring_invoice field, we can recalculate the description on the copy and assign the result (which won't have the period text) back to the original.


for record in records:
    if record.sale_line_ids:
        sol = record.sale_line_ids[0]
        sol_duplicate = sol.new({'order_id': sol.order_id.id,'name': sol.name})._prepare_invoice_line()
        record['name'] = sol_duplicate.get('name', record.name)
Avatar
Annuleer
Beste antwoord

You can change either in python or xml report if it solve the issue depending on your tastes of making the change at the source when it's created or at the target when it is displayed. For the how, I would create my own modules and inherit the python or xml template and make the change there. That way I can keep track of the changes I made, I can undo it or if there is some more changes of the same nature, I can put them in my module. It is never recommended to change Odoo's source code.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
feb. 25
1879
1
dec. 24
2245
2
apr. 24
3664
2
apr. 24
4920
0
mrt. 24
1566