Merge lp:~sandi-dirntis/openerpsl/openerpsl_20140401_1 into lp:openerpsl/7.0

Proposed by Aleksander Dirntiš
Status: Merged
Merged at revision: 377
Proposed branch: lp:~sandi-dirntis/openerpsl/openerpsl_20140401_1
Merge into: lp:openerpsl/7.0
Diff against target: 40 lines (+2/-5)
2 files modified
purchase_recalculation/stock_move.py (+1/-3)
purchase_recalculation/stock_picking.py (+1/-2)
To merge this branch: bzr merge lp:~sandi-dirntis/openerpsl/openerpsl_20140401_1
Reviewer Review Type Date Requested Status
Mentis Pending
Review via email: mp+213592@code.launchpad.net

Description of the change

[FIX] purchase_recalculation: fixed bug when setting quantity to NULL

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 'purchase_recalculation/stock_move.py'
2--- purchase_recalculation/stock_move.py 2014-03-19 08:55:42 +0000
3+++ purchase_recalculation/stock_move.py 2014-04-01 06:32:46 +0000
4@@ -35,7 +35,7 @@
5 _credit_lines['stock_move_id'] = move.id
6 return [(0, 0, _debit_lines), (0, 0, _credit_lines)]
7
8- def _move_update_values(self, cr, uid, ids, context, date_delivered, quantity, price_unit):
9+ def _move_update_values(self, cr, uid, ids, context, date_delivered, price_unit):
10 _costs_installed = self.pool.get('stock.move').fields_get(cr, uid, ['landing_costs_line_ids'], context) != {}
11 _moves = self.pool.get('stock.move').browse(cr, uid, ids, context)
12 for _move in _moves:
13@@ -43,12 +43,10 @@
14 date_delivered = _move.date
15 if _costs_installed:
16 self.pool.get('stock.move').write(cr, uid, [_move.id], {'date': date_delivered,
17- 'product_qty': quantity,
18 'price_unit': price_unit,
19 'price_unit_without_costs': False})
20 else:
21 self.pool.get('stock.move').write(cr, uid, [_move.id], {'date': date_delivered,
22- 'product_qty': quantity,
23 'price_unit': price_unit})
24
25 return True
26
27=== modified file 'purchase_recalculation/stock_picking.py'
28--- purchase_recalculation/stock_picking.py 2014-03-17 07:50:11 +0000
29+++ purchase_recalculation/stock_picking.py 2014-04-01 06:32:46 +0000
30@@ -48,9 +48,8 @@
31 _move_data = ctx.get('move%s'%(_move.id), {})
32 if _move_data == {}:
33 continue
34- _quantity = _move_data.get('quantity', False)
35 _price_unit = _move_data.get('price_unit', False)
36- self.pool.get('stock.move')._move_update_values(cr, uid, [_move.id], context, _date_delivered, _quantity, _price_unit)
37+ self.pool.get('stock.move')._move_update_values(cr, uid, [_move.id], context, _date_delivered, _price_unit)
38 if _costs_installed and (_picking_has_costs or _moves_have_costs):
39 self.pool.get('stock.move')._move_update_costs(cr, uid, _move_ids, context)
40 self.pool.get('stock.move')._move_update_valuation(cr, uid, _move_ids, context)

Subscribers

People subscribed via source and target branches