Skip to content

Commit

Permalink
[mrp_planned_order_matrix][mig] migrate to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow authored and JasminSForgeFlow committed Dec 23, 2024
1 parent 5dfa3e8 commit b417dd3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
9 changes: 6 additions & 3 deletions mrp_planned_order_matrix/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
4 changes: 4 additions & 0 deletions mrp_planned_order_matrix/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions mrp_planned_order_matrix/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import test_mrp_planned_order_matrix
10 changes: 7 additions & 3 deletions mrp_planned_order_matrix/tests/test_mrp_planned_order_matrix.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -54,7 +54,9 @@ def test_01_mrp_planned_order_matrix(self):
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),
Expand Down Expand Up @@ -92,7 +94,9 @@ def test_01_mrp_planned_order_matrix(self):
"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)]
Expand Down
15 changes: 11 additions & 4 deletions mrp_planned_order_matrix/wizards/mrp_planned_order_wizard.py
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import timedelta
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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")

0 comments on commit b417dd3

Please sign in to comment.