Do not check aggregates if field has no type.

This commit is contained in:
Albert Cervera i Areny 2023-03-15 23:03:36 +01:00
parent c803707f6c
commit c5da95bb00
1 changed files with 2 additions and 1 deletions

View File

@ -922,7 +922,8 @@ class WidgetParameter(sequence_ordered(), ModelSQL, ModelView):
if not self.aggregate or not self.field:
return
if self.aggregate in ('sum', 'avg'):
if self.field and self.field.type not in ('integer', 'float', 'numeric'):
if (self.field and self.field.type
and self.field.type not in ('integer', 'float', 'numeric')):
raise UserError(gettext('babi.msg_invalid_aggregate',
parameter=self.rec_name, widget=self.widget.rec_name))