Skip to content

Commit

Permalink
[FIX] default_warehouse_from_sale_team: Fix case of searching a stock…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
keylor2906 authored and Jose Suniaga [Vauxoo] committed Apr 15, 2024
1 parent b8fcca0 commit c84e8fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion default_warehouse_from_sale_team/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c84e8fe

Please sign in to comment.