osbzr/gooderp_addons

View on GitHub
finance/views/finance_conf.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<openerp>
    <data>

        <!--会计根菜单-->
        <menuitem id='finance_menu' name='会计' groups='group_accountant'  web_icon="finance,static/description/icon.png"/>

        <menuitem id='finance_setting_menu' name='设置' parent='finance_menu' sequence='20'/>

        <menuitem id="menu_finance_setting_default" name="默认设置" parent="finance_setting_menu"
                  action="view_finance_config_setting_action" sequence="100"/>

        <menuitem action="base.action_currency_form" id="menu_action_currency_form" parent="finance_setting_menu" name='币别'
                  sequence="60" groups="finance.group_multi_currency"/>

        <!-- VIEWS: "会计要素"
        
            - Model·········: finance.account.type
            - _rec_name·····: name
            - Domain········: []
            - Context·······: {}
            - Parent menu ··: base.menu_custom
            - View priority·: 16    
            - Sequence····..: 10
            - Action help···: Something about finance.account.type
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
        <!-- Tree view for "finance.account.type" -->
        <record id="view_finance_account_type_tree" model="ir.ui.view">
            <field name="name">view.finance.account.type.tree</field>
            <field name="model">finance.account.type</field>
            <field name="type">tree</field>
            <field name="mode">primary</field>
            <field name="priority" eval="16" />
            <field name="active" eval="True" />
            <field name="arch" type="xml">
                <tree string="finance_account_type_tree" create="false" delete="false" edit="false">
                    <field name="name" />
                    <field name="costs_types" />
                </tree>
            </field>
        </record>
        <!-- Form view for "finance.account.type" -->
        <record id="view_finance_account_type_form" model="ir.ui.view">
            <field name="name">view.finance.account.type.form</field>
            <field name="model">finance.account.type</field>
            <field name="type">form</field>
            <field name="mode">primary</field>
            <field name="priority" eval="16" />
            <field name="active" eval="True" />
            <field name="arch" type="xml">
                <form string="finance_account_type_form" create="false" delete="false" edit="false">
                    <header>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name="name" />
                                <field name="costs_types" />
                                <field name="active" />
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <!--会计科目-->
        <record id="finance_account_tree" model="ir.ui.view">
            <field name="name">finance.account.tree</field>
            <field name="model">finance.account</field>
            <field name="arch" type="xml">
                <tree editable="top" string="科目" decoration-info="account_type == 'view'" create="1">
                    <button name="button_add_child" string="增加下级科目" type="object" class="oe_highlight" invisible="context.get('hide_button',True)"/>
                    <field name="code" readonly="1"/>
                    <field name="name"/>
                    <field name="costs_types" invisible="1"/>
                    <field name="account_type" invisible="1"/>
                    <field name="level" />
                    <field name="user_type"/>
                    <field name="parent_id"/>
                    <field name="balance_directions"/>
                    <field name="auxiliary_financing"/>
                    <field name="currency_id" groups='finance.group_multi_currency'/>
                    <field name="exchange" groups='finance.group_multi_currency'/>
                    <field name='active'  invisible='1'/>
                </tree>
            </field>
        </record>
        <record id="finance_account_form" model="ir.ui.view">
            <field name="name">finance.account.tree</field>
            <field name="model">finance.account</field>
            <field name="arch" type="xml">
                <form string="科目" create="0" delete="0" edit="0">
                    <group>
                        <group>
                            <field name="code" />
                            <field name="name" />
                            <field name="level" />
                            <field name="parent_id" />
                        </group>
                        <group>
                            <field name="account_type" />
                            <field name="user_type" invisible="1"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>

        <record id="finance_account_search" model="ir.ui.view">
            <field name="name">finance.account.search</field>
            <field name="model">finance.account</field>
            <field name="arch" type="xml">
                <search string="科目">
                    <field name="name" filter_domain="['|', ('name', 'ilike', self),('code', 'ilike', self)]"/>
                    <group expand="0" string="分组">
                        <filter string="类型" domain="[]" context="{'group_by':'costs_types'}"/>
                        <filter string="辅助核算" domain="[]" context="{'group_by':'auxiliary_financing'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="finance_account_action" model="ir.actions.act_window">
            <field name="name">会计科目</field>
            <field name="res_model">finance.account</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="context">{'modify_from_webclient':True, 'hide_button':False}</field>
        </record>

        <menuitem id='finance_account_menu' action='finance_account_action' parent='finance_setting_menu' sequence='20'/>

        <!--会计科目-->
        <record id="finance_account_restricted_tree" model="ir.ui.view">
            <field name="name">finance.account.tree</field>
            <field name="model">finance.account</field>
            <field name="arch" type="xml">
                <tree editable="top" string="科目" decoration-info="account_type == 'view'" create="0" delete="0" duplicate="0">
                    <field name="code" readonly="1"/>
                    <field name="name" readonly="1"/>
                    <field name="level" />
                    <field name="user_type" readonly="1"/>
                    <field name="parent_id" readonly="1"/>
                    <field name="account_type" invisible="1"/>
                    <field name="restricted_debit" />
                    <field name="restricted_debit_msg" attrs="{ 'required': [('restricted_debit','=',True)]  }"/>
                    <field name="restricted_credit" />
                    <field name="restrict_credit_msg" attrs="{ 'required': [('restricted_credit','=',True)]  }"/>

                </tree>
            </field>
        </record>

        <record id="finance_account_restricted_search" model="ir.ui.view">
            <field name="name">finance.account.search</field>
            <field name="model">finance.account</field>
            <field name="arch" type="xml">
                <search string="科目">
                    <field name="name" filter_domain="['|', ('name', 'ilike', self),('code', 'ilike', self)]"/>
                    <group expand="0" string="分组">
                        <filter string="类型" domain="[]" context="{'group_by':'costs_types'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="finance_account_restricted_action" model="ir.actions.act_window">
            <field name="name">会计科目限制使用</field>
            <field name="res_model">finance.account</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
            <field name="search_view_id" ref="finance_account_restricted_search" />
            <field name="view_id" ref="finance_account_restricted_tree"/>
        </record>

        <menuitem id='finance_account_restricted_menu' action='finance_account_restricted_action' parent='finance_setting_menu' sequence='21'/>

        <!-- VIEWS: "Wizard Account Add Child"
                
                    - Model·········: wizard.account.add.child
                    - _rec_name·····: name
                    - Domain········: []
                    - Context·······: {}
                    - Parent menu ··: base.menu_custom
                    - View priority·: 16    
                    - Sequence····..: 10
                    - Action help···: Something about wizard.account.add.child
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
        <!-- Form view for "wizard.account.add.child" -->
        <record id="view_wizard_account_add_child_form" model="ir.ui.view">
            <field name="name">view.wizard.account.add.child.form</field>
            <field name="model">wizard.account.add.child</field>
            <field name="type">form</field>
            <field name="mode">primary</field>
            <field name="priority" eval="16" />
            <field name="active" eval="True" />
            <field name="arch" type="xml">
                <form string="创建下级科目" create="0" delete="0" edit="1">
                    <group>
                        <group>
                            <field name="parent_id" invisible="1" />
                            <field name="parent_code" />
                            <field name="parent_name" />
                            <field name="account_code" />
                            <field name="full_account_code" readonly="1"/>
                            <field name="account_name" />
                            <field name="account_type" invisible="1"/>
                            <field name="has_journal_items" invisible="1"/>
                        </group>
                    </group>
                    <footer>
                            <button name="create_account" string="创建科目" type="object" class="oe_highlight" confirm="新增下级科目,上级科目现有的记账凭证,将会被转入新增的下级科目!" attrs="{ 'invisible': [('has_journal_items','=', False)]   }"/>
                            <button name="create_account" string="创建科目" type="object" class="oe_highlight" attrs="{ 'invisible': [('has_journal_items','=',True)]   }"/>
                            或者
                            <button string="取消" special="cancel" class="oe_link"/>
                        </footer>
                </form>
            </field>
        </record>
        <!-- Main window action for "wizard.account.add.child" -->
        <record id="action_wizard_account_add_child_act_window" model="ir.actions.act_window">
            <field name="type">ir.actions.act_window</field>
            <field name="name">新增下级科目</field>
            <field name="res_model">wizard.account.add.child</field>
            <field name="view_mode">form</field>
            <field name="view_type">form</field>
            <field name="target">new</field>
            <field name="domain">[]</field>
            <field name="context">{}</field>
        </record>
        <!-- 动作绑定 -->
        <record model="ir.values" id="validate_account_move_line_values">
            <field name="model_id" ref="finance.model_finance_account" />
            <field name="name">新增下级科目</field>
            <field name="key2">client_action_multi</field>
            <field name="value" eval="'ir.actions.act_window,' + str(ref('action_wizard_account_add_child_act_window'))" />
            <field name="key">action</field>
            <field name="model">finance.account</field>
        </record>

        <delete id="validate_account_move_line_values" model="ir.values"/>

        <!--辅助核算-->
        <record id="auxiliary_financing_tree" model="ir.ui.view">
            <field name="name">auxiliary.financing.tree</field>
            <field name="model">auxiliary.financing</field>
            <field name="arch" type="xml">
                <tree editable="TOP" string="辅助核算">
                    <field name="code" />
                    <field name="name" />
                    <field name="type" />
                    <field name='active' invisible='1' />
                </tree>
            </field>
        </record>

        <record id="auxiliary_financing_search" model="ir.ui.view">
            <field name="name">auxiliary.financing.search</field>
            <field name="model">auxiliary.financing</field>
            <field name="arch" type="xml">
                <search string="辅助核算">
                    <field name="name" filter_domain="['|', ('name', 'ilike', self),('code', 'ilike', self)]"/>
                    <group expand="0" string="分组">
                        <filter string="分类" domain="[]" context="{'group_by':'type'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="auxiliary_financing_action" model="ir.actions.act_window">
            <field name="name">辅助核算</field>
            <field name="res_model">auxiliary.financing</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>

        <menuitem id='auxiliary_financing_menu' action='auxiliary_financing_action' parent='finance_setting_menu' sequence='30'/>       

        <!--会计期间-->
        <record id="period_tree" model="ir.ui.view">
            <field name="name">finance.period.tree</field>
            <field name="model">finance.period</field>
            <field name="arch" type="xml">
                <tree editable="TOP" delete='false' string="会计期间">
                    <field name="name"/>
                    <field name="year" attrs="{'readonly': [('is_closed','=',True)]}"/>
                    <field name="month" attrs="{'readonly': [('is_closed','=',True)]}"/>
                    <field name="is_closed" readonly='1'/>
                </tree>
            </field>
        </record>
        <record id="period_form" model="ir.ui.view">
            <field name="name">finance.period.form</field>
            <field name="model">finance.period</field>
            <field name="arch" type="xml">
                <form string="会计期间" delete='false' create="false" edit="false">
                    <group>
                        <group>
                            <field name="name" />
                            <field name="year" />
                            <field name="month" />
                        </group>
                        <group>
                            <field name="company_id" />
                            <field name="is_closed" />
                        </group>
                    </group>
                </form>
            </field>
        </record>
        <record id="finance_period_search" model="ir.ui.view">
            <field name="name">finance.period.search</field>
            <field name="model">finance.period</field>
            <field name="arch" type="xml">
                <search string="会计期间">
                    <filter name='unclosed' string='未结账' domain="[('is_closed', '=', False)]"/>
                    <filter name='closed' string='已结账' domain="[('is_closed', '=', True)]"/>
                    <group expand="0" string="分组">
                        <filter string="会计年度" domain="[]" context="{'group_by':'year'}"/>
                    </group>
                </search>
            </field>
        </record>
        <record id="period_action" model="ir.actions.act_window">
            <field name="name">会计期间</field>
            <field name="res_model">finance.period</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>
        <menuitem id='period_menu' action='period_action' parent='finance_setting_menu' sequence='10'/>
    </data>
</openerp>