Merge lp:~syleam/wms/5.0-christophe-chauvet into lp:wms

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 228
Proposed branch: lp:~syleam/wms/5.0-christophe-chauvet
Merge into: lp:wms
Diff against target: 20 lines (+10/-0)
1 file modified
wms/object/picking.py (+10/-0)
To merge this branch: bzr merge lp:~syleam/wms/5.0-christophe-chauvet
Reviewer Review Type Date Requested Status
Christophe CHAUVET Approve
Review via email: mp+60581@code.launchpad.net

Description of the change

Copy the transporter from picking out to delivery

To post a comment you must log in.
228. By Christophe CHAUVET

merge from lp:~syleam/wms/5.0-christophe-chauvet

Revision history for this message
Christophe CHAUVET (christophe-chauvet) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wms/object/picking.py'
2--- wms/object/picking.py 2011-03-22 14:12:31 +0000
3+++ wms/object/picking.py 2011-05-11 06:11:08 +0000
4@@ -121,6 +121,16 @@
5 location_id = addr.partner_id.round_id.default_location_id.id
6 values['round_id'] = addr.partner_id.round_id.id
7
8+ # Check if picking is create from picking out
9+ # and retrieve the transporter_id
10+ if values.get('type', '') == 'delivery' and values.get('name'):
11+ p_ids = self.search(cr, uid, [('type','=','out'),('name','=', values['name'])], context=context)
12+ if p_ids and len(p_ids) == 1:
13+ transp = self.read(cr, uid, p_ids[0], ['transporter_id','transporter_weight'], context=context)
14+ if transp:
15+ values['transporter_id'] = transp.get('transporter_id') and transp['transporter_id'] or False
16+ values['transporter_weight'] = transp.get('transporter_weight', 0.0)
17+
18 return super(StockPicking, self).create(cr, uid, values, context=context)
19
20 def action_confirm(self, cr, uid, ids, context=None):

Subscribers

People subscribed via source and target branches