Skip to content

Commit

Permalink
[FIX] stock_request_purchase: test fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
vib-adhoc authored and bruno-zanotti committed Jan 5, 2024
1 parent 2395367 commit 74a862d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stock_request_purchase/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Stock Request Purchase
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-request&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows for users to be able to display purchase orders that have
been created as a consequence of Stock Requests.
Expand Down
8 changes: 4 additions & 4 deletions stock_request_purchase/tests/test_stock_request_purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _create_product(self, default_code, name, company_id):
"company_id": company_id,
"type": "product",
"route_ids": [(6, 0, self.route_buy.ids)],
"seller_ids": [(0, 0, {"name": self.supplier.id, "delay": 5})],
"seller_ids": [(0, 0, {"partner_id": self.supplier.id, "delay": 5})],
}
)

Expand Down Expand Up @@ -117,7 +117,7 @@ def test_create_request_01(self):
self.assertEqual(order.state, "open")
self.assertEqual(order.stock_request_ids.state, "open")

order.refresh()
order.invalidate_recordset()
self.assertEqual(len(order.sudo().purchase_ids), 1)
self.assertEqual(len(order.picking_ids), 0)
self.assertEqual(len(order.move_ids), 0)
Expand Down Expand Up @@ -176,8 +176,8 @@ def test_create_request_02(self):
sum(stock_request_2.sudo().purchase_line_ids.mapped("product_qty")), 10
)

stock_request_1.refresh()
stock_request_2.refresh()
stock_request_1.invalidate_recordset()
stock_request_2.invalidate_recordset()

self.assertEqual(len(stock_request_1.sudo().purchase_ids), 1)
self.assertEqual(len(stock_request_2.sudo().purchase_ids), 1)
Expand Down

0 comments on commit 74a862d

Please sign in to comment.