Merge lp:~syleam/wms/5.0-update_wave_and_scanner into lp:wms

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 234
Proposed branch: lp:~syleam/wms/5.0-update_wave_and_scanner
Merge into: lp:wms
Diff against target: 184 lines (+45/-13)
6 files modified
wms/object/move.py (+1/-1)
wms/object/warehouse.py (+1/-1)
wms_location/object/location.py (+1/-1)
wms_scanner/hardware/datalogic/PowerScan/hardware.py (+1/-1)
wms_scanner/object/scanner.py (+27/-5)
wms_wave/object/stock.py (+14/-4)
To merge this branch: bzr merge lp:~syleam/wms/5.0-update_wave_and_scanner
Reviewer Review Type Date Requested Status
Christophe CHAUVET Approve
Review via email: mp+72881@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wms/object/move.py'
2--- wms/object/move.py 2011-08-04 13:44:16 +0000
3+++ wms/object/move.py 2011-08-25 12:59:23 +0000
4@@ -149,7 +149,7 @@
5
6 # GR: moves related to internal pickings have nothing to do
7 # with the total amount of product.
8- if ( (not move.picking_id or move.picking_id.type != 'internal')
9+ if ((not move.picking_id or move.picking_id.type != 'internal')
10 and move.product_id.qty_physical <= 0):
11 continue
12
13
14=== modified file 'wms/object/warehouse.py'
15--- wms/object/warehouse.py 2011-08-04 13:44:16 +0000
16+++ wms/object/warehouse.py 2011-08-25 12:59:23 +0000
17@@ -44,7 +44,7 @@
18 'check_tracking_burst': fields.boolean('check tracking', help='Check tracking on burst out'),
19 'keep_missing_product_in': fields.boolean('Keep product in', help='If check, missing product line on receipt order stay with quantity = 0'),
20 'force_reserved_location': fields.boolean('Force reserved', help='Force move product in reserved location'),
21- 'forbid_unsupplied_internal_move' : fields.boolean('Forbid unsupplied internal', help="Prevent internal moves with not enough stock level"),
22+ 'forbid_unsupplied_internal_move': fields.boolean('Forbid unsupplied internal', help="Prevent internal moves with not enough stock level"),
23 }
24
25 _defaults = {
26
27=== modified file 'wms_location/object/location.py'
28--- wms_location/object/location.py 2011-07-18 12:24:41 +0000
29+++ wms_location/object/location.py 2011-08-25 12:59:23 +0000
30@@ -164,7 +164,7 @@
31 arg_query4 = [tuple(loc_ids)]
32 sql_query4 = """SELECT coalesce(sum(m14.product_qty), 0)
33 FROM stock_move m14
34- WHERE m14.state= m0.state
35+ WHERE m14.state IN ('done', 'assigned')
36 AND m14.product_id = m0.product_id
37 AND m14.location_id = m0.location_dest_id
38 AND m14.location_dest_id not in %s"""
39
40=== modified file 'wms_scanner/hardware/datalogic/PowerScan/hardware.py'
41--- wms_scanner/hardware/datalogic/PowerScan/hardware.py 2011-08-17 10:02:40 +0000
42+++ wms_scanner/hardware/datalogic/PowerScan/hardware.py 2011-08-25 12:59:23 +0000
43@@ -146,7 +146,7 @@
44 scan_state = self.oerp_hwd.scanner_check(scan)
45 except Exception:
46 act = 'M'
47- rec_oerp = [self._str_center('Please contact'), self._str_center('your'), self._str_center('adminitrator')]
48+ rec_oerp = [self._str_center('Terminal'), self._str_center(scan), self._str_center('not exists!')]
49 self.log_info(scan, 'This scanner is not declare on OpenERP')
50 self._choice(scan, act, rec_oerp, c)
51 continue
52
53=== modified file 'wms_scanner/object/scanner.py'
54--- wms_scanner/object/scanner.py 2011-08-23 07:27:37 +0000
55+++ wms_scanner/object/scanner.py 2011-08-25 12:59:23 +0000
56@@ -66,6 +66,7 @@
57
58 ScannerScenario()
59
60+
61 class ScannerScenarioCustom(osv.osv):
62 _name = 'scanner.scenario.custom'
63 _description = 'Tempori value for scenario'
64@@ -114,22 +115,41 @@
65 'text_val': lambda *a: '',
66 }
67
68-
69- def _get_values(self, cr, uid, scenario_id, scanner_id, model='', res_id=None, domain=[], context=None):
70+ def _get_values(self, cr, uid, scenario_id, scanner_id, model='', res_id=None, domain=None, context=None):
71 """
72 return read customs line
73+ @param domain : list of tuple for search method
74 """
75- domain.extend([('scenario_id', '=', scenario_id), ('scanner_id', '=', scanner_id)])
76+ if domain is None:
77+ domain = [('scenario_id', '=', scenario_id), ('scanner_id', '=', scanner_id)]
78+ else:
79+ domain.extend([('scenario_id', '=', scenario_id), ('scanner_id', '=', scanner_id)])
80 if model:
81 domain.append(('model', '=', model))
82 if res_id:
83 domain.append(('res_id', '=', res_id))
84+ print domain
85 ids = self.search(cr, uid, domain, context=context)
86+ print ids
87 if ids:
88 return self.read(cr, uid, ids, [], context=context)
89 return []
90
91-
92+ def _set_values(self, cr, uid, values, context=None):
93+ """
94+ values is a dict read. get id in values and delete of dict unchanging field
95+ """
96+ vals = values.copy()
97+ ids = [vals.get('id')]
98+ try:
99+ del vals['id']
100+ del vals['scenario_id']
101+ del vals['scanner_id']
102+ del vals['model']
103+ del vals['res_id']
104+ except:
105+ pass
106+ return self.write(cr, uid, ids, vals, context=context)
107
108 def _remove_values(self, cr, uid, scenario_id, scanner_id, context=None):
109 """
110@@ -310,7 +330,8 @@
111 """
112 custom_obj = self.pool.get('scanner.scenario.custom')
113 for read in self.read(cr, uid, ids, ['scenario_id'], context=context):
114- custom_obj._remove_values(cr, uid, read['scenario_id'][0], read['id'], context=context)
115+ if read.get('scenario_id'):
116+ custom_obj._remove_values(cr, uid, read['scenario_id'][0], read['id'], context=context)
117 self.write(cr, uid, ids, {'scenario_id': False, 'step_id': False, 'ref_doc': 0, 'tmp_val1': '', 'tmp_val2': '', 'tmp_val3': '', 'tmp_val4': '', 'tmp_val5': ''}, context=context)
118 return True
119
120@@ -397,6 +418,7 @@
121 'pool': self.pool,
122 'uid': uid,
123 'message': message,
124+ 't': term.browse(cr, uid, term_id, context=context),
125 }
126 expr = eval(str(transition.condition), cxt)
127
128
129=== modified file 'wms_wave/object/stock.py'
130--- wms_wave/object/stock.py 2011-08-24 20:45:55 +0000
131+++ wms_wave/object/stock.py 2011-08-25 12:59:23 +0000
132@@ -60,7 +60,7 @@
133 ('cancel', 'Cancel'),
134 ], 'State', readonly=True, help="State of the current Wave"),
135 'date_confirm': fields.datetime('Date Confirm', states={'cancel': [('readonly', True)]}, help="Date when wave have been confirmed"),
136- 'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', domain=[('type', '=', 'out'), ('state', 'in', ['assigned', 'confirmed']), ('wave_id', '=', False)],
137+ 'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', domain=[('type', '=', 'out'), ('state', '=', 'assigned'), ('wave_id', '=', False)],
138 states={
139 'draft': [('readonly', False)],
140 'confirmed': [('readonly', True)],
141@@ -113,7 +113,7 @@
142 picking_ids = stock_picking_obj.search(cr, uid, [('wave_id', 'in', ids)], context=context)
143 # release picking
144 if picking_ids:
145- self.pool.get('stock.picking').write(cr, uid, picking_ids, {'wave_id': False}, context=context)
146+ self.pool.get('stock.picking').write(cr, uid, picking_ids, {'wave_id': False, 'wave_cart_id': False}, context=context)
147 return self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
148
149 def action_done(self, cr, uid, ids, context=None):
150@@ -126,7 +126,7 @@
151 picking_ids = stock_picking_obj.search(cr, uid, [('wave_id', 'in', ids), ('state', '!=', 'done')], context=context)
152 # release picking
153 if picking_ids:
154- self.pool.get('stock.picking').write(cr, uid, picking_ids, {'wave_id': False}, context=context)
155+ self.pool.get('stock.picking').write(cr, uid, picking_ids, {'wave_id': False, 'wave_cart_id': False}, context=context)
156 return self.write(cr, uid, ids, {'state': 'done'}, context=context)
157
158 def create(self, cr, uid, values, context=None):
159@@ -178,6 +178,16 @@
160 self.write(cr, uid, [id], vals, context=context)
161 return wave_id, name, seq
162
163+ def unlink(self, cr, uid, ids, context=None):
164+ """
165+ delete unlink wave_cart_id
166+ """
167+ picking_ids = []
168+ for wave in self.browse(cr, uid, ids, context=context):
169+ picking_ids.extend([p.id for p in wave.picking_ids])
170+ self.pool.get('stock.picking').write(cr, uid, picking_ids, {'wave_cart_id': False}, context=context)
171+ return super(StockWave, self).unlink(cr, uid, ids, context=context)
172+
173 #########################################################################################
174 # function call by wizard: can be easier inherit
175 #########################################################################################
176@@ -185,7 +195,7 @@
177 """
178 This method is called by wizard to search the picking to use to make wave
179 """
180- return self.pool.get('stock.picking').search(cr, uid, [('type', '=', 'out'), ('wave_id', '=', False), ('state', 'in', ['confirmed', 'assigned'])], context=context)
181+ return self.pool.get('stock.picking').search(cr, uid, [('type', '=', 'out'), ('wave_id', '=', False), ('state', '=', 'assigned')], context=context)
182
183 def wizard_assign_picking_in_wave(self, cr, uid, picking_ids, context=None):
184 """

Subscribers

People subscribed via source and target branches