Paginate company page

This commit is contained in:
Oliver 2018-05-07 18:16:05 +10:00
parent deccdce6d9
commit e746ca6e0a
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@
$("#company-table").bootstrapTable({ $("#company-table").bootstrapTable({
sortable: true, sortable: true,
search: true, search: true,
pagination: true,
columns: [ columns: [
{ {
field: 'pk', field: 'pk',

View File

@ -79,6 +79,11 @@ class StockItem(models.Model):
# TODO - Find a test than can be perfomed... # TODO - Find a test than can be perfomed...
pass 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 # Serial number cannot be set for items with quantity greater than 1
if not self.quantity == 1 and self.serial: if not self.quantity == 1 and self.serial:
raise ValidationError({ raise ValidationError({