mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-01 17:51:23 +00:00
Order tests (#10649)
- Additional test coverage for order models - Validate address - Validate contact - Validate date ranges
This commit is contained in:
@@ -383,6 +383,13 @@ class Order(
|
||||
'start_date': _('Start date must be before target date'),
|
||||
})
|
||||
|
||||
# Check that the referenced 'address' matches the correct 'company'
|
||||
if self.company and self.address:
|
||||
if self.address.company != self.company:
|
||||
raise ValidationError({
|
||||
'address': _('Address does not match selected company')
|
||||
})
|
||||
|
||||
def clean_line_item(self, line):
|
||||
"""Clean a line item for this order.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user