Skip to Content
Menu
This question has been flagged
1 Reply
1024 Views

Hi,

In Odoo 11, in a quotation I can create order_lines and save a quotation.

If I don't change the order (sequence parameter),  of the order_lines, I can add a new order_line which is placed and the end of the order _lines. It's OK.

If I change the order of the order_lines, and add a new order_line, it is not placed at the end of the order_lines because its sequence = 0.

I have changed this.

However, before saving the quotation, thenew order_line is placed at a wrong place (due to the sequence = 0), and when I click on the save button, the new order_line goes to the correct place.

If I move the new order_line before saving the quotation, the final position is correct.


My question is: how to attribute a correct position (or sequence) at the new order_line, before saving the quotation?

Thanks in advance,

Boris

Avatar
Discard
Author Best Answer

I find the solution.

In the create function, if a sale.order.line.sequence = 0, I change it to -1000. 

The manual move of the line is still correct.

Now, when a new order line is created, it's temporary sequence value is 0 and this new order line is placed at the botom.

In the create function, the sequnce remain to -1000 or goes to max(sequences)+1, depending if the order lines have been moved of position or not.

Boris

Avatar
Discard