From 54d43bc20da2977db17642d2facfd2d02958a063 Mon Sep 17 00:00:00 2001 From: Andhitia Rama Date: Thu, 20 Jun 2024 15:39:55 +0700 Subject: [PATCH] [UPD] ssi_stock * Menamambahkan info manager, supervisor dan user untuk gudang --- ssi_stock/__manifest__.py | 1 + ssi_stock/models/__init__.py | 1 + ssi_stock/models/stock_warehouse.py | 30 +++++++++++++++++++++++ ssi_stock/views/stock_warehouse_views.xml | 22 +++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 ssi_stock/models/stock_warehouse.py create mode 100644 ssi_stock/views/stock_warehouse_views.xml diff --git a/ssi_stock/__manifest__.py b/ssi_stock/__manifest__.py index 7f79e78..16f4126 100644 --- a/ssi_stock/__manifest__.py +++ b/ssi_stock/__manifest__.py @@ -34,6 +34,7 @@ "views/stock_move_views.xml", "views/stock_quant_views.xml", "views/stock_picking_views.xml", + "views/stock_warehouse_views.xml", "views/location_type_views.xml", "views/product_category_views.xml", "views/stock_location_views.xml", diff --git a/ssi_stock/models/__init__.py b/ssi_stock/models/__init__.py index 6af26cf..c7a77d4 100644 --- a/ssi_stock/models/__init__.py +++ b/ssi_stock/models/__init__.py @@ -9,6 +9,7 @@ stock_picking, stock_picking_type, location_type, + stock_warehouse, stock_location, stock_move, stock_move_line, diff --git a/ssi_stock/models/stock_warehouse.py b/ssi_stock/models/stock_warehouse.py new file mode 100644 index 0000000..73f1954 --- /dev/null +++ b/ssi_stock/models/stock_warehouse.py @@ -0,0 +1,30 @@ +# 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"] + + manager_id = fields.Many2one( + string="Manager", + comodel_name="res.users", + ) + supervisor_ids = fields.Many2many( + string="Supervisors", + comodel_name="res.users", + relation="rel_stock_warehouse_supervisor", + column1="warehouse_id", + column2="user_id", + ) + user_ids = fields.Many2many( + string="Users", + comodel_name="res.users", + relation="rel_stock_warehouse_user", + column1="warehouse_id", + column2="user_id", + ) diff --git a/ssi_stock/views/stock_warehouse_views.xml b/ssi_stock/views/stock_warehouse_views.xml new file mode 100644 index 0000000..d3d6f9d --- /dev/null +++ b/ssi_stock/views/stock_warehouse_views.xml @@ -0,0 +1,22 @@ + + + + + stock.warehouse - form + stock.warehouse + + + + + + + + + + + + + +