osbzr/gooderp_addons

View on GitHub
home_page/views/home_page_views.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <template id="assets_backend" name="petstore_assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" href="/home_page/static/src/css/home_page.css"/>
                <script type="text/javascript" src="/home_page/static/src/js/home_page.js"/>
            </xpath>
        </template>

        <record model="ir.ui.view" id="financial_home_tree">
            <field name="name">financial_home_tree</field>
            <field name="model">home.page</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="首页设置">
                    <field name="sequence"/>
                    <field name="action"/>
                    <field name="note_one" />
                    <field name="menu_type"/> 
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="financial_home_form">
            <field name="name">financial_home_form</field>
            <field name="model">home.page</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="首页设置">
                    <group>
                        <group>
                            <field name="note_one" attrs="{'required':[('menu_type','=','main')]}"/>
                            <field name="compute_field_one" attrs="{'required':[('menu_type','=','top')]}"/>
                            <field name="compute_type" />
                        </group>
                        <group>
                            <field name="menu_type" required='1'/>
                            <field name="report_type_id" attrs="{'invisible':[('menu_type','!=','report')],'required':[('menu_type','=','report')]}"
                                widget="selection"/>
                            <field name="sequence"/>
                        </group>
                    </group>
                    <group>
                        <group>
                            <field name="action" attrs="{'required':[('menu_type','=','all_business')]}"/>
                            <field name="domain" atts="{'required':[('menu_type','in',('all_business','amount_summary')]}"/>
                            <field name="context" attrs="{'required':[('menu_type','in',('top','left'))]}"/>
                        </group>
                        <group>
                            <field name="group_ids"  widget="many2many_tags" />
                            <field name="is_active"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="home_report_type_tree">
            <field name="name">financial_home_tree</field>
            <field name="model">home.report.type</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="首页报表分类" editable="bottom">
                    <field name="sequence" />
                    <field name="name" />
                </tree>
            </field>
        </record>
    </data>
</openerp>