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:
@@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user