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
=== modified file 'stock/wizard/stock_partial_move.py'
--- stock/wizard/stock_partial_move.py 2012-02-14 08:25:50 +0000
+++ stock/wizard/stock_partial_move.py 2012-06-06 16:23:30 +0000
@@ -59,7 +59,9 @@
59 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'),59 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'),
60 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'),60 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'),
61 }61 }
62 62
63 def _is_incoming_move(self, move):
64 return (move.location_id.usage not in ('internal','view') and move.location_dest_id.usage == 'internal')
63 65
64 def __is_in(self,cr, uid, move_ids):66 def __is_in(self,cr, uid, move_ids):
65 """67 """
@@ -72,7 +74,7 @@
72 move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])74 move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
73 75
74 for move in move_obj.browse(cr, uid, move_ids):76 for move in move_obj.browse(cr, uid, move_ids):
75 if move.picking_id.type == 'in' and move.product_id.cost_method == 'average':77 if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
76 return True78 return True
77 return False79 return False
78 80
@@ -104,7 +106,7 @@
104 'move_id' : move.id,106 'move_id' : move.id,
105 }107 }
106 108
107 if move.picking_id.type == 'in':109 if self._is_incoming_move(move):
108 move_memory.update({110 move_memory.update({
109 'cost' : move.product_id.standard_price,111 'cost' : move.product_id.standard_price,
110 '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,112 '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,
@@ -217,7 +219,7 @@
217 }219 }
218 220
219 moves_ids_final.append(move.id)221 moves_ids_final.append(move.id)
220 if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):222 if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
221 partial_datas['move%s' % (move.id)].update({223 partial_datas['move%s' % (move.id)].update({
222 'product_price' : p_moves[move.id].cost,224 'product_price' : p_moves[move.id].cost,
223 'product_currency': p_moves[move.id].currency.id,225 'product_currency': p_moves[move.id].currency.id,
224226
=== modified file 'stock/wizard/stock_partial_picking.py'
--- stock/wizard/stock_partial_picking.py 2012-02-14 08:25:50 +0000
+++ stock/wizard/stock_partial_picking.py 2012-06-06 16:23:30 +0000
@@ -33,10 +33,13 @@
33 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_pick_id', 'Moves'),33 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_pick_id', 'Moves'),
34 }34 }
3535
36 def _is_incoming_move(self, move):
37 return (move.location_id.usage not in ('internal','view') and move.location_dest_id.usage == 'internal')
38
36 def get_picking_type(self, cr, uid, picking, context=None):39 def get_picking_type(self, cr, uid, picking, context=None):
37 picking_type = picking.type40 picking_type = picking.type
38 for move in picking.move_lines:41 for move in picking.move_lines:
39 if picking.type == 'in' and move.product_id.cost_method == 'average':42 if self._is_incoming_move(move) and move.product_id.cost_method == 'average':
40 picking_type = 'in'43 picking_type = 'in'
41 break44 break
42 else:45 else:

Subscribers

People subscribed via source and target branches

to all changes: