From 6ea4587fadd9cae94655b629e9f4b62e767304a2 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 4 May 2012 17:00:52 +0200 Subject: [PATCH] [FIX] stock: do not store field product_id on pickings, as storing its value loses search results (m2m vs m2o) bzr revid: rco@openerp.com-20120504150052-ecatdwfuysdpsmbt --- addons/stock/product_view.xml | 5 ++--- addons/stock/stock.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 57f0fd89667..706e7bf867f 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -132,7 +132,7 @@ view_mode="tree,form,calendar" res_model="stock.picking" src_model="product.product" - context="{'search_default_product_id': [active_id], 'default_product_id': active_id}" + context="{'search_default_product_id': [active_id]}" domain="[('type','=','in')]" /> @@ -142,10 +142,9 @@ view_mode="tree,form,calendar" res_model="stock.picking" src_model="product.product" - context="{'search_default_product_id': [active_id], 'default_product_id': active_id}" + context="{'search_default_product_id': [active_id]}" domain="[('type', '=', 'out')]" /> - Product Kanban diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d0f78bef9bd..0bafe03e843 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -648,7 +648,7 @@ class stock_picking(osv.osv): 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}), - 'product_id': fields.related('move_lines','product_id', type='many2one', relation='product.product', string='Product',store=True), + 'product_id': fields.related('move_lines', 'product_id', type='many2one', relation='product.product', string='Product'), 'auto_picking': fields.boolean('Auto-Picking', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'partner_id': fields.many2one('res.partner', 'Partner', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'invoice_state': fields.selection([