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

« back to all changes in this revision

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

  • Committer: chloups208
  • Date: 2011-09-07 12:58:12 UTC
  • mto: (307.2.1 unifield-wm)
  • mto: This revision was merged to the branch mainline in revision 311.
  • Revision ID: chloups208@chloups208-laptop-20110907125812-dsb1jt93ae6bgfe2
[UF-390]pro forma invoice + shipment object refactoring + pack family object refactoring

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
 
10
 
  Creating a res.partner record
11
 
12
 
  !record {model: res.partner, id: res_partner_a0}:
13
 
    credit_limit: 0.0
14
 
    debit_limit: 0.0
15
 
    name: A
16
 
    supplier: true
17
 
    
18
 
19
 
  Creating a res.partner.address record
20
 
21
 
  !record {model: res.partner.address, id: res_partner_address_0}:
22
 
    partner_id: res_partner_a0
23
 
    street: A
24
 
 
25
 
-
26
 
  Creating a product.product record service with reception
27
 
28
 
  !record {model: product.product, id: product_service_p0}:
29
 
    default_code: P2
30
 
    name: product 0 test
31
 
    type: service_recep
32
 
    international_status: product_attributes.int_1
33
 
    
34
 
35
 
  Creating a product.product record service with reception
36
 
37
 
  !record {model: product.product, id: product_service_recep_p1}:
38
 
    default_code: P3
39
 
    name: product 0 test
40
 
    type: service_recep
41
 
    procure_method: make_to_order
42
 
    international_status: product_attributes.int_1
43
 
    
44
 
45
 
  Creating a product.product record stockable
46
 
47
 
  !record {model: product.product, id: product_stockable_p2}:
48
 
    default_code: P12
49
 
    name: product 1 test
50
 
    type: product
51
 
    international_status: product_attributes.int_1
52
 
  
53
 
    
54
 
55
 
  1. I create a stock move, and then change the source location
56
 
  with Service Location. An exception should be raised.
57
 
  
58
 
  Creating a stock.move record
59
 
60
 
  !record {model: stock.move, id: stock_move_1}:
61
 
    name: test stock move
62
 
    product_id: product_stockable_p2
63
 
    product_uom: product.product_uom_unit
64
 
    location_dest_id: stock.stock_location_stock
65
 
    location_id: stock.stock_location_stock
66
 
 
67
 
-
68
 
  Change the source location to Service location
69
 
-
70
 
  !python {model: stock.move}: |
71
 
    from osv import osv
72
 
    service_location = self.pool.get('stock.location').search(cr, uid, [('service_location', '=', True)], context=context)
73
 
    assert service_location, 'No Service Location available'
74
 
    service_location = service_location[0]
75
 
    
76
 
    try:
77
 
      self.write(cr, uid, ref("stock_move_1"), {'location_id': service_location} ,context=context)
78
 
    except osv.except_osv as e:
79
 
      # ok the constraint has been raised
80
 
      pass
81
 
    else:
82
 
      assert False, 'The constraint: "You cannot select Service Location as Source Location." has not been triggered.'
83