Merge lp:~unifield-team/unifield-addons/uf-1753 into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4574
Proposed branch: lp:~unifield-team/unifield-addons/uf-1753
Merge into: lp:unifield-addons
Diff against target: 25 lines (+6/-2)
1 file modified
stock/stock.py (+6/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf-1753
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+144647@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/stock.py'
2--- stock/stock.py 2012-11-26 12:55:21 +0000
3+++ stock/stock.py 2013-01-24 08:05:27 +0000
4@@ -764,6 +764,10 @@
5 - allow to choose wether or not an exception should be raised in case of no stock move
6 '''
7 return True
8+
9+ def _hook_get_move_ids(self, cr, uid, *args, **kwargs):
10+ pick = kwargs['pick']
11+ return [x.id for x in pick.move_lines if x.state in ('waiting', 'confirmed')]
12
13 def action_assign(self, cr, uid, ids, context=None, *args):
14 """ Changes state of picking to available if all moves are confirmed.
15@@ -772,8 +776,8 @@
16 if context is None:
17 context = {}
18 move_obj = self.pool.get('stock.move')
19- for pick in self.browse(cr, uid, ids):
20- move_ids = [x.id for x in pick.move_lines if x.state in ('waiting', 'confirmed')]
21+ for pick in self.browse(cr, uid, ids):
22+ move_ids = self._hook_get_move_ids(cr, uid, pick=pick)
23 if not move_ids:
24 if self._hook_action_assign_raise_exception(cr, uid, ids, context=context,):
25 raise osv.except_osv(_('Warning !'),_('Not enough stock, unable to reserve the products.'))

Subscribers

People subscribed via source and target branches

to all changes: