2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-18 08:31:33 +00:00

Add confirmation field for incomplete purchase orders (#3615)

* Add confirmation field for incomplete purchase orders

* Add similar functionality for SalesOrder

- Complete form is now context sensitive
- Allow user to specify if order should be closed with incomplete lines

* Update API version

* JS linting

* Updated unit tests
This commit is contained in:
Oliver
2022-09-05 14:00:41 +10:00
committed by GitHub
parent b7d0bb9820
commit fd789d28db
7 changed files with 155 additions and 18 deletions

View File

@@ -322,7 +322,19 @@ class PurchaseOrderTest(OrderTest):
self.assignRole('purchase_order.add')
self.post(url, {}, expected_code=201)
# Should fail due to incomplete lines
response = self.post(url, {}, expected_code=400)
self.assertIn('Order has incomplete line items', str(response.data['accept_incomplete']))
# Post again, accepting incomplete line items
self.post(
url,
{
'accept_incomplete': True,
},
expected_code=201
)
po.refresh_from_db()