From c84e8fe24bffb47eeae5bbc9fa0c4bd111397d0b Mon Sep 17 00:00:00 2001 From: keylor2906 Date: Mon, 15 Apr 2024 09:28:19 -0600 Subject: [PATCH] [FIX] default_warehouse_from_sale_team: Fix case of searching a stock rule when there is no warehouse parameter, like when is done by stock rules when the move destination location is for a different company https://github.com/Vauxoo/odoo/blob/8af8846c88bd04bcf3fa0bcbe4a720b415f994a4/addons/stock/models/stock_move.py#L830 --- default_warehouse_from_sale_team/__manifest__.py | 2 +- default_warehouse_from_sale_team/models/procurement_group.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default_warehouse_from_sale_team/__manifest__.py b/default_warehouse_from_sale_team/__manifest__.py index 86d7fc25ac6..c704a362914 100644 --- a/default_warehouse_from_sale_team/__manifest__.py +++ b/default_warehouse_from_sale_team/__manifest__.py @@ -8,7 +8,7 @@ "website": "http://www.vauxoo.com", "license": "LGPL-3", "category": "Inventory/Inventory", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "depends": [ "sale_stock", "purchase_requisition", diff --git a/default_warehouse_from_sale_team/models/procurement_group.py b/default_warehouse_from_sale_team/models/procurement_group.py index 56f84da43b5..731c029fa1b 100644 --- a/default_warehouse_from_sale_team/models/procurement_group.py +++ b/default_warehouse_from_sale_team/models/procurement_group.py @@ -7,6 +7,6 @@ class ProcurementGroup(models.Model): @api.model def _search_rule(self, route_ids, packaging_id, product_id, warehouse_id, domain): """Grant access to provided warehouse if it's not allowed to the current user""" - if warehouse_id._access_unallowed_current_user_salesteams(): + if warehouse_id and warehouse_id._access_unallowed_current_user_salesteams(): warehouse_id = warehouse_id.sudo() return super()._search_rule(route_ids, packaging_id, product_id, warehouse_id, domain)