Browse Source

[IMP] mis_builder: cosmetics in style form

pull/189/head
Stéphane Bidoul 8 years ago
parent
commit
7a17fca354
  1. 10
      mis_builder/models/mis_builder_style.py
  2. 13
      mis_builder/views/mis_builder.xml

10
mis_builder/models/mis_builder_style.py

@ -10,9 +10,6 @@ class MisReportKpiStyle(models.Model):
_name = 'mis.report.kpi.style'
# TODO use WEB WIdget color picker
name = fields.Char(string='style name', required=True)
@api.depends('indent_level')
def check_positive_val(self):
return self.indent_level > 0
@ -47,11 +44,14 @@ class MisReportKpiStyle(models.Model):
'xx-large': 17
}
name = fields.Char(string='Style name', required=True)
color = fields.Char(
help='Line color in valid RGB code (from #000000 to #FFFFFF)',
string='Text color',
help='Text color in valid RGB code (from #000000 to #FFFFFF)',
)
background_color = fields.Char(
help='Line color in valid RGB code (from #000000 to #FFFFFF)'
help='Background color in valid RGB code (from #000000 to #FFFFFF)'
)
font_style = fields.Selection(
selection=_font_style_selection,

13
mis_builder/views/mis_builder.xml

@ -111,15 +111,23 @@
<field name="model">mis.report.kpi.style</field>
<field name="arch" type="xml">
<form>
<group>
<sheet>
<group string="Style" col="2">
<field name="name" />
</group>
<group string="Color" col="2">
<field name="color" />
<field name="background_color" />
</group>
<group string="Font" col="2">
<field name="font_style" />
<field name="font_weight" />
<field name="font_size" />
</group>
<group string="Indent">
<field name="indent_level" />
</group>
</sheet>
</form>
</field>
</record>
@ -161,7 +169,8 @@
</group>
<group col="4" string="Auto expand">
<field name="auto_expand_accounts"/>
<field name="auto_expand_accounts_style"/>
<field name="auto_expand_accounts_style"
attrs="{'invisible': [('auto_expand_accounts', '!=', True)]}"/>
</group>
<group col="2" string="Legend (for kpi expressions)">
<group>

Loading…
Cancel
Save