Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions stock_multi_store/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"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
25 changes: 25 additions & 0 deletions stock_multi_store/migrations/18.0.1.4.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -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,),
)
33 changes: 33 additions & 0 deletions stock_multi_store/security/multi_store_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<<<<<<< HEAD
||||||| MERGE BASE
=======
<?xml version="1.0"?>
<odoo noupdate="1">

<record id="stock_warehouse_store_rule" model="ir.rule">
<field name="name">Warehouse multi-store</field>
<field name="model_id" ref="stock.model_stock_warehouse"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('store_id','=',False),('store_id','child_of',user.store_ids.ids)]</field>
<!-- para reglas entre warehouse necesitamos que los pueda ver -->
<field name="perm_read" eval="False"/>
</record>

<record id="stock_picking_type_store_rule" model="ir.rule">
<field name="name">Stock Picking Type multi-store</field>
<field name="model_id" ref="stock.model_stock_picking_type"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('warehouse_id.store_id','=',False),('warehouse_id.store_id','child_of',user.store_ids.ids)]</field>
<field name="perm_read" eval="False"/>
</record>

<record id="stock_picking_store_rule" model="ir.rule">
<field name="name">Stock Picking multi-store</field>
<field name="model_id" ref="stock.model_stock_picking"/>
<field name="global" eval="True"/>
<field name="perm_read" eval="False"/>
<field name="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)]</field>
</record>
</odoo>

>>>>>>> FORWARD PORTED
Loading