Don't create order method for Function, One2Many and Many2Many fields

issue5087
This commit is contained in:
Cédric Krier committed 2016-01-02 10:27:39 +01:00
1 parent 0f385fc72e
commit 171fb6cb73
1 file changed
+5 -1
+5 -1
View File
@@ -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)