From 171fb6cb73273cf8a8f84450e32f651a152da4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 2 Jan 2016 10:27:39 +0100 Subject: [PATCH] Don't create order method for Function, One2Many and Many2Many fields issue5087 --- product.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 7c817cbdfe..b74a5d9495 100644 --- a/product.py +++ b/product.py @@ -200,7 +200,11 @@ class Product(ModelSQL, ModelView): if not field or isinstance(field, TemplateFunction): setattr(cls, attr, TemplateFunction(copy.deepcopy(tfield))) order_method = getattr(cls, 'order_%s' % attr, None) - if not order_method: + if (not order_method + and not isinstance(tfield, ( + fields.Function, + fields.One2Many, + fields.Many2Many))): order_method = TemplateFunction.order(attr) setattr(cls, 'order_%s' % attr, order_method)