diff --git a/ssi_purchase_stock/README.rst b/ssi_purchase_stock/README.rst new file mode 100644 index 0000000..b9cbee8 --- /dev/null +++ b/ssi_purchase_stock/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +================================ +Purchase + Inventory Integration +================================ + + +Installation +============ + +To install this module, you need to: + +1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-purchase +2. Add the path to this repository in your configuration (addons-path) +3. Update the module list +4. Go to menu *Apps -> Apps -> Main Apps* +5. Search For *Purchase + Inventory Integration* +6. Install the module + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed +and welcomed feedback. + + +Credits +======= + +Contributors +------------ + +* Michael Viriyananda + +Maintainer +---------- + +.. image:: https://simetri-sinergi.id/logo.png + :alt: PT. Simetri Sinergi Indonesia + :target: https://simetri-sinergi.id.com + +This module is maintained by the PT. Simetri Sinergi Indonesia. diff --git a/ssi_purchase_stock/__init__.py b/ssi_purchase_stock/__init__.py new file mode 100644 index 0000000..62140aa --- /dev/null +++ b/ssi_purchase_stock/__init__.py @@ -0,0 +1,7 @@ +# Copyright 2023 OpenSynergy Indonesia +# Copyright 2023 PT. Simetri Sinergi Indonesia +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from . import ( + models, +) diff --git a/ssi_purchase_stock/__manifest__.py b/ssi_purchase_stock/__manifest__.py new file mode 100644 index 0000000..92fa47e --- /dev/null +++ b/ssi_purchase_stock/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2023 OpenSynergy Indonesia +# Copyright 2023 PT. Simetri Sinergi Indonesia +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). +{ + "name": "Purchase + Inventory Integration", + "version": "14.0.1.0.0", + "website": "https://simetri-sinergi.id", + "author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia", + "license": "LGPL-3", + "installable": True, + "application": True, + "depends": [ + "purchase", + "stock", + ], + "data": [ + "security/res_group_data.xml", + "security/ir_rule_data.xml", + "views/stock_warehouse_views.xml", + ], + "demo": [], +} diff --git a/ssi_purchase_stock/models/__init__.py b/ssi_purchase_stock/models/__init__.py new file mode 100644 index 0000000..b6c25f1 --- /dev/null +++ b/ssi_purchase_stock/models/__init__.py @@ -0,0 +1,8 @@ +# Copyright 2023 OpenSynergy Indonesia +# Copyright 2023 PT. Simetri Sinergi Indonesia +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from . import ( + stock_warehouse, + res_users, +) diff --git a/ssi_purchase_stock/models/res_users.py b/ssi_purchase_stock/models/res_users.py new file mode 100644 index 0000000..9fd4133 --- /dev/null +++ b/ssi_purchase_stock/models/res_users.py @@ -0,0 +1,19 @@ +# Copyright 2023 OpenSynergy Indonesia +# Copyright 2023 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import fields, models + + +class ResUsers(models.Model): + _name = "res.users" + _inherit = ["res.users"] + + warehouse_purchase_ids = fields.Many2many( + string="Purchase Users", + comodel_name="stock.warehouse", + relation="rel_warehouse_2_purchase_user", + column2="warehouse_id", + column1="user_id", + ) diff --git a/ssi_purchase_stock/models/stock_warehouse.py b/ssi_purchase_stock/models/stock_warehouse.py new file mode 100644 index 0000000..a899bd7 --- /dev/null +++ b/ssi_purchase_stock/models/stock_warehouse.py @@ -0,0 +1,19 @@ +# Copyright 2023 OpenSynergy Indonesia +# Copyright 2023 PT. Simetri Sinergi Indonesia +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import fields, models + + +class StockWarehouse(models.Model): + _name = "stock.warehouse" + _inherit = ["stock.warehouse"] + + purchase_user_ids = fields.Many2many( + string="Purchase Users", + comodel_name="res.users", + relation="rel_warehouse_2_purchase_user", + column1="warehouse_id", + column2="user_id", + ) diff --git a/ssi_purchase_stock/security/ir_rule_data.xml b/ssi_purchase_stock/security/ir_rule_data.xml new file mode 100644 index 0000000..8d2c65a --- /dev/null +++ b/ssi_purchase_stock/security/ir_rule_data.xml @@ -0,0 +1,20 @@ + + + + + + Purchase Order - Warehouse + + + [('picking_type_id.warehouse_id.id','=',user.warehouse_purchase_ids.ids)] + + + + + + + diff --git a/ssi_purchase_stock/security/res_group_data.xml b/ssi_purchase_stock/security/res_group_data.xml new file mode 100644 index 0000000..ea6f054 --- /dev/null +++ b/ssi_purchase_stock/security/res_group_data.xml @@ -0,0 +1,25 @@ + + + + + + + + Warehouse + + + + + Company + + + + diff --git a/ssi_purchase_stock/static/description/icon.png b/ssi_purchase_stock/static/description/icon.png new file mode 100644 index 0000000..4c8e112 Binary files /dev/null and b/ssi_purchase_stock/static/description/icon.png differ diff --git a/ssi_purchase_stock/views/stock_warehouse_views.xml b/ssi_purchase_stock/views/stock_warehouse_views.xml new file mode 100644 index 0000000..4aec048 --- /dev/null +++ b/ssi_purchase_stock/views/stock_warehouse_views.xml @@ -0,0 +1,27 @@ + + + + + stock.warehouse - form + stock.warehouse + + + + + + + + + + + + + + + +