2
Creating a res.partner record
4
!record {model: res.partner, id: res_partner_a0}:
11
Creating a res.partner.address record
13
!record {model: res.partner.address, id: res_partner_address_0}:
14
partner_id: res_partner_a0
18
Creating a product.product record
20
!record {model: product.product, id: product_product_p0}:
23
international_status: product_attributes.int_1
26
Creating a sale.order record
28
!record {model: sale.order, id: sale_order_so0}:
29
partner_id: res_partner_a0
30
partner_invoice_id: res_partner_address_0
31
partner_order_id: res_partner_address_0
32
partner_shipping_id: res_partner_address_0
33
pricelist_id: product.list0
37
Creating a sale.order.line record
39
!record {model: sale.order.line, id: sale_order_line_p0}:
40
order_id: sale_order_so0
42
product_id: product_product_p0
43
product_uom: product.product_uom_unit
49
I validate the sale order
52
!python {model: sale.order}: |
54
wf_service = netsvc.LocalService("workflow")
55
wf_service.trg_validate(uid, 'sale.order', ref("sale_order_so0"), 'order_confirm', cr)
59
I check the draft picking creation and create picking object.
60
And confirm the stock.picking and process.
62
!python {model: stock.picking}: |
63
ids = self.search(cr, uid, [('sale_id', '=', ref("sale_order_so0")), ('state', '=', 'draft')], context=context)
64
assert len(ids) == 1, 'number of created draft picking is wrong, 1 - %s'%len(ids)
66
delivered = self.read(cr, uid, ids[0], ['delivered'], context=context)['delivered']
67
assert not delivered, 'delivered is set to True - %s'%delivered
68
self.set_delivered(cr, uid, ids, context=context)
69
delivered = self.read(cr, uid, ids[0], ['delivered'], context=context)['delivered']
70
assert delivered, 'delivered is not set to True - %s'%delivered
72
# copy the out - check delivered is False
73
new_out_id = self.copy(cr, uid, ids[0], {}, context=context)
74
new_delivered = self.read(cr, uid, new_out_id, ['delivered'], context=context)['delivered']
75
assert not new_delivered, 'delivered of new out is wrong - False - %s'%new_delivered