Merge lp:~unifield-team/unifield-addons/uf_1020_avg_price into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4538
Proposed branch: lp:~unifield-team/unifield-addons/uf_1020_avg_price
Merge into: lp:unifield-addons
Diff against target: 60 lines (+10/-5)
2 files modified
stock/wizard/stock_partial_move.py (+6/-4)
stock/wizard/stock_partial_picking.py (+4/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf_1020_avg_price
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+108987@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 'stock/wizard/stock_partial_move.py'
2--- stock/wizard/stock_partial_move.py 2012-02-14 08:25:50 +0000
3+++ stock/wizard/stock_partial_move.py 2012-06-06 16:23:30 +0000
4@@ -59,7 +59,9 @@
5 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'),
6 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'),
7 }
8-
9+
10+ def _is_incoming_move(self, move):
11+ return (move.location_id.usage not in ('internal','view') and move.location_dest_id.usage == 'internal')
12
13 def __is_in(self,cr, uid, move_ids):
14 """
15@@ -72,7 +74,7 @@
16 move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
17
18 for move in move_obj.browse(cr, uid, move_ids):
19- if move.picking_id.type == 'in' and move.product_id.cost_method == 'average':
20+ if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
21 return True
22 return False
23
24@@ -104,7 +106,7 @@
25 'move_id' : move.id,
26 }
27
28- if move.picking_id.type == 'in':
29+ if self._is_incoming_move(move):
30 move_memory.update({
31 'cost' : move.product_id.standard_price,
32 'currency' : move.product_id.company_id and move.product_id.company_id.currency_id and move.product_id.company_id.currency_id.id or False,
33@@ -217,7 +219,7 @@
34 }
35
36 moves_ids_final.append(move.id)
37- if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
38+ if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
39 partial_datas['move%s' % (move.id)].update({
40 'product_price' : p_moves[move.id].cost,
41 'product_currency': p_moves[move.id].currency.id,
42
43=== modified file 'stock/wizard/stock_partial_picking.py'
44--- stock/wizard/stock_partial_picking.py 2012-02-14 08:25:50 +0000
45+++ stock/wizard/stock_partial_picking.py 2012-06-06 16:23:30 +0000
46@@ -33,10 +33,13 @@
47 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_pick_id', 'Moves'),
48 }
49
50+ def _is_incoming_move(self, move):
51+ return (move.location_id.usage not in ('internal','view') and move.location_dest_id.usage == 'internal')
52+
53 def get_picking_type(self, cr, uid, picking, context=None):
54 picking_type = picking.type
55 for move in picking.move_lines:
56- if picking.type == 'in' and move.product_id.cost_method == 'average':
57+ if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
58 picking_type = 'in'
59 break
60 else:

Subscribers

People subscribed via source and target branches

to all changes: