Skip to content

Commit

Permalink
[MIG] maintenance_request_repair: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Jun 28, 2024
1 parent cde6696 commit 7c9e5c4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
4 changes: 4 additions & 0 deletions maintenance_request_repair/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ Contributors
- Marcel Savegnago <marcel.savegnago@escodoo.com.br>
- Kaynnan Lemes <kaynnan.lemes@escodoo.com.br>

- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion maintenance_request_repair/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Maintenance Request Repair",
"summary": """
This is a bridge module between Maintenance and Repair""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"category": "Maintenance",
"author": "Escodoo,Odoo Community Association (OCA)",
Expand Down
2 changes: 2 additions & 0 deletions maintenance_request_repair/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- [Escodoo](https://www.escodoo.com.br):
- Marcel Savegnago \<<marcel.savegnago@escodoo.com.br>\>
- Kaynnan Lemes \<<kaynnan.lemes@escodoo.com.br>\>
- [APSL-Nagarro](<https://apsl.tech>):
- Antoni Marroig \<<amarroig@apsl.net>\>
4 changes: 4 additions & 0 deletions maintenance_request_repair/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Kaynnan Lemes &lt;<a class="reference external" href="mailto:kaynnan.lemes&#64;escodoo.com.br">kaynnan.lemes&#64;escodoo.com.br</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
51 changes: 30 additions & 21 deletions maintenance_request_repair/tests/test_repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,53 @@


class TestRepairOrder(common.TransactionCase):
def setUp(self):
super().setUp()
@classmethod
def setUpClass(cls):
super().setUpClass()

self.product = self.env["product.product"].create(
cls.product = cls.env["product.product"].create(
{
"name": "Product Test",
"uom_id": self.env.ref("uom.product_uom_unit").id,
"uom_po_id": self.env.ref("uom.product_uom_unit").id,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
"uom_po_id": cls.env.ref("uom.product_uom_unit").id,
}
)

self.location_id = self.env["stock.location"].create(
cls.location_id = cls.env["stock.location"].create(
{
"name": "Test Location",
"usage": "internal",
"location_id": self.env.ref("stock.stock_location_stock").id,
"location_id": cls.env.ref("stock.stock_location_stock").id,
}
)

self.repair_order = self.env["repair.order"].create(
cls.repair_order = cls.env["repair.order"].create(
{
"name": "Test Repair Order",
"product_id": self.product.id,
"product_uom": self.product.uom_id.id,
"location_id": self.location_id.id,
"product_id": cls.product.id,
"product_uom": cls.product.uom_id.id,
"location_id": cls.location_id.id,
"picking_type_id": cls.env.ref(
"repair.picking_type_warehouse0_repair"
).id,
}
)

self.request1 = self.env["maintenance.request"].create(
cls.request1 = cls.env["maintenance.request"].create(
{
"name": "Request 1",
"repair_order_id": self.repair_order.id,
"repair_order_id": cls.repair_order.id,
}
)
self.request2 = self.env["maintenance.request"].create(
cls.request2 = cls.env["maintenance.request"].create(
{
"name": "Request 2",
"repair_order_id": self.repair_order.id,
"repair_order_id": cls.repair_order.id,
}
)

self.equipment = self.env["maintenance.equipment"].create(
{"name": "Equipment 1"}
)
self.partner = self.env["res.partner"].create({"name": "Test Partner"})
cls.equipment = cls.env["maintenance.equipment"].create({"name": "Equipment 1"})
cls.partner = cls.env["res.partner"].create({"name": "Test Partner"})

def test_compute_maintenance_request_count(self):
self.repair_order.write(
Expand Down Expand Up @@ -138,6 +140,9 @@ def test_create_repair_order(self):
{
"partner_id": self.partner.id,
"product_id": self.product.id,
"picking_type_id": self.env.ref(
"repair.picking_type_warehouse0_repair"
).id,
}
)
self.repair_order.name = "Repair Order Test 2"
Expand All @@ -151,6 +156,9 @@ def test_simple_view_maintenance_request(self):
"name": "Repair Order Test",
"partner_id": self.partner.id,
"product_id": self.product.id,
"picking_type_id": self.env.ref(
"repair.picking_type_warehouse0_repair"
).id,
}
)
self.maintenance_request = self.env["maintenance.request"].create(
Expand All @@ -163,7 +171,7 @@ def test_simple_view_maintenance_request(self):
self.assertEqual(self.action["type"], "ir.actions.act_window")
self.assertEqual(self.action["res_model"], "maintenance.request")
self.assertEqual(
self.action["view_mode"], "kanban,tree,form,pivot,graph,calendar"
self.action["view_mode"], "kanban,tree,form,pivot,graph,calendar,activity"
)
self.assertEqual(self.action["target"], "current")
self.assertEqual(self.action["res_id"], self.maintenance_request.id)
Expand All @@ -190,4 +198,5 @@ def test_clear_maintenance_request(self):
self.assertEqual(self.action["views"][3][1], "pivot")
self.assertEqual(self.action["views"][4][1], "graph")
self.assertEqual(self.action["views"][5][1], "calendar")
self.assertEqual(len(self.action["views"]), 6)
self.assertEqual(self.action["views"][6][1], "activity")
self.assertEqual(len(self.action["views"]), 7)

0 comments on commit 7c9e5c4

Please sign in to comment.