Merge lp:~qtheuret/unifield-wm/sync_ref_qt_ref_41 into lp:unifield-wm/ref-sync

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~qtheuret/unifield-wm/sync_ref_qt_ref_41
Merge into: lp:unifield-wm/ref-sync
Diff against target: 40 lines (+6/-5)
1 file modified
sync_so/picking.py (+6/-5)
To merge this branch: bzr merge lp:~qtheuret/unifield-wm/sync_ref_qt_ref_41
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+210984@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

430. By Quentin THEURET @Amaris

REF-41 [FIX] Remove raise statement to ignore lines with 0.00 quantity on reception

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sync_so/picking.py'
2--- sync_so/picking.py 2014-03-11 15:19:58 +0000
3+++ sync_so/picking.py 2014-03-14 08:14:53 +0000
4@@ -206,7 +206,6 @@
5 # UF-2148: if the line contains 0 qty, just ignore it!
6 qty = data.get('quantity', 0)
7 if qty == 0:
8- raise
9 message = "Line number " + str(ln) + " with quantity 0 is ignored!"
10 self._logger.info(message)
11 continue
12@@ -267,23 +266,25 @@
13 line_proc_ids = move_proc.search(cr, uid, [
14 ('wizard_id', '=', in_processor),
15 ('move_id', '=', move_id),
16+ ('quantity', '=', 0.00),
17 ], context=context)
18 data['move_id'] = move_id
19 data['wizard_id'] = in_processor
20 if not line_proc_ids:
21+ data['ordered_quantity'] = data['quantity']
22 self.pool.get('stock.move.in.processor').create(cr, uid, data, context=context)
23 else:
24 for line in move_proc.browse(cr, uid, line_proc_ids, context=context):
25 if line.product_id.id == data.get('product_id') and \
26 line.uom_id.id == data.get('uom_id') and \
27- (line.prodlot_id and line.prdolot_id.id == data.get('prodlot_id')) or (not line.prodlot_id and not data.get('prodlot_id')) and \
28+ (line.prodlot_id and line.prodlot_id.id == data.get('prodlot_id')) or (not line.prodlot_id and not data.get('prodlot_id')) and \
29 (line.asset_id and line.asset_id.id == data.get('asset_id')) or (not line.asset_id and not data.get('asset_id')):
30- data['quantity'] += line.quantity
31- move_proc.write(cr, uid, [line.id], {'quantity': data['quantity']}, context=context)
32+ move_proc.write(cr, uid, [line.id], data, context=context)
33 break
34 else:
35+ data['ordered_quantity'] = data['quantity']
36 move_proc.create(cr, uid, data, context=context)
37-
38+
39 # for the last Shipment of an FO, no new INcoming shipment will be created --> same value as in_id
40 new_picking = self.do_incoming_shipment(cr, uid, in_processor, context)
41

Subscribers

People subscribed via source and target branches