Skip to Content
Menu
This question has been flagged

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
Discard
Best Answer

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
1
Feb 25
1774
1
Dec 24
2088
2
Apr 24
3544
2
Apr 24
4788
0
Mar 24
1452