Merge lp:~unifield-team/unifield-wm/wm-2418-rw-fix into lp:unifield-wm

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 2207
Proposed branch: lp:~unifield-team/unifield-wm/wm-2418-rw-fix
Merge into: lp:unifield-wm
Diff against target: 66 lines (+18/-5)
2 files modified
delivery_mechanism/delivery_mechanism.py (+16/-3)
msf_outgoing/msf_outgoing.py (+2/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/wm-2418-rw-fix
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+229779@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'delivery_mechanism/delivery_mechanism.py'
2--- delivery_mechanism/delivery_mechanism.py 2014-07-24 12:09:53 +0000
3+++ delivery_mechanism/delivery_mechanism.py 2014-08-06 12:52:43 +0000
4@@ -694,8 +694,11 @@
5
6 remaining_out_qty = line.quantity
7 out_move = None
8- for out_move in out_moves:
9- out_move = move_obj.browse(cr, uid, out_move.id, context=context)
10+ for lst_out_move in out_moves:
11+ if remaining_out_qty <= 0.00:
12+ break
13+
14+ out_move = move_obj.browse(cr, uid, lst_out_move.id, context=context)
15
16 # List the Picking Ticket that need to be created from the Draft Picking Ticket
17 if out_move.picking_id.type == 'out' \
18@@ -732,15 +735,25 @@
19 })
20 move_obj.write(cr, uid, [out_move.id], out_values, context=context)
21 processed_out_moves.append(out_move.id)
22+ remaining_out_qty = 0.00
23 else:
24 # Just update the data of the initial out move
25+ processed_qty = lst_out_move is out_moves[-1] and uom_partial_qty or out_move.product_qty
26 out_values.update({
27- 'product_qty': uom_partial_qty,
28+ 'product_qty': processed_qty,
29 'product_uom': line.uom_id.id,
30 'in_out_updated': sync_in and False or True
31 })
32 move_obj.write(cr, uid, [out_move.id], out_values, context=context)
33 processed_out_moves.append(out_move.id)
34+
35+ if line.uom_id.id != out_move.product_uom.id:
36+ uom_processed_qty = uom_obj._compute_qty(cr, uid, out_move.product_uom.id, processed_qty, line.uom_id.id)
37+ else:
38+ uom_processed_qty = processed_qty
39+
40+ remaining_out_qty -= uom_processed_qty
41+
42
43 # Decrement the inital move, cannot be less than zero
44 diff_qty = move.product_qty - count
45
46=== modified file 'msf_outgoing/msf_outgoing.py'
47--- msf_outgoing/msf_outgoing.py 2014-07-28 15:51:36 +0000
48+++ msf_outgoing/msf_outgoing.py 2014-08-06 12:52:43 +0000
49@@ -101,7 +101,7 @@
50 a shipment presents the data from grouped stock moves in a 'sequence' way
51 '''
52 _name = 'shipment'
53- _description = 'represents a group of pack families'
54+ _description = 'Shipment'
55
56 def copy(self, cr, uid, copy_id, default=None, context=None):
57 '''
58@@ -945,7 +945,7 @@
59 #assert shipment.state == 'packed', 'cannot ship a shipment which is not in correct state - packed - %s' % shipment.state
60 if shipment.state != 'packed':
61 raise osv.except_osv(_('Error, packing in wrong state !'),
62- _('Cannot make a shipment which is in a wrong correct state - should be "packed" but here it is ' + shipment.state))
63+ _('Cannot make a shipment which is in a wrong correct state - should be "packed" but here it is - %s' % shipment.state))
64
65 # the state does not need to be updated - function
66 # update actual ship date (shipment_actual_date) to today + time

Subscribers

People subscribed via source and target branches