From f2610ee95194e7896913ae95ebb78a3bf7878cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roc=C3=ADo=20Vega?= Date: Fri, 27 Feb 2026 15:16:03 +0000 Subject: [PATCH] [FIX] stock_multi_store: Fix record rule for stock picking type that not have warehouse defined X-original-commit: 1fe5333f5624c593c55697e4d3f9de3115775fbe --- stock_multi_store/__manifest__.py | 53 +++++++++++++++++++ .../migrations/18.0.1.4.1/pre-migration.py | 25 +++++++++ .../security/multi_store_security.xml | 33 ++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 stock_multi_store/__manifest__.py create mode 100644 stock_multi_store/migrations/18.0.1.4.1/pre-migration.py create mode 100644 stock_multi_store/security/multi_store_security.xml diff --git a/stock_multi_store/__manifest__.py b/stock_multi_store/__manifest__.py new file mode 100644 index 0000000..9c9d0da --- /dev/null +++ b/stock_multi_store/__manifest__.py @@ -0,0 +1,53 @@ +<<<<<<< HEAD +||||||| MERGE BASE +======= +############################################################################## +# +# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) +# All Rights Reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Multi Store for Warehouse", + "version": "18.0.1.4.1", + "category": "Accounting", + "sequence": 14, + "summary": "", + "author": "ADHOC SA", + "website": "www.adhoc.com.ar", + "license": "AGPL-3", + "images": [], + "depends": [ + "stock", + "base_multi_store", + ], + "data": [ + "views/stock_picking_type_view.xml", + "views/stock_picking_view.xml", + "views/stock_warehouse_view.xml", + "views/res_store_view.xml", + "security/multi_store_security.xml", + ], + "demo": [ + "demo/stock_demo.xml", + ], + "test": [], + "installable": True, + "auto_install": True, + "application": False, +} + +>>>>>>> FORWARD PORTED diff --git a/stock_multi_store/migrations/18.0.1.4.1/pre-migration.py b/stock_multi_store/migrations/18.0.1.4.1/pre-migration.py new file mode 100644 index 0000000..2eefc22 --- /dev/null +++ b/stock_multi_store/migrations/18.0.1.4.1/pre-migration.py @@ -0,0 +1,25 @@ +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + domain_force = ( + "['|', ('picking_type_id.code', '=', 'dropship'), " + "'|', ('picking_type_id.warehouse_id', '=', False), " + "'|', ('picking_type_id.warehouse_id.store_id', '=', False), " + "('picking_type_id.warehouse_id.store_id', 'child_of', " + "user.store_ids.ids)]" + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_rule rule + SET domain_force = %s + FROM ir_model_data data + WHERE data.model = 'ir.rule' + AND data.module = 'stock_multi_store' + AND data.name = 'stock_picking_store_rule' + AND data.res_id = rule.id + """, + (domain_force,), + ) diff --git a/stock_multi_store/security/multi_store_security.xml b/stock_multi_store/security/multi_store_security.xml new file mode 100644 index 0000000..3b7a5cd --- /dev/null +++ b/stock_multi_store/security/multi_store_security.xml @@ -0,0 +1,33 @@ +<<<<<<< HEAD +||||||| MERGE BASE +======= + + + + + Warehouse multi-store + + + ['|',('store_id','=',False),('store_id','child_of',user.store_ids.ids)] + + + + + + Stock Picking Type multi-store + + + ['|',('warehouse_id.store_id','=',False),('warehouse_id.store_id','child_of',user.store_ids.ids)] + + + + + Stock Picking multi-store + + + + ['|', ('picking_type_id.code', '=', 'dropship'), '|', ('picking_type_id.warehouse_id', '=', False), '|', ('picking_type_id.warehouse_id.store_id', '=', False), ('picking_type_id.warehouse_id.store_id', 'child_of', user.store_ids.ids)] + + + +>>>>>>> FORWARD PORTED