← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin into lp:ocb-addons

 

Lionel Sausin - Numérigraphe has proposed merging lp:~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin into lp:ocb-addons.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1098557 in OpenERP Community Backports (Addons): "Can't set a default origin for stock pickings when duplicating from Python code"
  https://bugs.launchpad.net/ocb-addons/+bug/1098557

For more details, see:
https://code.launchpad.net/~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin/+merge/210559

I propose to make it possible for custom code to set a default value for the field "origin" when copying a stock picking.
Lionel Sausin.
-- 
https://code.launchpad.net/~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin/+merge/210559
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~numerigraphe-team/ocb-addons/7.0-picking-custom-default-origin into lp:ocb-addons.
=== modified file 'stock/stock.py'
--- stock/stock.py	2014-03-04 13:08:40 +0000
+++ stock/stock.py	2014-03-12 09:18:23 +0000
@@ -722,8 +722,9 @@
         if ('name' not in default) or (picking_obj.name == '/'):
             seq_obj_name = 'stock.picking.' + picking_obj.type
             default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
+            default['backorder_id'] = False
+        if 'origin' not in default:
             default['origin'] = ''
-            default['backorder_id'] = False
         if 'invoice_state' not in default and picking_obj.invoice_state == 'invoiced':
             default['invoice_state'] = '2binvoiced'
         res = super(stock_picking, self).copy(cr, uid, id, default, context)


Follow ups