From 067815f97d3946e353482f55aae8ba0adea520e0 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 11 May 2017 09:39:57 +0200 Subject: [PATCH] [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. --- addons/purchase/models/purchase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 4abc75db731..e9cdba6234a 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -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):