Browse Source

[WIP] mis_builder refactoring: add a menu entry for styles

Plus do some more source renaming around styles.
pull/189/head
Stéphane Bidoul 9 years ago
parent
commit
cad22130f2
  1. 2
      mis_builder/models/__init__.py
  2. 4
      mis_builder/models/mis_report.py
  3. 2
      mis_builder/models/mis_report_style.py
  4. 4
      mis_builder/security/ir.model.access.csv
  5. 30
      mis_builder/views/mis_builder_style.xml

2
mis_builder/models/__init__.py

@ -4,5 +4,5 @@
from . import mis_report from . import mis_report
from . import mis_report_instance from . import mis_report_instance
from . import mis_builder_style
from . import mis_report_style
from . import aep from . import aep

4
mis_builder/models/mis_report.py

@ -423,12 +423,12 @@ class MisReportKpi(models.Model):
auto_expand_accounts = fields.Boolean(string='Display details by account') auto_expand_accounts = fields.Boolean(string='Display details by account')
auto_expand_accounts_style = fields.Many2one( auto_expand_accounts_style = fields.Many2one(
string="Style for account detail rows", string="Style for account detail rows",
comodel_name="mis.report.kpi.style",
comodel_name="mis.report.style",
required=False required=False
) )
style = fields.Many2one( style = fields.Many2one(
string="Row style", string="Row style",
comodel_name="mis.report.kpi.style",
comodel_name="mis.report.style",
required=False required=False
) )
style_expression = fields.Char( style_expression = fields.Char(

2
mis_builder/models/mis_builder_style.py → mis_builder/models/mis_report_style.py

@ -8,7 +8,7 @@ from openerp import api, fields, models
class MisReportKpiStyle(models.Model): class MisReportKpiStyle(models.Model):
_name = 'mis.report.kpi.style'
_name = 'mis.report.style'
@api.depends('indent_level') @api.depends('indent_level')
def check_positive_val(self): def check_positive_val(self):

4
mis_builder/security/ir.model.access.csv

@ -13,5 +13,5 @@ access_mis_report_subkpi,access_mis_report_subkpi,model_mis_report_subkpi,accoun
access_mis_report_subkpi,access_mis_report_subkpi,model_mis_report_subkpi,base.group_user,1,0,0,0 access_mis_report_subkpi,access_mis_report_subkpi,model_mis_report_subkpi,base.group_user,1,0,0,0
access_mis_report_kpi_expression,access_mis_report_kpi_expression,model_mis_report_kpi_expression,account.group_account_manager,1,1,1,1 access_mis_report_kpi_expression,access_mis_report_kpi_expression,model_mis_report_kpi_expression,account.group_account_manager,1,1,1,1
access_mis_report_kpi_expression,access_mis_report_kpi_expression,model_mis_report_kpi_expression,base.group_user,1,0,0,0 access_mis_report_kpi_expression,access_mis_report_kpi_expression,model_mis_report_kpi_expression,base.group_user,1,0,0,0
access_mis_report_kpi_style,access_mis_report_kpi_style,model_mis_report_kpi_style,account.group_account_manager,1,0,0,0
access_mis_report_kpi_style,access_mis_report_kpi_style,model_mis_report_kpi_style,base.group_user,1,0,0,0
access_mis_report_style,access_mis_report_style,model_mis_report_style,account.group_account_manager,1,0,0,0
access_mis_report_style,access_mis_report_style,model_mis_report_style,base.group_user,1,0,0,0

30
mis_builder/views/mis_builder_style.xml

@ -2,11 +2,27 @@
<openerp> <openerp>
<data> <data>
<record model="ir.ui.view" id="mis_report_style_view_tree">
<field name="name">mis.report.style.view.tree</field>
<field name="model">mis.report.style</field>
<field name="arch" type="xml">
<tree string="MIS Report Styles">
<field name="name"/>
<field name="color"/>
<field name="background_color"/>
<field name="font_style"/>
<field name="font_weight"/>
<field name="font_size"/>
<field name="indent_level"/>
</tree>
</field>
</record>
<record id="mis_report_style_view_form" model="ir.ui.view"> <record id="mis_report_style_view_form" model="ir.ui.view">
<field name="name">mis.report.style.view.form</field> <field name="name">mis.report.style.view.form</field>
<field name="model">mis.report.kpi.style</field>
<field name="model">mis.report.style</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form>
<form string="MIS Report Style" version="7.0">
<sheet> <sheet>
<group string="Style" col="2"> <group string="Style" col="2">
<field name="name" /> <field name="name" />
@ -28,5 +44,15 @@
</field> </field>
</record> </record>
<record model="ir.actions.act_window" id="mis_report_style_view_action">
<field name="name">MIS Report Styles</field>
<field name="view_id" ref="mis_report_style_view_tree"/>
<field name="res_model">mis.report.style</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="mis_report_style_view_menu" parent="account.menu_account_reports" name="MIS Report Styles" action="mis_report_style_view_action" sequence="22"/>
</data> </data>
</openerp> </openerp>
Loading…
Cancel
Save