Merge lp:~unifield-team/unifield-addons/return-packing-reason-type-move into lp:unifield-addons

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4496
Proposed branch: lp:~unifield-team/unifield-addons/return-packing-reason-type-move
Merge into: lp:unifield-addons
Diff against target: 32 lines (+12/-3)
1 file modified
stock/wizard/stock_return_picking.py (+12/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/return-packing-reason-type-move
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+76537@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_return_picking.py'
2--- stock/wizard/stock_return_picking.py 2011-09-21 14:41:14 +0000
3+++ stock/wizard/stock_return_picking.py 2011-09-22 10:14:29 +0000
4@@ -132,6 +132,13 @@
5 res['arch'] = '\n'.join(arch_lst)
6 return res
7
8+ def _hook_default_return_data(self, cr, uid, ids, context={}, *args, **kwargs):
9+ '''
10+ Hook to allow user to modify the value for the stock move copy method
11+ '''
12+ return kwargs['default_value']
13+
14+
15 def create_returns(self, cr, uid, ids, context=None):
16 """
17 Creates return picking.
18@@ -165,9 +172,11 @@
19 new_type = 'out'
20 else:
21 new_type = 'internal'
22- new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s-return' % pick.name,
23- 'move_lines':[], 'state':'draft', 'type':new_type,
24- 'date':date_cur, 'invoice_state':data['invoice_state'],})
25+ default_data = {'name':'%s-return' % pick.name,
26+ 'move_lines':[], 'state':'draft', 'type':new_type,
27+ 'date':date_cur, 'invoice_state':data['invoice_state'],}
28+ default_data = self._hook_default_return_data(cr, uid, pick.id, context={}, default_value=default_data)
29+ new_picking = pick_obj.copy(cr, uid, pick.id, default_data,)
30 new_location=move.location_dest_id.id
31 if move.state=='done':
32 new_qty = data['return%s' % move.id]

Subscribers

People subscribed via source and target branches

to all changes: