2
In order to check if the source location of a sale order line
3
still use the location of the shop if not specified on the
6
!record {model: sale.order, id: sale_notsourced_01}:
7
partner_id: base.res_partner_2
8
note: Invoice after delivery
10
- product_id: product.product_product_7
13
When I confirm the sale order
15
!workflow {model: sale.order, action: order_confirm, ref: sale_notsourced_01}
17
Then a delivery order should have been generated
19
!python {model: sale.order}: |
20
sale_order = self.browse(cr, uid, ref("sale_notsourced_01"))
21
assert len(sale_order.picking_ids) == 1, (
22
"1 delivery order expected, got %d" % len(sale_order.picking_ids))
24
And the source location of the stock move should be the one of
25
the sales order's shop
27
!python {model: sale.order}: |
28
sale_order = self.browse(cr, uid, ref("sale_notsourced_01"))
29
picking = sale_order.picking_ids[0]
30
location_id = sale_order.shop_id.warehouse_id.lot_stock_id
31
for move in picking.move_lines:
32
assert move.location_id == location_id, (
33
"Wrong location_id, expected %s, got %s" %
34
(location_id, move.location_id))
35
for procurement in move.procurements:
36
assert procurement.location_id == location_id, (
37
"Wrong location_id in procurement.order, expected %s, got %s" %
38
(location_id, procurement.location_id))