Browse Source
[WIP] mis_builder refactoring: rename view and report sources for clarity
pull/189/head
[WIP] mis_builder refactoring: rename view and report sources for clarity
pull/189/head
Stéphane Bidoul
9 years ago
10 changed files with 462 additions and 438 deletions
-
7mis_builder/__openerp__.py
-
8mis_builder/report/__init__.py
-
0mis_builder/report/mis_report_instance_qweb.py
-
15mis_builder/report/mis_report_instance_qweb.xml
-
9mis_builder/report/mis_report_instance_xlsx.py
-
15mis_builder/report/mis_report_instance_xlsx.xml
-
429mis_builder/views/mis_builder.xml
-
32mis_builder/views/mis_builder_style.xml
-
180mis_builder/views/mis_report.xml
-
205mis_builder/views/mis_report_instance.xml
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="xls_export" model="ir.actions.report.xml"> |
||||
|
<field name="name">MIS report instance XLS report</field> |
||||
|
<field name="model">mis.report.instance</field> |
||||
|
<field name="type">ir.actions.report.xml</field> |
||||
|
<field name="report_name">mis.report.instance.xlsx</field> |
||||
|
<field name="report_type">xlsx</field> |
||||
|
<field name="auto" eval="False"/> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -1,429 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<openerp> |
|
||||
<data> |
|
||||
|
|
||||
<template id="assets_backend" name="mis_builder" inherit_id="web.assets_backend"> |
|
||||
<xpath expr="." position="inside"> |
|
||||
<link rel="stylesheet" href="/mis_builder/static/src/css/custom.css"/> |
|
||||
<script type="text/javascript" src="/mis_builder/static/src/js/mis_builder.js"></script> |
|
||||
</xpath> |
|
||||
</template> |
|
||||
<template id="assets_report" inherit_id="report.assets_common"> |
|
||||
<xpath expr="." position="inside"> |
|
||||
<link href="/mis_builder/static/src/css/report.css" rel="stylesheet"/> |
|
||||
</xpath> |
|
||||
</template> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_view_tree"> |
|
||||
<field name="name">mis.report.view.tree</field> |
|
||||
<field name="model">mis.report</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree string="MIS Reports"> |
|
||||
<field name="name"/> |
|
||||
<field name="description"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_view_form"> |
|
||||
<field name="name">mis.report.view.form</field> |
|
||||
<field name="model">mis.report</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="MIS Report" version="7.0"> |
|
||||
<sheet> |
|
||||
<group col="2"> |
|
||||
<field name="name"/> |
|
||||
<field name="description"/> |
|
||||
</group> |
|
||||
<group string="Sub KPI's"> |
|
||||
<field name="subkpi_ids" nolabel="1" colspan="2"> |
|
||||
<tree string="Sub KPI's" editable="bottom"> |
|
||||
<field name="sequence" widget="handle"/> |
|
||||
<field name="description"/> |
|
||||
<field name="name"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</group> |
|
||||
<group string="Queries"> |
|
||||
<field name="query_ids" nolabel="1" colspan="2"> |
|
||||
<tree string="Queries" editable="bottom"> |
|
||||
<field name="name"/> |
|
||||
<field name="model_id"/> |
|
||||
<field name="field_ids" domain="[('model_id', '=', model_id)]" widget="many2many_tags"/> |
|
||||
<field name="field_names"/> |
|
||||
<field name="aggregate"/> |
|
||||
<field name="date_field" domain="[('model_id', '=', model_id), ('ttype', 'in', ('date', 'datetime'))]"/> |
|
||||
<field name="domain"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</group> |
|
||||
<group string="KPI's"> |
|
||||
<field name="kpi_ids" nolabel="1" colspan="2"> |
|
||||
<tree string="KPI's"> |
|
||||
<field name="sequence" widget="handle"/> |
|
||||
<field name="description"/> |
|
||||
<field name="name"/> |
|
||||
<field name="multi"/> |
|
||||
<field name="expression"/> |
|
||||
<field name="type"/> |
|
||||
<field name="dp" attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
<field name="divider" attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
<field name="prefix"/> |
|
||||
<field name="suffix"/> |
|
||||
<field name="compare_method" attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</group> |
|
||||
<group col="2" string="Legend (for kpi expressions)"> |
|
||||
<group> |
|
||||
<label colspan="2" string="Expressions are of the form <field><mode>[accounts][domain]"/> |
|
||||
<label colspan="2" string="Possible values for 'field' can be:"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* bal for balance (debit - credit)"/> |
|
||||
<label colspan="2" string="* crd for credit"/> |
|
||||
<label colspan="2" string="* deb for debit"/> |
|
||||
</group> |
|
||||
<label colspan="2" string="Possible values for 'mode' are:"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* nothing or p: variation over the period"/> |
|
||||
<label colspan="2" string="* i: at the beginning of the period"/> |
|
||||
<label colspan="2" string="* e: at the end of the period"/> |
|
||||
</group> |
|
||||
<label colspan="2" string="'accounts' is a comma-separated list of account codes, possibly containing %% wildcards"/> |
|
||||
<label colspan="2" string="'domain' is an optional filter on move lines (eg to filter on analytic accounts or journal)"/> |
|
||||
</group> |
|
||||
<group> |
|
||||
<label colspan="2" string="Examples"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* bal[70]: variation of the balance of account 70 over the period (it is the same as balp[70]);"/> |
|
||||
<label colspan="2" string="* bali[70,60]: initial balance of accounts 70 and 60;"/> |
|
||||
<label colspan="2" string="* bale[1%%]: balance of accounts starting with 1 at end of period."/> |
|
||||
</group> |
|
||||
</group> |
|
||||
</group> |
|
||||
</sheet> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record id="mis_report_style_view_form" model="ir.ui.view"> |
|
||||
<field name="name">mis.report.style.view.form</field> |
|
||||
<field name="model">mis.report.kpi.style</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form> |
|
||||
<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> |
|
||||
|
|
||||
<record id="mis_report_view_kpi_form" model="ir.ui.view"> |
|
||||
<field name="name">mis.report.view.kpi.form</field> |
|
||||
<field name="model">mis.report.kpi</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="MIS Report KPI" version="7.0"> |
|
||||
<group col="4"> |
|
||||
<field name="description"/> |
|
||||
<field name="name"/> |
|
||||
<field name="type"/> |
|
||||
<field name="dp" |
|
||||
attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
<field name="divider" |
|
||||
attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
<field name="compare_method" |
|
||||
attrs="{'invisible': [('type', '=', 'str')]}"/> |
|
||||
<field name="prefix"/> |
|
||||
<field name="suffix"/> |
|
||||
<field name="style"/> |
|
||||
<field name="style_expression"/> |
|
||||
<!--<field name="sequence" />--> |
|
||||
</group> |
|
||||
<group string="Expression"> |
|
||||
<field name="multi"/> |
|
||||
<field name="expression_ids" colspan="4" nolabel="1" |
|
||||
delete="0" create="0" |
|
||||
attrs="{'invisible': [('multi', '=', False)]}"> |
|
||||
<tree editable="bottom"> |
|
||||
<field name="subkpi_id"/> |
|
||||
<field name="name"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
<field name="expression" colspan="4" nolabel="1" |
|
||||
attrs="{'invisible': [('multi', '=', True)], |
|
||||
'readonly': [('multi', '=', True)]}"/> |
|
||||
</group> |
|
||||
<group col="4" string="Auto expand"> |
|
||||
<field name="auto_expand_accounts"/> |
|
||||
<field name="auto_expand_accounts_style" |
|
||||
attrs="{'invisible': [('auto_expand_accounts', '!=', True)]}"/> |
|
||||
</group> |
|
||||
<group col="2" string="Legend (for kpi expressions)"> |
|
||||
<group> |
|
||||
<label colspan="2" string="Expressions are of the form <field><mode>[accounts][domain]"/> |
|
||||
<label colspan="2" string="Possible values for 'field' can be:"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* bal for balance (debit - credit)"/> |
|
||||
<label colspan="2" string="* crd for credit"/> |
|
||||
<label colspan="2" string="* deb for debit"/> |
|
||||
</group> |
|
||||
<label colspan="2" string="Possible values for 'mode' are:"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* nothing or p: variation over the period"/> |
|
||||
<label colspan="2" string="* i: at the beginning of the period"/> |
|
||||
<label colspan="2" string="* e: at the end of the period"/> |
|
||||
</group> |
|
||||
<label colspan="2" string="'accounts' is a comma-separated list of account codes, possibly containing %% wildcards"/> |
|
||||
<label colspan="2" string="'domain' is an optional filter on move lines (eg to filter on analytic accounts or journal)"/> |
|
||||
</group> |
|
||||
<group> |
|
||||
<label colspan="2" string="Examples"/> |
|
||||
<group> |
|
||||
<label colspan="2" string="* bal[70]: variation of the balance of account 70 over the period (it is the same as balp[70]);"/> |
|
||||
<label colspan="2" string="* bali[70,60]: initial balance of accounts 70 and 60;"/> |
|
||||
<label colspan="2" string="* bale[1%%]: balance of accounts starting with 1 at end of period."/> |
|
||||
</group> |
|
||||
</group> |
|
||||
</group> |
|
||||
|
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
|
|
||||
<record model="ir.actions.act_window" id="mis_report_view_action"> |
|
||||
<field name="name">MIS Report Templates</field> |
|
||||
<field name="view_id" ref="mis_report_view_tree"/> |
|
||||
<field name="res_model">mis.report</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree,form</field> |
|
||||
</record> |
|
||||
|
|
||||
<menuitem id="mis_report_view_menu" parent="account.menu_account_reports" name="MIS Report Templates" action="mis_report_view_action" sequence="21"/> |
|
||||
|
|
||||
<record id="xls_export" model="ir.actions.report.xml"> |
|
||||
<field name="name">MIS report instance XLS report</field> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="type">ir.actions.report.xml</field> |
|
||||
<field name="report_name">mis.report.instance.xlsx</field> |
|
||||
<field name="report_type">xlsx</field> |
|
||||
<field name="auto" eval="False"/> |
|
||||
</record> |
|
||||
|
|
||||
<record id="qweb_pdf_export" model="ir.actions.report.xml"> |
|
||||
<field name="name">MIS report instance QWEB PDF report</field> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="type">ir.actions.report.xml</field> |
|
||||
<field name="report_name">mis_builder.report_mis_report_instance</field> |
|
||||
<field name="report_type">qweb-pdf</field> |
|
||||
<field name="auto" eval="False"/> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_instance_result_view_form"> |
|
||||
<field name="name">mis.report.instance.result.view.form</field> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="priority" eval="20 "/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="MIS Report Result" version="7.0" edit="false" create="false" delete="false" > |
|
||||
<widget type="mis_report"></widget> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_instance_view_tree"> |
|
||||
<field name="name">mis.report.instance.view.tree</field> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree string="MIS Report Instances"> |
|
||||
<button name="preview" type="object" icon="gtk-print-preview" /> |
|
||||
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
|
||||
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
|
||||
<field name="name"/> |
|
||||
<field name="description"/> |
|
||||
<field name="report_id"/> |
|
||||
<field name="target_move"/> |
|
||||
<field name="pivot_date"/> |
|
||||
<field name="company_id"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_instance_view_form"> |
|
||||
<field name="name">mis.report.instance.view.form</field> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="priority" eval="15"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="MIS Report Instance" version="7.0"> |
|
||||
<sheet> |
|
||||
<field name="temporary" invisible="1"/> |
|
||||
<div class="oe_right oe_button_box" name="buttons"> |
|
||||
<button type="object" name="preview" string="Preview" icon="gtk-print-preview" /> |
|
||||
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
|
||||
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
|
||||
<button type="action" name="%(mis_report_instance_add_to_dashboard_action)d" string="Add to dashboard" icon="gtk-add" attrs="{'invisible': [('temporary', '=', True)]}"/> |
|
||||
<button type="object" name="save_report" string="Save" icon="gtk-floppy" attrs="{'invisible': [('temporary', '=', False)]}"/> |
|
||||
</div> |
|
||||
<div class="oe_title"> |
|
||||
<div class="oe_edit_only"> |
|
||||
<label for="name"/> |
|
||||
</div> |
|
||||
<h1> |
|
||||
<field name="name" placeholder="Name"/> |
|
||||
</h1> |
|
||||
<field name="description"/> |
|
||||
</div> |
|
||||
<group> |
|
||||
<group> |
|
||||
<field name="report_id"/> |
|
||||
<field name="target_move" widget="radio"/> |
|
||||
<field name="landscape_pdf"/> |
|
||||
<field name="comparison_mode"/> |
|
||||
<field name="company_id" groups="base.group_multi_company"/> |
|
||||
</group> |
|
||||
<group> |
|
||||
<group name="simple_mode" |
|
||||
attrs="{'invisible': [('comparison_mode', '=', True)]}" colspan="4"> |
|
||||
<field name="date_range_id"/> |
|
||||
<field name="date_from" attrs="{'required': [('comparison_mode', '=', False)]}"/> |
|
||||
<field name="date_to" attrs="{'required': [('comparison_mode', '=', False)]}"/> |
|
||||
</group> |
|
||||
</group> |
|
||||
</group> |
|
||||
<group name="comparison_mode" string="Comparison" |
|
||||
attrs="{'invisible': [('comparison_mode', '=', False)]}" colspan="4"> |
|
||||
<field name="period_ids" colspan="4" nolabel="1" attrs="{'required': [('comparison_mode', '=', True)]}"> |
|
||||
<tree string="KPI's" colors="red:valid==False"> |
|
||||
<field name="sequence" widget="handle"/> |
|
||||
<field name="name"/> |
|
||||
<field name="date_from"/> |
|
||||
<field name="date_to"/> |
|
||||
<field name="valid" invisible="1"/> |
|
||||
<field name="report_instance_id" invisible="1"/> |
|
||||
<field name="id" invisible="1"/> |
|
||||
<field name="subkpi_ids" |
|
||||
domain="[('report_id', '=', parent.report_id)]" |
|
||||
widget="many2many_tags"/> |
|
||||
<field name="comparison_column_ids" domain="[('report_instance_id', '=', report_instance_id), ('id', '!=', id)]" widget="many2many_tags"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
<field name="date"/> |
|
||||
</group> |
|
||||
</sheet> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.actions.act_window" id="mis_report_instance_view_action"> |
|
||||
<field name="name">MIS Reports</field> |
|
||||
<field name="view_id" ref="mis_report_instance_view_tree"/> |
|
||||
<field name="res_model">mis.report.instance</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree,form</field> |
|
||||
<field name="domain">[('temporary', '=', False)]</field> |
|
||||
</record> |
|
||||
|
|
||||
<menuitem id="mis_report_instance_view_menu" parent="account.menu_finance_reports" name="MIS Reports" action="mis_report_instance_view_action" sequence="101"/> |
|
||||
|
|
||||
<record id="wizard_mis_report_instance_view_form" model="ir.ui.view"> |
|
||||
<field name="model">mis.report.instance</field> |
|
||||
<field name="inherit_id" ref="mis_builder.mis_report_instance_view_form"/> |
|
||||
<field name="mode">primary</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="name" position="attributes"> |
|
||||
<attribute name="readonly">1</attribute> |
|
||||
</field> |
|
||||
<label for="name" position="replace"/> |
|
||||
<field name="report_id" position="attributes"> |
|
||||
<attribute name="invisible">1</attribute> |
|
||||
</field> |
|
||||
<div name="buttons" position="attributes"> |
|
||||
<attribute name="invisible">1</attribute> |
|
||||
</div> |
|
||||
<sheet position="after"> |
|
||||
<footer> |
|
||||
<button type="object" name="save_report" string="Save" icon="gtk-floppy"/> |
|
||||
<button type="object" name="preview" string="Preview" icon="gtk-print-preview" /> |
|
||||
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
|
||||
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
|
||||
or <button string="Cancel" class="oe_link" special="cancel" /> |
|
||||
</footer> |
|
||||
</sheet> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.actions.act_window" id="last_mis_report_instance_view_action"> |
|
||||
<field name="name">Last Reports Generated</field> |
|
||||
<field name="view_id" ref="mis_report_instance_view_tree"/> |
|
||||
<field name="res_model">mis.report.instance</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree,form</field> |
|
||||
<field name="domain">[('temporary', '=', True)]</field> |
|
||||
</record> |
|
||||
|
|
||||
<menuitem id="last_wizard_mis_report_instance_view_menu" |
|
||||
parent="account.menu_finance_reports" |
|
||||
name="Last Reports Generated" |
|
||||
action="last_mis_report_instance_view_action" |
|
||||
sequence="102"/> |
|
||||
|
|
||||
<record model="ir.ui.view" id="mis_report_instance_period_view_form"> |
|
||||
<field name="model">mis.report.instance.period</field> |
|
||||
<field name="priority" eval="16"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="KPI's"> |
|
||||
<sheet> |
|
||||
<group> |
|
||||
<field name="mode" widget="radio"/> |
|
||||
<field name="valid" invisible="1"/> |
|
||||
<group name="relative" attrs="{'invisible': [('mode', '!=', 'relative')]}" colspan="4"> |
|
||||
<group> |
|
||||
<field name="type" attrs="{'required': [('mode', '=', 'relative')]}"/> |
|
||||
<field name="date_range_type_id" |
|
||||
attrs="{'invisible': [('type', '!=', 'date_range')], 'required': [('type', '=', 'date_range')]}"/> |
|
||||
<field name="offset"/> |
|
||||
<field name="duration"/> |
|
||||
</group> |
|
||||
<group> |
|
||||
<field name="date_from"/> |
|
||||
<field name="date_to"/> |
|
||||
</group> |
|
||||
</group> |
|
||||
<group name="fix" attrs="{'invisible': [('mode', '!=', 'fix')]}" colspan="4"> |
|
||||
<field name="date_range_id"/> |
|
||||
<field name="manual_date_from" |
|
||||
attrs="{'required': [('mode', '=', 'fix')]}"/> |
|
||||
<field name="manual_date_to" |
|
||||
attrs="{'required': [('mode', '=', 'fix')]}"/> |
|
||||
</group> |
|
||||
<field name="name" placeholder="Name"/> |
|
||||
<field name="normalize_factor"/> |
|
||||
<field name="report_instance_id" invisible="1"/> |
|
||||
<field name="id" invisible="1"/> |
|
||||
<field name="subkpi_ids" |
|
||||
domain="[('report_id', '=', parent.report_id)]" |
|
||||
widget="many2many_tags"/> |
|
||||
<field name="comparison_column_ids" |
|
||||
domain="[('report_instance_id', '=', report_instance_id), ('id', '!=', id)]" |
|
||||
widget="many2many_tags"/> |
|
||||
</group> |
|
||||
</sheet> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
@ -0,0 +1,32 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="mis_report_style_view_form" model="ir.ui.view"> |
||||
|
<field name="name">mis.report.style.view.form</field> |
||||
|
<field name="model">mis.report.kpi.style</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<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> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,180 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_view_tree"> |
||||
|
<field name="name">mis.report.view.tree</field> |
||||
|
<field name="model">mis.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="MIS Reports"> |
||||
|
<field name="name"/> |
||||
|
<field name="description"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_view_form"> |
||||
|
<field name="name">mis.report.view.form</field> |
||||
|
<field name="model">mis.report</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="MIS Report" version="7.0"> |
||||
|
<sheet> |
||||
|
<group col="2"> |
||||
|
<field name="name"/> |
||||
|
<field name="description"/> |
||||
|
</group> |
||||
|
<group string="Sub KPI's"> |
||||
|
<field name="subkpi_ids" nolabel="1" colspan="2"> |
||||
|
<tree string="Sub KPI's" editable="bottom"> |
||||
|
<field name="sequence" widget="handle"/> |
||||
|
<field name="description"/> |
||||
|
<field name="name"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</group> |
||||
|
<group string="Queries"> |
||||
|
<field name="query_ids" nolabel="1" colspan="2"> |
||||
|
<tree string="Queries" editable="bottom"> |
||||
|
<field name="name"/> |
||||
|
<field name="model_id"/> |
||||
|
<field name="field_ids" domain="[('model_id', '=', model_id)]" widget="many2many_tags"/> |
||||
|
<field name="field_names"/> |
||||
|
<field name="aggregate"/> |
||||
|
<field name="date_field" domain="[('model_id', '=', model_id), ('ttype', 'in', ('date', 'datetime'))]"/> |
||||
|
<field name="domain"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</group> |
||||
|
<group string="KPI's"> |
||||
|
<field name="kpi_ids" nolabel="1" colspan="2"> |
||||
|
<tree string="KPI's"> |
||||
|
<field name="sequence" widget="handle"/> |
||||
|
<field name="description"/> |
||||
|
<field name="name"/> |
||||
|
<field name="multi"/> |
||||
|
<field name="expression"/> |
||||
|
<field name="type"/> |
||||
|
<field name="dp" attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
<field name="divider" attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
<field name="prefix"/> |
||||
|
<field name="suffix"/> |
||||
|
<field name="compare_method" attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</group> |
||||
|
<group col="2" string="Legend (for kpi expressions)"> |
||||
|
<group> |
||||
|
<label colspan="2" string="Expressions are of the form <field><mode>[accounts][domain]"/> |
||||
|
<label colspan="2" string="Possible values for 'field' can be:"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* bal for balance (debit - credit)"/> |
||||
|
<label colspan="2" string="* crd for credit"/> |
||||
|
<label colspan="2" string="* deb for debit"/> |
||||
|
</group> |
||||
|
<label colspan="2" string="Possible values for 'mode' are:"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* nothing or p: variation over the period"/> |
||||
|
<label colspan="2" string="* i: at the beginning of the period"/> |
||||
|
<label colspan="2" string="* e: at the end of the period"/> |
||||
|
</group> |
||||
|
<label colspan="2" string="'accounts' is a comma-separated list of account codes, possibly containing %% wildcards"/> |
||||
|
<label colspan="2" string="'domain' is an optional filter on move lines (eg to filter on analytic accounts or journal)"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<label colspan="2" string="Examples"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* bal[70]: variation of the balance of account 70 over the period (it is the same as balp[70]);"/> |
||||
|
<label colspan="2" string="* bali[70,60]: initial balance of accounts 70 and 60;"/> |
||||
|
<label colspan="2" string="* bale[1%%]: balance of accounts starting with 1 at end of period."/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="mis_report_view_kpi_form" model="ir.ui.view"> |
||||
|
<field name="name">mis.report.view.kpi.form</field> |
||||
|
<field name="model">mis.report.kpi</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="MIS Report KPI" version="7.0"> |
||||
|
<group col="4"> |
||||
|
<field name="description"/> |
||||
|
<field name="name"/> |
||||
|
<field name="type"/> |
||||
|
<field name="dp" |
||||
|
attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
<field name="divider" |
||||
|
attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
<field name="compare_method" |
||||
|
attrs="{'invisible': [('type', '=', 'str')]}"/> |
||||
|
<field name="prefix"/> |
||||
|
<field name="suffix"/> |
||||
|
<field name="style"/> |
||||
|
<field name="style_expression"/> |
||||
|
<!--<field name="sequence" />--> |
||||
|
</group> |
||||
|
<group string="Expression"> |
||||
|
<field name="multi"/> |
||||
|
<field name="expression_ids" colspan="4" nolabel="1" |
||||
|
delete="0" create="0" |
||||
|
attrs="{'invisible': [('multi', '=', False)]}"> |
||||
|
<tree editable="bottom"> |
||||
|
<field name="subkpi_id"/> |
||||
|
<field name="name"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
<field name="expression" colspan="4" nolabel="1" |
||||
|
attrs="{'invisible': [('multi', '=', True)], |
||||
|
'readonly': [('multi', '=', True)]}"/> |
||||
|
</group> |
||||
|
<group col="4" string="Auto expand"> |
||||
|
<field name="auto_expand_accounts"/> |
||||
|
<field name="auto_expand_accounts_style" |
||||
|
attrs="{'invisible': [('auto_expand_accounts', '!=', True)]}"/> |
||||
|
</group> |
||||
|
<group col="2" string="Legend (for kpi expressions)"> |
||||
|
<group> |
||||
|
<label colspan="2" string="Expressions are of the form <field><mode>[accounts][domain]"/> |
||||
|
<label colspan="2" string="Possible values for 'field' can be:"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* bal for balance (debit - credit)"/> |
||||
|
<label colspan="2" string="* crd for credit"/> |
||||
|
<label colspan="2" string="* deb for debit"/> |
||||
|
</group> |
||||
|
<label colspan="2" string="Possible values for 'mode' are:"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* nothing or p: variation over the period"/> |
||||
|
<label colspan="2" string="* i: at the beginning of the period"/> |
||||
|
<label colspan="2" string="* e: at the end of the period"/> |
||||
|
</group> |
||||
|
<label colspan="2" string="'accounts' is a comma-separated list of account codes, possibly containing %% wildcards"/> |
||||
|
<label colspan="2" string="'domain' is an optional filter on move lines (eg to filter on analytic accounts or journal)"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<label colspan="2" string="Examples"/> |
||||
|
<group> |
||||
|
<label colspan="2" string="* bal[70]: variation of the balance of account 70 over the period (it is the same as balp[70]);"/> |
||||
|
<label colspan="2" string="* bali[70,60]: initial balance of accounts 70 and 60;"/> |
||||
|
<label colspan="2" string="* bale[1%%]: balance of accounts starting with 1 at end of period."/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</group> |
||||
|
|
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.actions.act_window" id="mis_report_view_action"> |
||||
|
<field name="name">MIS Report Templates</field> |
||||
|
<field name="view_id" ref="mis_report_view_tree"/> |
||||
|
<field name="res_model">mis.report</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem id="mis_report_view_menu" parent="account.menu_account_reports" name="MIS Report Templates" action="mis_report_view_action" sequence="21"/> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
@ -0,0 +1,205 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<template id="assets_backend" name="mis_builder" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<link rel="stylesheet" href="/mis_builder/static/src/css/custom.css"/> |
||||
|
<script type="text/javascript" src="/mis_builder/static/src/js/mis_builder.js"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_instance_result_view_form"> |
||||
|
<field name="name">mis.report.instance.result.view.form</field> |
||||
|
<field name="model">mis.report.instance</field> |
||||
|
<field name="priority" eval="20 "/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="MIS Report Result" version="7.0" edit="false" create="false" delete="false" > |
||||
|
<widget type="mis_report"></widget> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_instance_view_tree"> |
||||
|
<field name="name">mis.report.instance.view.tree</field> |
||||
|
<field name="model">mis.report.instance</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="MIS Report Instances"> |
||||
|
<button name="preview" type="object" icon="gtk-print-preview" /> |
||||
|
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
||||
|
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
||||
|
<field name="name"/> |
||||
|
<field name="description"/> |
||||
|
<field name="report_id"/> |
||||
|
<field name="target_move"/> |
||||
|
<field name="pivot_date"/> |
||||
|
<field name="company_id"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_instance_view_form"> |
||||
|
<field name="name">mis.report.instance.view.form</field> |
||||
|
<field name="model">mis.report.instance</field> |
||||
|
<field name="priority" eval="15"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="MIS Report Instance" version="7.0"> |
||||
|
<sheet> |
||||
|
<field name="temporary" invisible="1"/> |
||||
|
<div class="oe_right oe_button_box" name="buttons"> |
||||
|
<button type="object" name="preview" string="Preview" icon="gtk-print-preview" /> |
||||
|
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
||||
|
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
||||
|
<button type="action" name="%(mis_report_instance_add_to_dashboard_action)d" string="Add to dashboard" icon="gtk-add" attrs="{'invisible': [('temporary', '=', True)]}"/> |
||||
|
<button type="object" name="save_report" string="Save" icon="gtk-floppy" attrs="{'invisible': [('temporary', '=', False)]}"/> |
||||
|
</div> |
||||
|
<div class="oe_title"> |
||||
|
<div class="oe_edit_only"> |
||||
|
<label for="name"/> |
||||
|
</div> |
||||
|
<h1> |
||||
|
<field name="name" placeholder="Name"/> |
||||
|
</h1> |
||||
|
<field name="description"/> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="report_id"/> |
||||
|
<field name="target_move" widget="radio"/> |
||||
|
<field name="landscape_pdf"/> |
||||
|
<field name="comparison_mode"/> |
||||
|
<field name="company_id" groups="base.group_multi_company"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<group name="simple_mode" |
||||
|
attrs="{'invisible': [('comparison_mode', '=', True)]}" colspan="4"> |
||||
|
<field name="date_range_id"/> |
||||
|
<field name="date_from" attrs="{'required': [('comparison_mode', '=', False)]}"/> |
||||
|
<field name="date_to" attrs="{'required': [('comparison_mode', '=', False)]}"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
</group> |
||||
|
<group name="comparison_mode" string="Comparison" |
||||
|
attrs="{'invisible': [('comparison_mode', '=', False)]}" colspan="4"> |
||||
|
<field name="period_ids" colspan="4" nolabel="1" attrs="{'required': [('comparison_mode', '=', True)]}"> |
||||
|
<tree string="KPI's" colors="red:valid==False"> |
||||
|
<field name="sequence" widget="handle"/> |
||||
|
<field name="name"/> |
||||
|
<field name="date_from"/> |
||||
|
<field name="date_to"/> |
||||
|
<field name="valid" invisible="1"/> |
||||
|
<field name="report_instance_id" invisible="1"/> |
||||
|
<field name="id" invisible="1"/> |
||||
|
<field name="subkpi_ids" |
||||
|
domain="[('report_id', '=', parent.report_id)]" |
||||
|
widget="many2many_tags"/> |
||||
|
<field name="comparison_column_ids" domain="[('report_instance_id', '=', report_instance_id), ('id', '!=', id)]" widget="many2many_tags"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
<field name="date"/> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.actions.act_window" id="mis_report_instance_view_action"> |
||||
|
<field name="name">MIS Reports</field> |
||||
|
<field name="view_id" ref="mis_report_instance_view_tree"/> |
||||
|
<field name="res_model">mis.report.instance</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="domain">[('temporary', '=', False)]</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem id="mis_report_instance_view_menu" parent="account.menu_finance_reports" name="MIS Reports" action="mis_report_instance_view_action" sequence="101"/> |
||||
|
|
||||
|
<record id="wizard_mis_report_instance_view_form" model="ir.ui.view"> |
||||
|
<field name="model">mis.report.instance</field> |
||||
|
<field name="inherit_id" ref="mis_builder.mis_report_instance_view_form"/> |
||||
|
<field name="mode">primary</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="name" position="attributes"> |
||||
|
<attribute name="readonly">1</attribute> |
||||
|
</field> |
||||
|
<label for="name" position="replace"/> |
||||
|
<field name="report_id" position="attributes"> |
||||
|
<attribute name="invisible">1</attribute> |
||||
|
</field> |
||||
|
<div name="buttons" position="attributes"> |
||||
|
<attribute name="invisible">1</attribute> |
||||
|
</div> |
||||
|
<sheet position="after"> |
||||
|
<footer> |
||||
|
<button type="object" name="save_report" string="Save" icon="gtk-floppy"/> |
||||
|
<button type="object" name="preview" string="Preview" icon="gtk-print-preview" /> |
||||
|
<button type="object" name="print_pdf" string="Print" icon="gtk-print" /> |
||||
|
<button type="object" name="export_xls" string="Export" icon="gtk-go-down" /> |
||||
|
or <button string="Cancel" class="oe_link" special="cancel" /> |
||||
|
</footer> |
||||
|
</sheet> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.actions.act_window" id="last_mis_report_instance_view_action"> |
||||
|
<field name="name">Last Reports Generated</field> |
||||
|
<field name="view_id" ref="mis_report_instance_view_tree"/> |
||||
|
<field name="res_model">mis.report.instance</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="domain">[('temporary', '=', True)]</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem id="last_wizard_mis_report_instance_view_menu" |
||||
|
parent="account.menu_finance_reports" |
||||
|
name="Last Reports Generated" |
||||
|
action="last_mis_report_instance_view_action" |
||||
|
sequence="102"/> |
||||
|
|
||||
|
<record model="ir.ui.view" id="mis_report_instance_period_view_form"> |
||||
|
<field name="model">mis.report.instance.period</field> |
||||
|
<field name="priority" eval="16"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="KPI's"> |
||||
|
<sheet> |
||||
|
<group> |
||||
|
<field name="mode" widget="radio"/> |
||||
|
<field name="valid" invisible="1"/> |
||||
|
<group name="relative" attrs="{'invisible': [('mode', '!=', 'relative')]}" colspan="4"> |
||||
|
<group> |
||||
|
<field name="type" attrs="{'required': [('mode', '=', 'relative')]}"/> |
||||
|
<field name="date_range_type_id" |
||||
|
attrs="{'invisible': [('type', '!=', 'date_range')], 'required': [('type', '=', 'date_range')]}"/> |
||||
|
<field name="offset"/> |
||||
|
<field name="duration"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="date_from"/> |
||||
|
<field name="date_to"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<group name="fix" attrs="{'invisible': [('mode', '!=', 'fix')]}" colspan="4"> |
||||
|
<field name="date_range_id"/> |
||||
|
<field name="manual_date_from" |
||||
|
attrs="{'required': [('mode', '=', 'fix')]}"/> |
||||
|
<field name="manual_date_to" |
||||
|
attrs="{'required': [('mode', '=', 'fix')]}"/> |
||||
|
</group> |
||||
|
<field name="name" placeholder="Name"/> |
||||
|
<field name="normalize_factor"/> |
||||
|
<field name="report_instance_id" invisible="1"/> |
||||
|
<field name="id" invisible="1"/> |
||||
|
<field name="subkpi_ids" |
||||
|
domain="[('report_id', '=', parent.report_id)]" |
||||
|
widget="many2many_tags"/> |
||||
|
<field name="comparison_column_ids" |
||||
|
domain="[('report_instance_id', '=', report_instance_id), ('id', '!=', id)]" |
||||
|
widget="many2many_tags"/> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue