Merge lp:~daniel-watkins-credativ/openobject-addons/686517 into lp:openobject-addons/5.0

Proposed by Daniel Watkins (credativ) on 2010-12-10
Status: Needs review
Proposed branch: lp:~daniel-watkins-credativ/openobject-addons/686517
Merge into: lp:openobject-addons/5.0
Diff against target: 54 lines (+25/-8)
1 file modified
stock/wizard/wizard_return.py (+25/-8)
To merge this branch: bzr merge lp:~daniel-watkins-credativ/openobject-addons/686517
Reviewer Review Type Date Requested Status
OpenERP Core Team 2010-12-10 Pending
Review via email: mp+43350@code.launchpad.net

Description of the Change

This adds an option to the Return Packing wizard which allows the return location to be specified.

To post a comment you must log in.

What is the status of this review?
Did this miss the merge window for 5.0 and now 6.0?
Is this fixed in trunk?

I have inherited this code and can work on it.

Unmerged revisions

2882. By Dan Watkins on 2010-12-07

[FIX] stock: Add ability to choose returns location in wizard.wizard_return.

2881. By Dan Watkins on 2010-12-07

[FIX] stock: Code cleanup in wizard.wizard_return.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/wizard/wizard_return.py'
2--- stock/wizard/wizard_return.py 2010-12-07 16:31:36 +0000
3+++ stock/wizard/wizard_return.py 2010-12-10 13:26:37 +0000
4@@ -57,6 +57,13 @@
5 else:
6 new_invoice_state=pick.invoice_state
7 fields['invoice_state']={'string':_('Invoice state'), 'type':'selection', 'default':make_default(new_invoice_state), 'required':True, 'selection':[('2binvoiced', _('to be invoiced')), ('none', _('None'))]}
8+ arch_lst.append('<field name="return_location"/>\n<newline/>')
9+ fields['return_location'] = {
10+ 'string': _('Returns Location'),
11+ 'type': 'many2one',
12+ 'relation': 'stock.location',
13+ 'required': True,
14+ }
15 arch_lst.append('</form>')
16 arch.string='\n'.join(arch_lst)
17 return res
18@@ -82,18 +89,28 @@
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['form']['invoice_state'],})
25+ new_picking = pick_obj.copy(cr, uid, pick.id, {
26+ 'name': '%s (return)' % pick.name,
27+ 'move_lines': [],
28+ 'state': 'draft',
29+ 'type': new_type,
30+ 'date': date_cur,
31+ 'invoice_state': data['form']['invoice_state'],
32+ })
33 new_location = move.location_dest_id.id
34
35 new_move = move_obj.copy(cr, uid, move.id, {
36 'product_qty': move_qty,
37- 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
38- move_qty, move.product_uos.id),
39- 'picking_id':new_picking, 'state':'draft',
40- 'location_id':new_location, 'location_dest_id':move.location_id.id,
41- 'date':date_cur, 'date_planned':date_cur,})
42+ 'product_uos_qty': uom_obj._compute_qty(
43+ cr, uid, move.product_uom.id, move_qty,
44+ move.product_uos.id),
45+ 'picking_id': new_picking,
46+ 'state': 'draft',
47+ 'location_id': new_location,
48+ 'location_dest_id': data['form']['return_location'],
49+ 'date': date_cur,
50+ 'date_planned': date_cur,
51+ })
52 if new_picking:
53 wf_service = netsvc.LocalService("workflow")
54 if new_picking: