Skip to content
Snippets Groups Projects
Commit 4ad64719 authored by Mihran Thalhath's avatar Mihran Thalhath
Browse files

[FIX] purchase_requisition_stock: use superuser to check active status


PR #85474 introduced a bug where in users are not able to create purchase
requisition in a multi company setup.

closes odoo/odoo#86362

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 26ff56d9
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ class PurchaseRequisition(models.Model):
def _get_picking_in(self):
pick_in = self.env.ref('stock.picking_type_in', raise_if_not_found=False)
company = self.env.company
if not pick_in or not pick_in.active or pick_in.sudo().warehouse_id.company_id.id != company.id:
if not pick_in or not pick_in.sudo().active or pick_in.sudo().warehouse_id.company_id.id != company.id:
pick_in = self.env['stock.picking.type'].search(
[('warehouse_id.company_id', '=', company.id), ('code', '=', 'incoming')],
limit=1,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment