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

« back to all changes in this revision

Viewing changes to service_purchasing/test/service_purchasing-1.yml

  • Committer: Quentin THEURET
  • Date: 2011-11-30 13:31:37 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: qt@tempo-consulting.fr-20111130133137-mdf2fp6hkqmwbppn
UF-647 [ADD] Added a line in Purchase Order to have information about international transport costs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
-
2
 
   Creating a service location
3
 
-
4
 
  !record {model: stock.location, id: location_service}:
5
 
    name: Test Service
6
 
    location_category: other
7
 
    usage: view
8
 
    service_location: True
9
1
10
2
  Creating a res.partner record
11
3
26
18
  Creating a product.product record service with reception
27
19
28
20
  !record {model: product.product, id: product_service_p0}:
29
 
    default_code: P2
 
21
    default_code: P0
30
22
    name: product 0 test
31
 
    type: service_recep
32
 
    international_status: product_attributes.int_1
 
23
    type: service
33
24
    
34
25
35
26
  Creating a product.product record service with reception
36
27
37
28
  !record {model: product.product, id: product_service_recep_p1}:
38
 
    default_code: P3
 
29
    default_code: P0
39
30
    name: product 0 test
40
31
    type: service_recep
41
 
    procure_method: make_to_order
42
 
    international_status: product_attributes.int_1
43
32
    
44
33
45
34
  Creating a product.product record stockable
46
35
47
36
  !record {model: product.product, id: product_stockable_p2}:
48
 
    default_code: P12
 
37
    default_code: P1
49
38
    name: product 1 test
50
39
    type: product
51
 
    international_status: product_attributes.int_1
52
40
  
53
41
    
54
42
68
56
  Change the source location to Service location
69
57
-
70
58
  !python {model: stock.move}: |
71
 
    from osv import osv
 
59
    from osv.orm import except_orm
72
60
    service_location = self.pool.get('stock.location').search(cr, uid, [('service_location', '=', True)], context=context)
73
61
    assert service_location, 'No Service Location available'
74
62
    service_location = service_location[0]
75
63
    
76
64
    try:
77
65
      self.write(cr, uid, ref("stock_move_1"), {'location_id': service_location} ,context=context)
78
 
    except osv.except_osv as e:
 
66
    except except_orm as e:
79
67
      # ok the constraint has been raised
80
68
      pass
81
69
    else:
82
70
      assert False, 'The constraint: "You cannot select Service Location as Source Location." has not been triggered.'
83
 
    
 
71
    
 
 
b'\\ No newline at end of file'