Skip to content

Commit

Permalink
[IMP] pos_order_to_sale_order: Test for sale.order.line _compute_name…
Browse files Browse the repository at this point in the history
… method is added.
  • Loading branch information
geomer198 committed Oct 15, 2023
1 parent 532a182 commit af6760e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pos_order_to_sale_order/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,33 @@ def test_pos_order_to_sale_order(self):
self.assertEqual(order.state, "sale")
self.assertEqual(order.delivery_status, "full")
self.assertEqual(order.invoice_status, "invoiced")

def test_sale_order_line_compute_name(self):
self.partner = self.env["res.partner"].create({"name": "Test Partner"})
self.product = self.env["product.product"].create(
{"name": "Test Product", "default_code": "test_01"}
)

self.so = self.env["sale.order"].create(
{
"partner_id": self.partner.id,
"origin": "Point of Sale",
"order_line": [
(
0,
0,
{
"product_id": self.product.id,
"product_uom_qty": 1.0,
"price_unit": 100.0,
"customer_note": "Customer Note",
},
)
],
}
)
self.assertIn(
"Customer Note",
self.so.order_line.name,
msg="'Customer Note' string must be contains in name field",
)

0 comments on commit af6760e

Please sign in to comment.