← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-759695-mtr into lp:openobject-addons

 

Meera Trambadia (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-759695-mtr into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #759695 in OpenERP Addons: "'delivery order only' creates two picking lists"
  https://bugs.launchpad.net/openobject-addons/+bug/759695

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-759695-mtr/+merge/57832

=>sale: improved execute method of config wizard when there is one step picking" --fixes lp:759695 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-759695-mtr/+merge/57832
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-759695-mtr.
=== modified file 'sale/sale.py'
--- sale/sale.py	2011-02-22 09:27:33 +0000
+++ sale/sale.py	2011-04-15 09:39:30 +0000
@@ -710,7 +710,7 @@
                         'note': line.notes,
                         'company_id': order.company_id.id,
                     })
-
+                    
                 if line.product_id:
                     proc_id = self.pool.get('procurement.order').create(cr, uid, {
                         'name': line.name,
@@ -1202,15 +1202,18 @@
     }
 
     def execute(self, cr, uid, ids, context=None):
+        ir_values_obj = self.pool.get('ir.values')
+        ir_model_data_obj = self.pool.get('ir.model.data')
+        stock_location_obj = self.pool.get('stock.location')
+        location_id = ir_model_data_obj.get_object_reference(cr, uid, 'stock', 'stock_location_output')
+        location_id = location_id and location_id[1] or False
         for o in self.browse(cr, uid, ids, context=context):
-            ir_values_obj = self.pool.get('ir.values')
             ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], o.picking_policy)
             ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], o.order_policy)
+            if o.step == 'one':
+                stock_location_obj.write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
             if o.step == 'two':
-                md = self.pool.get('ir.model.data')
-                location_id = md.get_object_reference(cr, uid, 'stock', 'stock_location_output')
-                location_id = location_id and location_id[1] or False
-                self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'manual'})
+                stock_location_obj.write(cr, uid, [location_id], {'chained_auto_packing': 'manual'})
 
 sale_config_picking_policy()
 


Follow ups