[FIX] purchase: sort order_line by sequence

Commit 9d4efc8 added the sequence field on model
'purchase.order.line' and added this field in the
tree view (with 'handle' widget), to allow to
re-order the purchase order lines in the purchase
order form view.

However, for this to actually work, the default order
on the model should be on sequence field, otherwise
the rows will still be ordered by id even if the user
changes their sequence value by re-ordering them.
This commit is contained in:
Aaron Bohy
2017-05-11 10:15:10 +02:00
parent 508e5ed9dd
commit 067815f97d
+1
View File
@@ -509,6 +509,7 @@ class PurchaseOrder(models.Model):
class PurchaseOrderLine(models.Model):
_name = 'purchase.order.line'
_description = 'Purchase Order Line'
_order = 'sequence, id'
@api.depends('product_qty', 'price_unit', 'taxes_id')
def _compute_amount(self):