~vauxoo/addons-vauxoo/6.0-trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record model="ir.actions.act_window" id="act_attach_invoice_to_expense_wizard">
            <field name="name">Attach to Expense</field>
            <field name="res_model">attach.invoice.to.expense.wizard</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>
        </record>

        <record model="ir.values" id="action_batch_attach_invoices_to_expense">
            <field name="model_id" ref="account.model_account_invoice" />
            <field name="name">Attach to Expense</field>
            <field name="key2">client_action_multi</field>
            <field name="value" eval="'ir.actions.act_window,' + str(ref('act_attach_invoice_to_expense_wizard'))" />
            <field name="key">action</field>
            <field name="model">account.invoice</field>
        </record>

        <record id="attach_invoice_to_expense_view" model="ir.ui.view">
            <field name="name">attach.invoice.to.expense.view</field>
            <field name="model">attach.invoice.to.expense.wizard</field>
            <field name="arch" type="xml">
                <form string="Attach invoice to an Expense" version="7.0">
                    <group colspan="4" col="4">
                        <separator string="Expense"/>
                        <newline/>
                        <field name="expense_id" nolabel="1" domain="[('state','=','draft')]"/>
                        <footer>
                            <p class="oe_view_nocontent">
                                Note: It you already have an expense asociated to the invoice, this wizard will replace the previews expense link and add a new relationship to the expense
                                specified below. If you want to unlink an already related expense only needs to run this wizard with expense field no filled. 
                            </p>

                        
                            <button string="Add" type="object" name="add_expense" class="oe_highlight"/>
                            or
                            <button string="Cancel" type="special" special="cancel" class="oe_link" icon="terp-gtk-stop"/>

                        </footer>
                    </group>
                </form>
            </field>
        </record>

    </data>
</openerp>