4
!record {model: res.partner, id: partner_A}:
11
!record {model: res.partner.address, id: address_A}:
17
!record {model: product.product, id: product_A}:
20
procure_method: make_to_order
25
international_status: product_attributes.int_1
29
!record {model: product.product, id: product_B}:
35
international_status: product_attributes.int_1
39
!record {model: sale.order, id: so_A7}:
40
company_id: base.main_company
41
date_order: '2011-04-13'
42
invoice_quantity: order
45
partner_invoice_id: address_A
46
partner_order_id: address_A
47
partner_shipping_id: address_A
48
picking_policy: direct
49
pricelist_id: product.list0
54
Create a Sale Order Line
56
!record {model: sale.order.line, id: sol_A7}:
57
product_uom: product.product_uom_unit
62
date_planned: '2011-04-13'
65
I change the procurement method for make_to_stock then back make_to_order in sourcing line
67
!python {model: sale.order.line}: |
68
obj = self.browse(cr, uid, ref("sol_A7"), context=context)
69
self.pool.get('sourcing.line').write(cr, uid, [obj.sourcing_line_ids[0].id], {'type': 'make_to_stock'}, context=context)
70
self.pool.get('sourcing.line').write(cr, uid, [obj.sourcing_line_ids[0].id], {'type': 'make_to_order'}, context=context)
72
I change the product for product A (service with reception) in sale order line
74
!python {model: sale.order.line}: |
75
self.write(cr, uid, [ref("sol_A7")], {'product_id': ref("product_A")}, context=context)
77
I change the procurement method for make_to_stock should fail
79
!python {model: sale.order.line}: |
81
obj = self.browse(cr, uid, ref("sol_A7"), context=context)
83
self.pool.get('sourcing.line').write(cr, uid, [obj.sourcing_line_ids[0].id], {'type': 'make_to_stock'}, context=context)
84
except osv.except_osv, e:
85
# ok the constraint has been raised
89
assert False, 'The constraint: "You must select on order procurement method for Service with Reception products." has not been triggered.'