Fix rendering of BOM table view

- Edit and delete rows now works
This commit is contained in:
Oliver Walters 2019-04-26 23:32:22 +10:00
parent cec61655cf
commit e57a8cdcd1
2 changed files with 3 additions and 3 deletions

View File

@ -337,7 +337,7 @@ class BomItem(models.Model):
"""
def get_absolute_url(self):
return reverse('bom-detail', kwargs={'pk': self.id})
return reverse('bom-item-detail', kwargs={'pk': self.id})
# A link to the parent part
# Each part will get a reverse lookup field 'bom_items'

View File

@ -127,8 +127,8 @@ function loadBomTable(table, options) {
if (options.editable) {
cols.push({
formatter: function(value, row, index, field) {
var bEdit = "<button class='btn btn-success bom-edit-button btn-sm' type='button' url='" + row.url + "edit'>Edit</button>";
var bDelt = "<button class='btn btn-danger bom-delete-button btn-sm' type='button' url='" + row.url + "delete'>Delete</button>";
var bEdit = "<button class='btn btn-success bom-edit-button btn-sm' type='button' url='/part/bom/" + row.pk + "/edit'>Edit</button>";
var bDelt = "<button class='btn btn-danger bom-delete-button btn-sm' type='button' url='/part/bom/" + row.pk + "/delete'>Delete</button>";
return "<div class='btn-group'>" + bEdit + bDelt + "</div>";
}