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_A5}:
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_A5}:
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
67
!python {model: sale.order.line}: |
68
self.write(cr, uid, [ref("sol_A5")], {'type': 'make_to_stock'}, context=context)
69
self.write(cr, uid, [ref("sol_A5")], {'type': 'make_to_order'}, context=context)
71
I change the product for product A (service with reception)
73
!python {model: sale.order.line}: |
74
self.write(cr, uid, [ref("sol_A5")], {'product_id': ref("product_A")}, context=context)
76
I change the procurement method for make_to_stock should fail
78
!python {model: sale.order.line}: |
81
self.write(cr, uid, [ref("sol_A5")], {'type': 'make_to_stock'}, context=context)
82
except osv.except_osv, e:
83
# ok the constraint has been raised
87
assert False, 'The constraint: "You must select on order procurement method for Service with Reception products." has not been triggered.'