Skip to content

Commit

Permalink
TA#65108 [IMP] Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
lanto-razafindrabe committed Apr 29, 2024
1 parent f5f381d commit 59cf521
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .unported/mrp_cost/tests/test_mrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ def setUpClass(cls):
cls.workcenter_cost = 100
cls.workcenter = cls.env["mrp.workcenter"].create(
{
"name": "My Work Center",
"costs_hour": cls.workcenter_cost,
})
"name": "My Work Center",
"costs_hour": cls.workcenter_cost,
}
)

cls.bom = cls.env["mrp.bom"].create(
{
Expand All @@ -46,8 +47,9 @@ def setUpClass(cls):
"bom_line_ids": [
(0, 0, cls._get_bom_line_vals(cls.product_b, 1)),
(0, 0, cls._get_bom_line_vals(cls.product_c, 2)),
]
})
],
}
)

cls.order = cls.env["mrp.production"].create(
{
Expand Down Expand Up @@ -96,12 +98,20 @@ def test_workcenter_cost(self):
assert move.value == 200 # 2 hours * 100

def _run_production(self):
wizard = self.env['mrp.product.produce'].with_context({
'active_id': self.order.id,
'active_ids': [self.order.id],
}).create({
'product_qty': 1.0,
})
wizard = (
self.env["mrp.product.produce"]
.with_context(
{
"active_id": self.order.id,
"active_ids": [self.order.id],
}
)
.create(
{
"product_qty": 1.0,
}
)
)
wizard._onchange_product_qty()
wizard.do_produce()
self.order.post_inventory()

0 comments on commit 59cf521

Please sign in to comment.