osbzr/gooderp_addons

View on GitHub
finance/views/balance_sheet.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<openerp>
    <data>
        <record id="profit_statement_tree" model="ir.ui.view">
            <field name="name">profit_statement_tree</field>
            <field name="model">profit.statement</field>
            <field name="arch" type="xml">
                <tree string='利润表' create='false' edit='false' >
                    <field name="balance" />
                    <field name="line_num"/>
                    <field name="cumulative_occurrence_balance"/>
                    <field name="current_occurrence_balance"/>
                </tree>
            </field>
        </record>
        <record id="profit_statement_tree_template" model="ir.ui.view">
            <field name="name">profit_statement_tree_template</field>
            <field name="model">profit.statement</field>
            <field name="arch" type="xml">
                <tree string='利润表模板' editable="bottom" >
                    <field name="sequence" widget="handle"/>
                    <field name="balance"/>
                    <field name="line_num"/>
                    <field name="occurrence_balance_formula" />
                </tree>
            </field>
        </record>
        <record id="profit_statement_action_template" model="ir.actions.act_window">
            <field name="name">利润表模板</field>
            <field name="res_model">profit.statement</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="profit_statement_tree_template"/>
        </record> 

         <menuitem id='profit_statement_menu' action='profit_statement_action_template' groups="base.group_no_one" parent='finance_setting_menu' sequence='80'/>


        <record id="balance_sheet_tree" model="ir.ui.view">
            <field name="name">balance_sheet_tree</field>
            <field name="model">balance.sheet</field>
            <field name="arch" type="xml">
                <tree string="资产负债表模板" editable="bottom" >
                    <field name="sequence" widget="handle"/>
                    <field name="balance"/>
                    <field name="line_num"/>
                    <field name="balance_formula"/>
                    <field name="balance_two" />
                     <field name="line_num_two"/>
                    <field name="balance_two_formula"  />
                </tree>
            </field>
        </record>
        <record id="balance_sheet_tree_wizard" model="ir.ui.view">
            <field name="name">balance_sheet_tree</field>
            <field name="model">balance.sheet</field>
            <field name="arch" type="xml">
                <tree string="资产负债表" create="false" edit='false'>
                    <field name="balance"/>
                    <field name="line_num"/>
                    <field name="beginning_balance"/>
                    <field name="ending_balance"/>
                    <field name="balance_two" />
                    <field name="line_num_two"/>
                    <field name="beginning_balance_two"  />
                    <field name="ending_balance_two"  />
                </tree>
            </field>
        </record>
        <record id="balance_sheet_action" model="ir.actions.act_window">
            <field name="name">资产负债表模板</field>
            <field name="res_model">balance.sheet</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="balance_sheet_tree"/>
        </record> 
       <record id="create_balance_sheet_wizard_form" model="ir.ui.view">
            <field name="name">create.balance.sheet.wizard.form</field>
            <field name="model">create.balance.sheet.wizard</field>
            <field name="arch" type="xml">
                <form>
                    <group>
                        <group>
                            <field name="period_id" options="{'no_open':True,'no_create':True}" required="True" style="width: 60%%"/>
                        </group>
                    </group>
                    <footer>
                        <button name="create_balance_sheet" invisible="context.get('profit_statement')"  string="资产负债表" type="object" class="oe_highlight"/>
                        <button name="create_profit_statement" invisible="context.get('balance_sheet')"  string="利润表" type="object" class="oe_highlight"/>
                        或者
                        <button string="取消" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>
        <act_window id="create_balance_sheet_wizard_action"
            name='资产负债表'
            res_model="create.balance.sheet.wizard"
            multi="True"
            view_type="form"
            view_mode="form"
            target="new" 
            context="{'balance_sheet':True}"
            />
        <act_window id="profit_statement_tree_wizard_action"
            name='利润表'
            res_model="create.balance.sheet.wizard"
            multi="True"
            view_type="form"
            view_mode="form"
            target="new" 
            context="{'profit_statement':True}"
            />
         <menuitem id='profit_statement_tree_wizard_action_menu' action='profit_statement_tree_wizard_action' parent='voucher_books_menu' sequence='30'/>
         <menuitem id='create_balance_sheet_wizard_menu' action='create_balance_sheet_wizard_action' parent='voucher_books_menu' sequence='25'/>
         <menuitem id='balance_sheet_menu' action='balance_sheet_action' parent='finance_setting_menu' groups="base.group_no_one" sequence='70'/>
    </data>
</openerp>