Skip to content

Commit

Permalink
sale_stock_available_to_promise_release: rework tests.common.Common c…
Browse files Browse the repository at this point in the history
…lass to ease extension
  • Loading branch information
sebalix committed May 27, 2024
1 parent 8f7b9b7 commit 1976a48
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sale_stock_available_to_promise_release/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ def setUpClassProduct(cls):
}
)

@classmethod
def _create_sale_order(cls):
return cls.env["sale.order"].create({"partner_id": cls.customer.id})

@classmethod
def setUpClassSale(cls):
customer = cls.env["res.partner"].create(
{"name": "Partner who loves storable products"}
)
cls.sale = cls.env["sale.order"].create({"partner_id": customer.id})
cls.sale = cls._create_sale_order()
cls.line = cls.env["sale.order.line"].create(
{
"order_id": cls.sale.id,
Expand All @@ -45,6 +46,9 @@ def setUpClassStock(cls):
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.customer = cls.env["res.partner"].create(
{"name": "Partner who loves storable products"}
)
cls.setUpClassProduct()
cls.setUpClassSale()
cls.setUpClassStock()
Expand Down

0 comments on commit 1976a48

Please sign in to comment.