~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to out_step/test/out_step.yml

  • Committer: Olivier DOSSMANN
  • Date: 2014-03-31 09:31:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2086.
  • Revision ID: od@tempo-consulting.fr-20140331093146-tgvxnly1kc1hbv1s
UF-2171 [ADD] Analytic distribution reset button for recurring models

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
  Creating a res.partner record
 
3
 
4
  !record {model: res.partner, id: res_partner_a0}:
 
5
    credit_limit: 0.0
 
6
    debit_limit: 0.0
 
7
    name: A
 
8
    supplier: true
 
9
    
 
10
 
11
  Creating a res.partner.address record
 
12
 
13
  !record {model: res.partner.address, id: res_partner_address_0}:
 
14
    partner_id: res_partner_a0
 
15
    street: A
 
16
 
 
17
 
18
  Creating a product.product record
 
19
 
20
  !record {model: product.product, id: product_product_p0}:
 
21
    default_code: P0
 
22
    name: product 0 test
 
23
    international_status: product_attributes.int_1
 
24
    
 
25
 
26
  Creating a sale.order record
 
27
 
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
 
34
    shop_id: sale.shop  
 
35
    
 
36
 
37
  Creating a sale.order.line record
 
38
 
39
  !record {model: sale.order.line, id: sale_order_line_p0}:
 
40
    order_id: sale_order_so0
 
41
    price_unit: 1.0
 
42
    product_id: product_product_p0
 
43
    product_uom: product.product_uom_unit
 
44
    product_uom_qty: 1.0
 
45
    type: make_to_stock
 
46
    
 
47
-
 
48
 
 
49
  I validate the sale order
 
50
 
 
51
-
 
52
  !python {model: sale.order}: |
 
53
    import netsvc
 
54
    wf_service = netsvc.LocalService("workflow")
 
55
    wf_service.trg_validate(uid, 'sale.order', ref("sale_order_so0"), 'order_confirm', cr)
 
56
    
 
57
-
 
58
 
 
59
  I check the draft picking creation and create picking object.
 
60
  And confirm the stock.picking and process.
 
61
-
 
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)
 
65
    # test the button
 
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
 
71
    
 
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