diff --git a/stock_multi_store/__manifest__.py b/stock_multi_store/__manifest__.py new file mode 100644 index 00000000..9c9d0da1 --- /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 00000000..2eefc223 --- /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 00000000..3b7a5cd0 --- /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