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

« back to all changes in this revision

Viewing changes to procurement_cycle/test/proc_cycle.yml

  • Committer: Quentin THEURET
  • Date: 2012-02-02 10:10:59 UTC
  • mto: This revision was merged to the branch mainline in revision 587.
  • Revision ID: qt@tempo-consulting.fr-20120202101059-y8gkodfqbdmf93sb
UF-716 [IMP] Change columns titles

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    p1_s1_id = self.search(cr, uid, [('product_id', '=', ref('product1')), ('location_id', '=', ref('cycle_sloc1'))])
91
91
    assert p1_s1_id, "The scheduler hasn't created the procurement order for P1 in Sloc1"
92
92
    for proc in self.browse(cr, uid, p1_s1_id):
93
 
      assert proc.product_qty == 1160.00, "Bad quantity on procurement order for P1 in Sloc1 %s != 1160"%(proc.product_qty, )
 
93
      assert proc.product_qty == 170.00, "Bad quantity on procurement order for P1 in Sloc1"
94
94
-
95
95
  Check if the procurement for P1 in Sloc2 has good values
96
96
-
98
98
    p1_s2_id = self.search(cr, uid, [('product_id', '=', ref('product1')), ('location_id', '=', ref('cycle_sloc2')), ('origin', '=', 'R4')])
99
99
    assert p1_s2_id, "The scheduler hasn't created the procurement order for P1 in Sloc2"
100
100
    for proc in self.browse(cr, uid, p1_s2_id):
101
 
      assert proc.product_qty == 523.00, "Bad quantity on procurement order for P1 in Sloc2 %s != 523"%(proc.product_qty, )
 
101
      assert proc.product_qty == 39.00, "Bad quantity on procurement order for P1 in Sloc2"
102
102
-
103
103
  Check if the procurement for P2 in Sloc1 has good values
104
104
-
106
106
    p2_s1_id = self.search(cr, uid, [('product_id', '=', ref('product2')), ('location_id', '=', ref('cycle_sloc1'))])
107
107
    assert p2_s1_id, "The scheduler hasn't created the procurement order for P2 in Sloc1"
108
108
    for proc in self.browse(cr, uid, p2_s1_id):
109
 
      assert proc.product_qty == 2169.00, "Bad quantity on procurement order for P2 in Sloc1 %s != 2169"%(proc.product_qty, )
 
109
      assert proc.product_qty == 450.00, "Bad quantity on procurement order for P2 in Sloc1"
110
110
-
111
111
  Check if the procurement for P2 in Sloc2 has good values
112
112
-
114
114
    p2_s2_id = self.search(cr, uid, [('product_id', '=', ref('product2')), ('location_id', '=', ref('cycle_sloc2'))])
115
115
    assert p2_s2_id, "The scheduler hasn't created the procurement order for P2 in Sloc2"
116
116
    for proc in self.browse(cr, uid, p2_s2_id):
117
 
      assert proc.product_qty == 1106.00, "Bad quantity on procurement order for P2 in Sloc2 %s != 1106"%(proc.product_qty, )
 
117
      assert proc.product_qty == 183.00, "Bad quantity on procurement order for P2 in Sloc2"
118
118
-
119
119
  Check if the procurement for P3 in Sloc1 has good values
120
120
-
122
122
    p3_s1_id = self.search(cr, uid, [('product_id', '=', ref('product3')), ('location_id', '=', ref('cycle_sloc1'))])
123
123
    assert p3_s1_id, "The scheduler hasn't created the procurement order for P3 in Sloc1"
124
124
    for proc in self.browse(cr, uid, p3_s1_id):
125
 
      assert proc.product_qty == 1250.00, "Bad quantity on procurement order for P3 in Sloc1 %s != 1250"%(proc.product_qty, )
 
125
      assert proc.product_qty == 1397.00, "Bad quantity on procurement order for P3 in Sloc1"
126
126
-
127
127
  Check if the procurement for P3 in Sloc2 has good values
128
128
-
131
131
    import datetime
132
132
    p3_s2_id = self.search(cr, uid, [('product_id', '=', ref('product3')), ('location_id', '=', ref('cycle_sloc2'))])
133
133
    assert p3_s2_id, "The scheduler hasn't created the procurement order for P3 in Sloc2"
134
 
#    for proc in self.browse(cr, uid, p3_s2_id):
135
 
#      if calendar.mdays[datetime.date.today().month] == 29 or (calendar.mdays[datetime.date.today().month] == 28 and datetime.date.today().year%4 == 0):
136
 
#        assert proc.product_qty == 355.00, "Bad quantity on procurement order for P3 in Sloc2 %s!=355"%proc.product_qty
137
 
#      elif calendar.mdays[datetime.date.today().month] == 28:
138
 
#        assert proc.product_qty == 350.00, "Bad quantity on procurement order for P3 in Sloc2 %s!=350"%proc.product_qty
139
 
#      elif calendar.mdays[datetime.date.today().month] == 30:
140
 
#        assert proc.product_qty == 366.00, "Bad quantity on procurement order for P3 in Sloc2 %s!=366"%proc.product_qty
141
 
#      elif calendar.mdays[datetime.date.today().month] == 31:
142
 
#        assert proc.product_qty == 365.00, "Bad quantity on procurement order for P3 in Sloc2 %s!=365"%proc.product_qty
143
 
#      else:
144
 
#        assert proc.product_qty == 366.00, "Bad quantity on procurement order for P3 in SLoc2 %s!=366"%proc.product_qty
 
134
    for proc in self.browse(cr, uid, p3_s2_id):
 
135
      if calendar.mdays[datetime.date.today().month] == 29 or (calendar.mdays[datetime.date.today().month] == 28 and datetime.date.today().year%4 == 0):
 
136
        assert proc.product_qty == 355.00, "Bad quantity on procurement order for P3 in Sloc2"
 
137
      elif calendar.mdays[datetime.date.today().month] == 28:
 
138
        assert proc.product_qty == 350.00, "Bad quantity on procurement order for P3 in Sloc2"
 
139
      elif calendar.mdays[datetime.date.today().month] == 30:
 
140
        assert proc.product_qty == 366.00, "Bad quantity on procurement order for P3 in Sloc2"
 
141
      elif calendar.mdays[datetime.date.today().month] == 31:
 
142
        assert proc.product_qty == 365.00, "Bad quantity on procurement order for P3 in Sloc2"
 
143
      else:
 
144
        assert proc.product_qty == 366.00, "Bad quantity on procurement order for P3 in SLoc2"
145
145
-
146
146
  Check if the procurement for P4 in Sloc2 has good values
147
147
-