We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56e25fd commit b89509bCopy full SHA for b89509b
sale_order_wh_from_delivery_carrier/models/sale_order.py
@@ -9,8 +9,13 @@ class SaleOrder(models.Model):
9
)
10
def _compute_warehouse_id(self):
11
# Set warehouse by shipping method
12
- so_with_shipping = self.filtered("carrier_id")
13
- for order in so_with_shipping:
14
- if order.state == "draft" and order.carrier_id.so_warehouse_id:
+ so_with_shipping = self.browse()
+ for order in self:
+ if (
15
+ order.state == "draft"
16
+ and order.carrier_id
17
+ and order.carrier_id.so_warehouse_id
18
+ ):
19
order.warehouse_id = order.carrier_id.so_warehouse_id
20
+ so_with_shipping |= order
21
return super(SaleOrder, self - so_with_shipping)._compute_warehouse_id()
0 commit comments