def __init__(self, domain, instance=None, read_only=False, *args, **kwargs): super(ConfigurableReportEditForm, self).__init__(instance, read_only, *args, **kwargs) self.fields['config_id'] = ReportDataSourceField(domain=domain) self.helper = FormHelper() self.helper.form_method = 'POST' self.helper.form_class = 'form-horizontal' self.helper.form_action = '#' self.helper.label_class = 'col-sm-3 col-md-2' self.helper.field_class = 'col-sm-9 col-md-9' self.helper.layout = crispy.Layout( crispy.Fieldset( _("Report Configuration"), 'config_id', 'title', 'visible', 'description', 'aggregation_columns', 'filters', 'columns', 'configured_charts', 'sort_expression', ), hqcrispy.FormActions( twbscrispy.StrictButton( _("Save Changes"), type="submit", css_class="btn btn-primary", ), ), )
def __init__(self, domain, instance=None, read_only=False, *args, **kwargs): super(ConfigurableReportEditForm, self).__init__(instance, read_only, *args, **kwargs) self.fields['config_id'] = ReportDataSourceField(domain=domain)
def __init__(self, domain, instance=None, read_only=False, *args, **kwargs): super(ConfigurableReportEditForm, self).__init__(instance, read_only, *args, **kwargs) self.fields['config_id'] = ReportDataSourceField(domain=domain) self.helper = FormHelper() self.helper.form_method = 'POST' self.helper.form_class = 'form-horizontal' self.helper.form_action = '#' self.helper.label_class = 'col-sm-3 col-md-2' self.helper.field_class = 'col-sm-9 col-md-9' fields = [ crispy.Field('config_id', css_class="hqwebapp-select2"), 'title', 'visible', 'description', 'aggregation_columns', 'filters', 'columns', 'configured_charts', 'sort_expression', 'distinct_on', ] if instance.config_id: fields.append('_id') self.helper.layout = crispy.Layout(*fields) # Restrict edit for static reports if not read_only: self.helper.layout.append( hqcrispy.FormActions( twbscrispy.StrictButton( _("Save"), type="submit", css_class="btn btn-primary", ), ))