diff --git a/mrp_planned_order_matrix/__manifest__.py b/mrp_planned_order_matrix/__manifest__.py index 82bc244ae..47cfbc905 100644 --- a/mrp_planned_order_matrix/__manifest__.py +++ b/mrp_planned_order_matrix/__manifest__.py @@ -1,14 +1,17 @@ -# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2019-21 ForgeFlow S.L. (https://www.forgeflow.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "MRP Planned Order Matrix", "summary": "Allows to create fixed planned orders on a grid view.", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/manufacture", "category": "Warehouse Management", "depends": ["mrp_multi_level", "web_widget_x2many_2d_matrix", "date_range"], - "data": ["wizards/mrp_planned_order_wizard_view.xml"], + "data": [ + "security/ir.model.access.csv", + "wizards/mrp_planned_order_wizard_view.xml", + ], "license": "AGPL-3", "installable": True, } diff --git a/mrp_planned_order_matrix/security/ir.model.access.csv b/mrp_planned_order_matrix/security/ir.model.access.csv new file mode 100644 index 000000000..552213fd7 --- /dev/null +++ b/mrp_planned_order_matrix/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mrp_planned_order_wizard,mrp.planned.order.wizard user,model_mrp_planned_order_wizard,mrp.group_mrp_user,1,1,1,1 +access_mrp_planned_order_sheet,mrp.planned.order.sheet user,model_mrp_planned_order_sheet,mrp.group_mrp_user,1,1,1,1 +access_mrp_planned_order_sheet_line,mrp.planned.order.sheet.line user,model_mrp_planned_order_sheet_line,mrp.group_mrp_user,1,1,1,1 diff --git a/mrp_planned_order_matrix/tests/__init__.py b/mrp_planned_order_matrix/tests/__init__.py index 97e377707..30b4f45b7 100644 --- a/mrp_planned_order_matrix/tests/__init__.py +++ b/mrp_planned_order_matrix/tests/__init__.py @@ -1,3 +1 @@ -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - from . import test_mrp_planned_order_matrix diff --git a/mrp_planned_order_matrix/tests/test_mrp_planned_order_matrix.py b/mrp_planned_order_matrix/tests/test_mrp_planned_order_matrix.py index c583edca2..0d6121e2a 100644 --- a/mrp_planned_order_matrix/tests/test_mrp_planned_order_matrix.py +++ b/mrp_planned_order_matrix/tests/test_mrp_planned_order_matrix.py @@ -1,4 +1,4 @@ -# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2020-21 ForgeFlow S.L. (https://www.forgeflow.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from dateutil.rrule import MONTHLY @@ -54,7 +54,9 @@ class TestMrpPlannedOrderMatrix(TestMrpMultiLevelCommon): sheets = self.env["mrp.planned.order.sheet"].search([]) for sheet in sheets: self.assertEqual( - len(sheet.line_ids), 12, "There should be 12 lines.", + len(sheet.line_ids), + 12, + "There should be 12 lines.", ) self.assertEqual( fields.Date.to_string(sheet.date_start), @@ -92,7 +94,9 @@ class TestMrpPlannedOrderMatrix(TestMrpMultiLevelCommon): "The product does not match in the estimate", ) self.assertEqual( - planned_order.product_qty, 1, "The product qty does not match", + planned_order.product_qty, + 1, + "The product qty does not match", ) mrp_planned_orders = self.env["mrp.planned.order"].search( [("product_mrp_area_id", "=", self.product_mrp_area_1.id)] diff --git a/mrp_planned_order_matrix/wizards/mrp_planned_order_wizard.py b/mrp_planned_order_matrix/wizards/mrp_planned_order_wizard.py index 7f4b5b37e..196b2da59 100644 --- a/mrp_planned_order_matrix/wizards/mrp_planned_order_wizard.py +++ b/mrp_planned_order_matrix/wizards/mrp_planned_order_wizard.py @@ -1,4 +1,4 @@ -# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2020-21 ForgeFlow S.L. (https://www.forgeflow.com) # - Jordi Ballester Alomar # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from datetime import timedelta @@ -17,7 +17,9 @@ class MrpPlannedOrderWizard(models.TransientModel): date_start = fields.Date(string="Date From", required=True) date_end = fields.Date(string="Date To", required=True) date_range_type_id = fields.Many2one( - string="Date Range Type", comodel_name="date.range.type", required=True, + string="Date Range Type", + comodel_name="date.range.type", + required=True, ) product_mrp_area_ids = fields.Many2many( string="Product Parameters", comodel_name="product.mrp.area", required=True @@ -67,7 +69,9 @@ class MprPlannedOrderSheet(models.TransientModel): date_start = fields.Date(string="Date From", readonly=True) date_end = fields.Date(string="Date to", readonly=True) date_range_type_id = fields.Many2one( - string="Date Range Type", comodel_name="date.range.type", readonly=True, + string="Date Range Type", + comodel_name="date.range.type", + readonly=True, ) product_mrp_area_ids = fields.Many2many( string="Product Parameters", comodel_name="product.mrp.area" @@ -218,7 +222,10 @@ class MprPlannedOrderSheetLine(models.TransientModel): product_mrp_area_id = fields.Many2one( string="Product Parameters", comodel_name="product.mrp.area" ) - date_range_id = fields.Many2one(comodel_name="date.range", string="Date Range",) + date_range_id = fields.Many2one( + comodel_name="date.range", + string="Date Range", + ) value_x = fields.Char(string="Period") value_y = fields.Char(string="Product") product_qty = fields.Float(string="Quantity", digits="Product UoM")