[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
This commit is contained in:
Goffin Simon 2016-11-30 16:39:57 +01:00
parent aac0faafb8
commit a433ae65cb
1 changed files with 0 additions and 4 deletions

View File

@ -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