acc_account_view.xml 8.6 KB
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_order_form_inherit" model="ir.ui.view">
            <field name="name">acc.account.invoice.supplier.form</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
            <field name="arch" type="xml">
                <!-- <xpath expr="//button[@name='action_invoice_open']" position="before">
                    <button name="teller_accept" string="出纳审核" type="object" states="open" class="oe_highlight" groups="acct_base.acc_account_user_group"/>   
                </xpath> -->
                <xpath expr="//button[@name='action_invoice_open']" position="before">
                    <button name="boss_accept" string="财务经理审核" type="object" states="teller" class="oe_highlight" groups="account.group_account_manager"/>   
                </xpath>
                <xpath expr="//button[@name='action_invoice_open']" position="after">
                    <button name="get_poqty" string="获取订购数量" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>   
                </xpath>
                <xpath expr="//button[@name='action_invoice_open']" position="after">
                    <button name="add_discount_line" string="添加折扣" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>   
                </xpath>
                <xpath expr="//field[@name='reference']" position="after">
                    <field name="invoice_company"/>
                    <!-- <field name="invoice_number"/> -->
                    <field name="payment_rule"/>
                    <field name="pay_rate"/>
                    <field name="minus_amount"/>
                    <field name="invoice_acc_total"/>
                    <field name="invoice_state"/>
                </xpath>
                <xpath expr="//field[@name='state']" position="attributes">
                    <attribute name="statusbar_visible">draft,teller,open,paid</attribute>
                </xpath>
                <xpath expr="/form/sheet/notebook/page[@name='other_info']" position="after">
                    <page string="发票记录">
                        <field name="payrecord_line">
                            <tree string="发票记录" editable="bottom">
                                <field name="invoice_number"/>
                                <field name="invoice_datetime"/>
                                <field name="pay_amount"/>
                                <field name="pay_datetime"/>                           
                                <field name="pay_user"/>
                            </tree>
                        </field>
                        <group class="oe_subtotal_footer oe_right">
                            <field name="invoice_acc_total" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator" />
                        </group>
                    </page>
                </xpath>                      
            </field>
        </record>
<!-- sale invoice -->
        <record id="acccustomer_view_order_form_inherit" model="ir.ui.view">
            <field name="name">acc.account.invoice.customer.form</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form"/>
            <field name="arch" type="xml">
                <!-- <xpath expr="//button[@name='action_invoice_open']" position="before">
                    <button name="teller_accept" string="出纳审核" type="object" states="open" class="oe_highlight" groups="acct_base.acc_account_user_group"/>   
                </xpath> -->
                <xpath expr="//button[@name='action_invoice_sent'][1]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_invoice_sent'][2]" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='preview_invoice']" position="attributes">
                    <attribute name="invisible">1</attribute>
                </xpath>
                <xpath expr="//button[@name='action_invoice_open']" position="before">
                    <button name="boss_accept" string="财务审核" type="object" states="teller" class="oe_highlight" groups="acct_base.acc_account_user_group"/>   
                </xpath>
                <xpath expr="//button[@name='action_invoice_open']" position="before">
                    <button name="%(update_date_wizard)d" states="open" type="action" string="更新到期日期" class="oe_highlight"/>
                </xpath>
                <xpath expr="//button[@name='action_invoice_open']" position="after">
                    <button name="add_sale_discount_line" string="添加折扣" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>   
                </xpath>
                <!-- <xpath expr="//button[@name='action_invoice_open']" position="after">
                    <button name="get_poqty" string="获取订购数量" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>   
                </xpath> -->
                <xpath expr="//field[@name='date_invoice']" position="attributes">
                    <attribute name="string">制单日期</attribute>
                </xpath>
                <xpath expr="//field[@name='payment_term_id']" position="after">
                    <field name="invoice_company"/>
                    <!-- <field name="sale_invoice_number"/> -->
                    <field name="sale_invoice_date"/>
                    <field name="acct_note"/>
                    <field name="invoice_acc_total"/>
                </xpath>
                <xpath expr="//field[@name='state']" position="attributes">
                    <attribute name="statusbar_visible">draft,teller,open,paid</attribute>
                </xpath>
                <xpath expr="/form/sheet/notebook/page[@name='other_info']" position="after">
                    <page string="发票记录">
                        <field name="payrecord_line">
                            <tree string="发票记录" editable="bottom">
                                <field name="invoice_number"/>
                                <field name="pay_amount"/>
                                <field name="pay_datetime"/>                           
                                <field name="pay_user"/>
                            </tree>
                        </field>
                        <group class="oe_subtotal_footer oe_right">
                            <field name="invoice_acc_total" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"/>
                        </group>
                    </page>
                </xpath>                      
            </field>
        </record>

        <!-- 账单增加搜索条件视图 -->
        <record id="acc_account_invoice_search_inherit_view" model="ir.ui.view">
            <field name="name">acc.account.invoice.search</field>
            <field name="model">account.invoice</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="account.view_account_invoice_filter"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='user_id']" position="after">
                    <separator/>
                    <!-- <filter name="state" string="未到货" domain="[('state','=', 'draft')]"/> -->
                    <!-- <filter string="My Activities" name="activities_my" domain="[('activity_ids.user_id', '=', uid)]"/>
                    <separator/> -->
                    <filter string="逾期账单" name="activities_overdue" domain="[('date_due', '&lt;', context_today().strftime('%Y-%m-%d'))]"/>
                    <filter string="今日到期账单" name="activities_today" domain="[('date_due', '=', context_today().strftime('%Y-%m-%d'))]"/>
                    <filter string="本月到期账单" name="month"
                        domain="[('date_due','&gt;=', time.strftime('%Y-%m-01')),('date_due','&lt;',  (context_today() + relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
                    <!-- <filter string="Future Activities" name="activities_upcoming_all" domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))                         ]"/> -->
                </xpath>
            </field>
        </record>
    </data>
</openerp>