From a433ae65cb2c31a278980588c865d4f351612878 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 30 Nov 2016 16:39:57 +0100 Subject: [PATCH] [FIX] purchase: default picking_type_id with ir.values The deleted code put the same picking_type_id for all companies. The function _get_picking_in returns the right default picking_type_id according to the company. Steps to reproduce: -stock.warehouse0 is on company A. -Define another company B with its own warehouse. -Update the purchase module -> a new default value for picking_type_id on purchase order for company B is created wtih the value of company A -Create a purchase order on company B, Odoo tries to get the picking_type_id from company A. If user doesn't have any rights on company A, it occurs a security warning. Otherwise the purchase order is linked to a picking operation of another company. opw:694059 --- addons/purchase/purchase_data.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/addons/purchase/purchase_data.yml b/addons/purchase/purchase_data.yml index 92a88bc0c09..1133dfc3f37 100644 --- a/addons/purchase/purchase_data.yml +++ b/addons/purchase/purchase_data.yml @@ -1,7 +1,3 @@ -- - !python {model: ir.values}: | - whr = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock.warehouse0'), context=context) - self.set_default(cr, uid, 'purchase.order', 'picking_type_id', whr.in_type_id.id, for_all_users=True, company_id=True, condition=False) - !python {model: stock.warehouse}: | #enable purchase on main warehouse