diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 55ce09c72d..0409d13c73 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -34,6 +34,7 @@ $("#company-table").bootstrapTable({ sortable: true, search: true, + pagination: true, columns: [ { field: 'pk', diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 0ca86315f9..0c55f452c7 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -79,6 +79,11 @@ class StockItem(models.Model): # TODO - Find a test than can be perfomed... pass + if self.belongs_to and self.belongs_to.pk == self.pk: + raise ValidationError({ + 'belongs_to': _('Item cannot belong to itself') + }) + # Serial number cannot be set for items with quantity greater than 1 if not self.quantity == 1 and self.serial: raise ValidationError({