Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sale_elaboration/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,19 @@ def get_elaboration_stock_route(self):

@api.depends("elaboration_ids")
def _compute_route_id(self):
for line in self:
# Reset routes: elaboration might be unset.
self.filtered(
lambda x: x.route_id not in x.elaboration_ids.route_ids
).route_id = False
# Other modules might use this compute. Let's respect inheritance
res = None
if hasattr(super(), "_compute_route_id"):
res = super()._compute_route_id()
for line in self.filtered("elaboration_ids"):
route_id = line.get_elaboration_stock_route()
if route_id:
line.route_id = route_id
return res

@api.depends("elaboration_ids", "order_id.pricelist_id")
def _compute_elaboration_price_unit(self):
Expand Down