osbzr/gooderp_addons

View on GitHub
finance/data/voucher_template.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<openerp>
    <data>
        <record id="voucher_template_wizard_form" model="ir.ui.view">
            <field name="name">voucher.template.wizard.form</field>
            <field name="model">voucher.template.wizard</field>
            <field name="arch" type="xml">
                  <form string="会计凭证模板">
                      <group>
                          <group>
                              <field name='name' attrs="{'invisible':[('is_change_old_template','=',True)]}"/>
                              <field name='voucher_id' invisible="1"/>
                              <field name="old_template_id" attrs="{'invisible':[('is_change_old_template','!=',True)]}"
                              option="{'no_create':True}"/>
                          </group>
                           <group>
                               <field name="is_change_old_template"/>
                           </group>
                      </group>
                      <footer>
                        <button name='save_as_template' string="保存" type="object" class="oe_highlight"/>
                      </footer>
                  </form>
            </field>
        </record>

          <act_window id="voucher_template_wizard_action"
            name='生成凭证模板'
            res_model="voucher.template.wizard"
            multi="True"
            view_type="form"
            view_mode="form"
            target="new"
            />
        <record id="create_tempalte_voucher_form" model="ir.ui.view">
            <field name="name">create.tempalte.voucher.form</field>
            <field name="model">voucher</field>
            <field name='inherit_id' ref='voucher_form'/>
            <field name="arch" type="xml">
                <button name="voucher_can_be_draft" position="after">
                    <button name='%(voucher_template_wizard_action)d' string="另存为模板" type="action" class="oe_highlight"/>
                </button>
                <field name="name" position="after">
                    <field name="template_id" option="{'no_create':True}" class="oe_edit_only" states="draft"/>
                </field>
            </field>
        </record>
         <record id="voucher_template_tree" model="ir.ui.view">
             <field name="name">voucher.template.tree</field>
            <field name="model">voucher.template</field>
            <field name="arch" type="xml">
                <tree>
                    <field name="name"/>
                </tree>
            </field>
         </record>

         <record id="voucher_template_from" model="ir.ui.view">
             <field name="name">voucher.template.from</field>
            <field name="model">voucher.template</field>
            <field name="arch" type="xml">
                <form>
                    <group>
                        <group>
                            <field name="name"/>
                        </group>
                    </group>
                    <field name="line_ids" >
                        <tree editable="bottom">
                            <field name="name" />
                            <field name="account_id" />
                            <field name="auxiliary_id"/>
                            <field name="partner_id" />
                            <field name="goods_id" />
                        </tree>
                    </field>
                </form>
            </field>
         </record>
        <record id="voucher_template_action" model="ir.actions.act_window">
            <field name="name">凭证模板</field>
            <field name="res_model">voucher.template</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem id='voucher_template_menu' action='voucher_template_action' parent='finance_setting_menu' sequence='90'/>
    </data>
</openerp>