diff --git a/sale_order_line_position/models/sale_order_line.py b/sale_order_line_position/models/sale_order_line.py index 60af976c..6ce94b65 100644 --- a/sale_order_line_position/models/sale_order_line.py +++ b/sale_order_line_position/models/sale_order_line.py @@ -35,7 +35,7 @@ def _add_next_position_on_new_line(self, vals_list): ] if sale_ids: ids = tuple(set(sale_ids)) - self.flush_model() + self.env.flush_all() query = """ SELECT order_id, max(position) FROM sale_order_line WHERE order_id in %s GROUP BY order_id;