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

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?

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

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)
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 25
1800
1
thg 12 24
2129
Cost of goods sold Đã xử lý
2
thg 4 24
3576
2
thg 4 24
4832
0
thg 3 24
1476