From 571ce9d1173579ecbd375666ccbfcd082c95df8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 3 Feb 2015 11:24:05 +0100 Subject: [PATCH] Use 'set' attribute to decide column for table_query Since changeset 64681f657d55, Function fields have a sql_type so it is wrong to rely on this property to use or not the field. The 'set' method of field is already used in many places for this purpose. issue4434 --- opportunity.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/opportunity.py b/opportunity.py index fca75475a6..91f0cc4440 100644 --- a/opportunity.py +++ b/opportunity.py @@ -483,9 +483,7 @@ class SaleOpportunityHistory(ModelSQL, ModelView): for name, field in cls._fields.iteritems(): if name in ('id', 'opportunity', 'date', 'user'): continue - try: - field.sql_type() - except NotImplementedError: + if hasattr(field, 'set'): continue column = Column(opportunity_history, name) columns.append(column.as_(name))