~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to account_override/account_invoice_view.xml

  • Committer: Quentin THEURET
  • Date: 2011-11-30 13:31:37 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: qt@tempo-consulting.fr-20111130133137-mdf2fp6hkqmwbppn
UF-647 [ADD] Added a line in Purchase Order to have information about international transport costs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="utf-8"?>
2
 
<openerp>
3
 
    <data>
4
 
 
5
 
    <!--
6
 
        Invoice Lines
7
 
    -->
8
 
        <record id="invoice_line_form_2" model="ir.ui.view">
9
 
            <field name="name">account.invoice.line.form.2</field>
10
 
            <field name="model">account.invoice.line</field>
11
 
            <field name="type">tree</field>
12
 
            <field name="inherit_id" ref="account.view_invoice_line_tree"/>
13
 
            <field name="arch" type="xml">
14
 
                <data>
15
 
                    <xpath expr="/tree/field[@name='name']" position="before">
16
 
                        <field name="line_number"/>
17
 
                        <field name="is_corrected" invisible="1"/>
18
 
                        <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/>
19
 
                    </xpath>
20
 
                </data>
21
 
            </field>
22
 
        </record>
23
 
 
24
 
    <!--
25
 
        Supplier Invoice
26
 
    -->
27
 
        <record id="invoice_supplier_form_3" model="ir.ui.view">
28
 
            <field name="name">account.invoice.supplier.form.3</field>
29
 
            <field name="model">account.invoice</field>
30
 
            <field name="type">form</field>
31
 
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
32
 
            <field name="priority">20</field>
33
 
            <field name="arch" type="xml">
34
 
                <data>
35
 
                    <xpath expr="/form/notebook/page[@string='Invoice']/field[@name='account_id']" position="attributes">
36
 
                        <attribute name="domain">[('company_id', '=', company_id), ('restricted_area', '=', 'in_invoice')]</attribute>
37
 
                    </xpath>
38
 
                    <xpath expr="//tree[@string='Invoice lines']/field[@name='product_id']" position="before">
39
 
                        <field name="line_number"/>
40
 
                    </xpath>
41
 
                    <xpath expr="//field[@name='date_invoice']" position="before">
42
 
                        <field name="document_date"/>
43
 
                    </xpath>
44
 
                    <xpath expr="//field[@name='period_id']" position="replace">
45
 
                    </xpath>
46
 
                    <xpath expr="//label[@string='(keep empty to use the current period)']" position="replace">
47
 
                    </xpath>
48
 
                    <button name='invoice_open' position="after">
49
 
                        <button name="button_split_invoice" states="draft,proforma2" type="object" string="Split Invoice" icon="gtk-cut"/>
50
 
                    </button>
51
 
               </data>
52
 
            </field>
53
 
        </record>
54
 
 
55
 
    <!-- Change account_id domain -->
56
 
        <record id="invoice_line_form3" model="ir.ui.view">
57
 
            <field name="name">account.invoice.line.form</field>
58
 
            <field name="model">account.invoice.line</field>
59
 
            <field name="type">form</field>
60
 
            <field name="priority" eval="20"/>
61
 
            <field name="inherit_id" ref="account.view_invoice_line_form"/>
62
 
            <field name="arch" type="xml">
63
 
              <xpath expr="//field[@name='account_id']" position="attributes">
64
 
                  <attribute name="domain">[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('restricted_area', '=', 'invoice_lines')]</attribute>
65
 
              </xpath>
66
 
            </field>
67
 
        </record>
68
 
 
69
 
    <!--
70
 
        Delete some field from account_invoice tree:
71
 
        - Salesman or User (user_id)
72
 
        - Total amount (amount_total)
73
 
        - Untaxed (amount_untaxed)
74
 
        Add some elements:
75
 
        - Document date
76
 
    -->
77
 
        <record id="inherit_invoice_tree" model="ir.ui.view">
78
 
            <field name="name">inherit.invoice.tree</field>
79
 
            <field name="model">account.invoice</field>
80
 
            <field name="type">tree</field>
81
 
            <field name="inherit_id" ref="account.invoice_tree"/>
82
 
            <field name="priority">17</field>
83
 
            <field name="arch" type="xml">
84
 
                <data>
85
 
                    <xpath expr="/tree/field[@name='date_invoice']" position="before">
86
 
                        <field name="document_date"/>
87
 
                    </xpath>
88
 
                    <xpath expr="/tree/field[@name='user_id']" position="replace">
89
 
                    </xpath>
90
 
                    <xpath expr="/tree/field[@name='amount_untaxed']" position="replace">
91
 
                    </xpath>
92
 
                    <xpath expr="/tree/field[@name='residual']" position="attributes">
93
 
                        <attribute name="sum"></attribute>
94
 
                    </xpath>
95
 
                    <xpath expr="/tree/field[@name='amount_total']" position="attributes">
96
 
                        <attribute name="sum"></attribute>
97
 
                    </xpath>
98
 
                </data>
99
 
            </field>
100
 
        </record>
101
 
 
102
 
    <!--
103
 
        Delete some element from Search views:
104
 
        - Salesman or user (user_id)
105
 
        - Total (amount_total)
106
 
        - Responsible button (group by)
107
 
        - Proforma button
108
 
        - Invoices button
109
 
        - Unpaid button
110
 
        And add some ones:
111
 
        - Open button
112
 
        - Paid button
113
 
    -->
114
 
        <record id="inherit_view_account_invoice_filter" model="ir.ui.view">
115
 
            <field name="name">inherit.view.account.invoice.filter</field>
116
 
            <field name="model">account.invoice</field>
117
 
            <field name="type">search</field>
118
 
            <field name="inherit_id" ref="account.view_account_invoice_filter"/>
119
 
            <field name="priority">17</field>
120
 
            <field name="arch" type="xml">
121
 
                <data>
122
 
                    <xpath expr="/search/group[1]/filter[@name='proforma']" position="replace">
123
 
                    </xpath>
124
 
                    <xpath expr="/search/group[1]/filter[@name='invoices']" position="replace">
125
 
                    </xpath>
126
 
                    <xpath expr="/search/group[1]/filter[@name='unpaid']" position="attributes">
127
 
                      <attribute name="string">Open</attribute>
128
 
                      <attribute name="help">Open Invoices</attribute>
129
 
                    </xpath>
130
 
                    <xpath expr="/search/group[1]/field[@name='user_id']" position="replace">
131
 
                    </xpath>
132
 
                    <xpath expr="/search/group[3]/filter[@string='Responsible']" position="replace">
133
 
                    </xpath>
134
 
                    <xpath expr="/search/group[1]/separator[1]" position="replace">
135
 
                    </xpath>
136
 
                    <xpath expr="/search/group[1]/filter[@name='unpaid']" position="after">
137
 
                        <filter name="paid" icon="terp-dolar" string="Paid" domain="[('state', '=', 'paid')]"/>
138
 
                    </xpath>
139
 
                </data>
140
 
            </field>
141
 
        </record>
142
 
 
143
 
    <!--
144
 
        Delete some elements from Stock transfer voucher (customer invoices):
145
 
        - period_id
146
 
        - label with "keep empty…"
147
 
        Add some others elements:
148
 
        - document_date
149
 
    -->
150
 
        <record id="invoice_form_4" model="ir.ui.view">
151
 
            <field name="name">account.invoice.supplier.form.4</field>
152
 
            <field name="model">account.invoice</field>
153
 
            <field name="type">form</field>
154
 
            <field name="inherit_id" ref="account.invoice_form"/>
155
 
            <field name="priority">22</field>
156
 
            <field name="arch" type="xml">
157
 
                <data>
158
 
                    <xpath expr="//field[@name='date_invoice']" position="before">
159
 
                        <field name="document_date"/>
160
 
                    </xpath>
161
 
                    <xpath expr="//field[@name='period_id']" position="replace">
162
 
                    </xpath>
163
 
                    <xpath expr="//label[@string='(keep empty to use the current period)']" position="replace">
164
 
                    </xpath>
165
 
                </data>
166
 
            </field>
167
 
        </record>
168
 
 
169
 
    <!-- Delete payment lines link from invoices -->
170
 
        <delete model="ir.actions.act_window" search="[('name', 'ilike', '%Payment Lines%')]"/>
171
 
 
172
 
    <!-- Add Split Invoice Button on invoices -->
173
 
        <record id="invoice_form_3" model="ir.ui.view">
174
 
            <field name="name">account.invoice.form.3</field>
175
 
            <field name="model">account.invoice</field>
176
 
            <field name="type">form</field>
177
 
            <field name="inherit_id" ref="account.invoice_form"/>
178
 
            <field name="priority">40</field>
179
 
            <field name="arch" type="xml">
180
 
                <button name='invoice_open' position="after">
181
 
                    <button name="button_split_invoice" states="draft,proforma2" type="object" string="Split Invoice" icon="gtk-cut"/>
182
 
                </button>
183
 
            </field>
184
 
        </record>
185
 
 
186
 
        <!--
187
 
            Debit Note views
188
 
        -->
189
 
 
190
 
        <!-- Debit note list -->
191
 
        <record id="view_debit_note_tree" model="ir.ui.view">
192
 
            <field name="name">Debit Note</field>
193
 
            <field name="model">account.invoice</field>
194
 
            <field name="type">tree</field>
195
 
            <field name="priority">19</field>
196
 
            <field name="arch" type="xml">
197
 
                <tree string="Note" colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')">
198
 
                    <field name="document_date"/>
199
 
                    <field name="date_invoice"/>
200
 
                    <field name="number"/>
201
 
                    <field name="partner_id"/>
202
 
                    <field name="name"/>
203
 
                    <field name="date_due"/>
204
 
                    <field name="origin"/>
205
 
                    <field name="currency_id"/>
206
 
                    <field name="residual"/>
207
 
                    <field name="amount_total"/>
208
 
                    <field name="state"/>
209
 
                </tree>
210
 
            </field>
211
 
        </record>
212
 
 
213
 
        <!-- Debit Note form -->
214
 
        <record id="view_debit_note_form" model="ir.ui.view">
215
 
            <field name="name">debit.note.form</field>
216
 
            <field name="model">account.invoice</field>
217
 
            <field name="type">form</field>
218
 
            <field name="priority">60</field>
219
 
            <field name="arch" type="xml">
220
 
                <form string="Debit Note" hide_duplicate_button="1">
221
 
                    <group colspan="4" col="8">
222
 
                        <field name="journal_id" domain="[('is_current_instance','=',True)]" on_change="onchange_journal_id(journal_id)"/>
223
 
                        <field name="number"/>
224
 
                        <field name="type" invisible="1"/>
225
 
                        <field name="currency_id" width="50"/>
226
 
                        <button name="%(account.action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" />
227
 
                        <newline/>
228
 
                        <field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'search_default_customer': 1}"/>
229
 
                        <field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
230
 
                        <newline/>
231
 
                        <field name="document_date"/>
232
 
                        <field name="date_invoice"/>
233
 
                    </group>
234
 
                    <group colspan="4" col="8">
235
 
                        <button name="button_debit_note_import_invoice" string="Import invoice" states="draft" type="object" icon="gtk-save-as" colspan="2"
236
 
                            help="Import invoice that come from the default account given in Company configuration ('Import invoice default account for Debit Note')"/>
237
 
                        <group colspan="2"/>
238
 
                    </group>
239
 
                    <notebook colspan="4">
240
 
                        <page string="Invoice">
241
 
                            <field domain="[('company_id', '=', company_id), ('restricted_area', '=', 'out_invoice')]" name="account_id" />
242
 
                            <field name="name"/>
243
 
                            <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list">
244
 
                                <tree editable="top" string="Invoice Line" noteditable="1" hide_new_button="1">
245
 
                                    <field name="name"/>
246
 
                                    <field name="account_id" domain="[('restricted_area', '=', 'invoice_lines')]"/>
247
 
                                    <field name="quantity"/>
248
 
                                    <field name="uos_id" string="UoM"/>
249
 
                                    <field name="price_unit"/>
250
 
                                    <field name="price_subtotal"/>
251
 
                                    <field name="inactive_product" invisible="1" />
252
 
                                    <field name="inactive_error" invisible="1" />
253
 
                                </tree>
254
 
                            </field>
255
 
                            <group col="8" colspan="4">
256
 
                                <label string="" colspan="3"/>
257
 
                                <field name="reconciled"/>
258
 
                                <field name="amount_total"/>
259
 
                                <label string="" colspan="3"/>
260
 
                                <field name="state"/>
261
 
                                <field name="residual"/>
262
 
                            </group>
263
 
                            <group col="8" colspan="4">
264
 
                                <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
265
 
                                <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
266
 
                                <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
267
 
                                <button name="invoice_open" type="object" states="draft,proforma2" string="Validate" icon="gtk-go-forward"/>
268
 
                                <button name="%(account.account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/>
269
 
                            </group>
270
 
                        </page>
271
 
                        <page string="Other Info">
272
 
                            <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
273
 
                            <newline/>
274
 
                            <field name="date_due"/>
275
 
                            <field name="user_id"/>
276
 
                            <newline/>
277
 
                            <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id" />
278
 
                            <field name="origin"/>
279
 
                            <field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id" />
280
 
                            <field name="move_id" />
281
 
                            <separator colspan="4" string="Additional Information"/>
282
 
                            <field colspan="4" name="comment" nolabel="1"/>
283
 
                        </page>
284
 
                        <page string="Payments">
285
 
                            <field name="payment_ids" colspan="4" nolabel="1">
286
 
                                <tree string="Payments">
287
 
                                    <field name="date"/>
288
 
                                    <field name="ref"/>
289
 
                                    <field name="name"/>
290
 
                                    <field name="journal_id" />
291
 
                                    <field name="debit"/>
292
 
                                    <field name="credit"/>
293
 
                                    <field name="amount_currency"/>
294
 
                                    <field name="currency_id"/>
295
 
                                </tree>
296
 
                            </field>
297
 
                        </page>
298
 
                    </notebook>
299
 
                </form>
300
 
            </field>
301
 
        </record>
302
 
 
303
 
        <!--
304
 
            In-kind Donation views
305
 
        -->
306
 
 
307
 
        <!-- In-kind Donation list -->
308
 
        <record id="view_inkind_donation_tree" model="ir.ui.view">
309
 
            <field name="name">inkind.donation.form</field>
310
 
            <field name="model">account.invoice</field>
311
 
            <field name="type">tree</field>
312
 
            <field name="priority">19</field>
313
 
            <field name="arch" type="xml">
314
 
                <tree string="In-kind Donation" colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')" hide_new_button="1">
315
 
                    <field name="document_date" />
316
 
                    <field name="date_invoice"/>
317
 
                    <field name="number"/>
318
 
                    <field name="partner_id"/>
319
 
                    <field name="name"/>
320
 
                    <field name="origin"/>
321
 
                    <field name="currency_id"/>
322
 
                    <field name="amount_total"/>
323
 
                    <field name="state"/>
324
 
                </tree>
325
 
            </field>
326
 
        </record>
327
 
 
328
 
        <!-- In-kind Donation form -->
329
 
        <record id="view_inkind_donation_form" model="ir.ui.view">
330
 
            <field name="name">inkind.donation.form</field>
331
 
            <field name="model">account.invoice</field>
332
 
            <field name="type">form</field>
333
 
            <field name="priority">63</field>
334
 
            <field name="arch" type="xml">
335
 
                <form string="In-kind Donation" hide_duplicate_button="1">
336
 
                    <group colspan="4" col="8">
337
 
                        <field name="journal_id" domain="[('is_current_instance','=',True)]" on_change="onchange_journal_id(journal_id)" widget="selection"/>
338
 
                        <field name="number"/>
339
 
                        <field name="type" invisible="1"/>
340
 
                        <field name="is_inkind_donation" invisible="1"/>
341
 
                        <field name="currency_id" width="50"/>
342
 
                        <button name="%(account.action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" />
343
 
                        <newline/>
344
 
                        <field string="Donor" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id, is_inkind_donation)" context="{'search_default_customer': 1}"/>
345
 
                        <field domain="[('partner_id','=',partner_id)]" name="address_invoice_id" string="Address"/>
346
 
                        <newline/>
347
 
                        <field name="document_date"/>
348
 
                        <field name="date_invoice" />
349
 
                        <newline/>
350
 
                        <group colspan="8" col="8" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}">
351
 
                          <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
352
 
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
353
 
                        </group>
354
 
                        <group colspan="8" col="8" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}">
355
 
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
356
 
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
357
 
                        </group>
358
 
                        <newline/>
359
 
                        <field name="analytic_distribution_id" invisible="1"/>
360
 
                        <group colspan="2"/>
361
 
                        <field name="company_id" invisible="1"/>
362
 
                    </group>
363
 
                    <notebook colspan="4">
364
 
                        <page string="Invoice">
365
 
                            <field invisible="1" domain="[('company_id', '=', company_id), ('restricted_area', '=', 'donation_header')]" name="account_id"/>
366
 
                            <field name="fake_account_id" domain="[('company_id', '=', company_id), ('restricted_area', '=', 'donation_header')]"/>
367
 
                            <field name="reference_type" nolabel="1" size="0"/>
368
 
                            <field name="reference" nolabel="1"/>
369
 
                            <field name="name"/>
370
 
                            <field name="origin"/>
371
 
                            <newline/>
372
 
                            <label string="" colspan="2"/>
373
 
                            <field name="check_total" required="2"/>
374
 
                            <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list">
375
 
                                <tree editable="top" string="Donation Lines" noteditable="1" hide_new_button="1">
376
 
                                    <field name="line_number"/>
377
 
                                    <field name="is_corrected" invisible="1"/>
378
 
                                    <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/>
379
 
                                    <field name="product_id"/>
380
 
                                    <field name="account_id" domain="[('restricted_area', '=', 'donation_lines')]"/>
381
 
                                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection"
382
 
                                        context="{'d_journal_id': parent.journal_id , 'd_partner_id': parent.partner_id, 'd_address_invoice_id':parent.address_invoice_id,'d_date_invoice': parent.date_invoice, 'd_register_posting_date': parent.register_posting_date, 'd_account_id': parent.account_id, 'd_partner_bank_id': parent.partner_bank_id, 'd_payment_term': parent.payment_term, 'd_name': parent.name, 'd_origine': parent.origin, 'd_address_contact_id': parent.address_contact_id, 'd_user_id': parent.user_id, 'd_comment': parent.comment}"
383
 
                                        />
384
 
                                    <field name="analytic_distribution_state_recap" attrs="{'invisible': [('is_allocatable', '=', False)]}"/>
385
 
                                    <field name="analytic_distribution_state" invisible="1"/>
386
 
                                    <field name="have_analytic_distribution_from_header" invisible="1"/>
387
 
                                    <field name="quantity"/>
388
 
                                    <field name="price_unit"/>
389
 
                                    <field name="price_subtotal"/>
390
 
                                    <field name="name"/>
391
 
                                    <field name="inactive_product" invisible="1" />
392
 
                                    <field name="inactive_error" invisible="1" />
393
 
                                </tree>
394
 
                            </field>
395
 
                            <group col="8" colspan="4">
396
 
                                <label string="" colspan="2"/>
397
 
                                <field name="have_donation_certificate" invisible="1"/>
398
 
                                <button name="button_donation_certificate" type="object" string="No Donation certificate" icon="terp-mail-replied" readonly="1" attrs="{'invisible': [('have_donation_certificate', '!=', False)]}"/>
399
 
                                <button name="button_donation_certificate" type="object" string="Donation certificate" icon="terp-mail-replied" attrs="{'invisible': [('have_donation_certificate', '=', False)]}"/>
400
 
                                <field name="state"/>
401
 
                                <field name="amount_total"/>
402
 
                            </group>
403
 
                            <group col="2" colspan="4" states="draft">
404
 
                                <label string=""/>
405
 
                                <button name="invoice_open" type="object" states="draft" string="Validate" icon="gtk-go-forward"/>
406
 
                            </group>
407
 
                            <group col="2" colspan="4" states="open,paid">
408
 
                                <button name="invoice_cancel" states="open" string="Cancel" icon="gtk-cancel" confirm="Do you confirm Donation received cancellation?"/>
409
 
                                <button name="%(account.account_invoices)d" string="Print Donation" type="action" icon="gtk-print" states="open,paid"/>
410
 
                            </group>
411
 
                        </page>
412
 
                    </notebook>
413
 
                </form>
414
 
            </field>
415
 
        </record>
416
 
 
417
 
        <!--
418
 
            Intermission Voucher views
419
 
        -->
420
 
 
421
 
        <!-- Intermission Voucher list -->
422
 
        <record id="view_intermission_tree" model="ir.ui.view">
423
 
            <field name="name">intermission.tree</field>
424
 
            <field name="model">account.invoice</field>
425
 
            <field name="type">tree</field>
426
 
            <field name="priority">19</field>
427
 
            <field name="arch" type="xml">
428
 
                <tree string="Intermission Voucher" colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')">
429
 
                    <field name="document_date" string="I/MI voucher date"/>
430
 
                    <field name="date_invoice"/>
431
 
                    <field name="number"/>
432
 
                    <field name="partner_id"/>
433
 
                    <field name="name"/>
434
 
                    <field name="origin"/>
435
 
                    <field name="currency_id"/>
436
 
                    <field name="amount_total"/>
437
 
                    <field name="state"/>
438
 
                </tree>
439
 
            </field>
440
 
        </record>
441
 
 
442
 
        <!-- Intermission Voucher Form -->
443
 
        <record id="view_intermission_form" model="ir.ui.view">
444
 
            <field name="name">inkind.donation.form</field>
445
 
            <field name="model">account.invoice</field>
446
 
            <field name="type">form</field>
447
 
            <field name="priority">64</field>
448
 
            <field name="arch" type="xml">
449
 
                <form string="Intermission Voucher" hide_duplicate_button="1">
450
 
                    <group colspan="4" col="8">
451
 
                        <field name="fake_journal_id" domain="[('is_current_instance','=',True)]" widget="selection" />
452
 
                        <field name="number"/>
453
 
                        <field name="type" invisible="1"/>
454
 
                        <field name="is_intermission" invisible="1"/>
455
 
                        <field name="fake_currency_id"/>
456
 
                        <newline/>
457
 
                        <field string="Partner" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id, False, is_intermission)" domain="[('partner_type', '=', 'intermission')]"/>
458
 
                        <field domain="[('partner_id','=',partner_id)]" name="address_invoice_id" string="Partner address"/>
459
 
                        <newline/>
460
 
                        <field name="document_date" string="I/MI voucher date"/>
461
 
                        <field name="date_invoice"/>
462
 
                        <newline/>
463
 
                        <group colspan="8" col="8" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}">
464
 
                          <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-check" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '=', False)]}"/>
465
 
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
466
 
                        </group>
467
 
                        <group colspan="8" col="8" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}">
468
 
                            <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-emblem-important" context="context" colspan="4" attrs="{'invisible': [('analytic_distribution_id', '!=', False)]}"/>
469
 
                            <button name="button_reset_distribution" string="Reset AD at line level" type="object" icon="gtk-undelete" colspan="4"/>
470
 
                        </group>
471
 
                        <field name="analytic_distribution_id" invisible="1"/>
472
 
                        <group colspan="2"/>
473
 
                    </group>
474
 
                    <notebook colspan="4">
475
 
                        <page string="Invoice">
476
 
                            <field invisible="1" domain="[('company_id', '=', company_id), ('restricted_area', '=', 'intermission_header')]" name="account_id" />
477
 
                            <field name="fake_account_id" domain="[('restricted_area', '=', 'intermission_header')]"/>
478
 
                            <field name="name" string="Reference"/>
479
 
                            <newline/>
480
 
                            <field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list" context="{'is_intermission': True}">
481
 
                                <tree string="Intermission Voucher Lines">
482
 
                                    <field name="is_corrected" invisible="1"/>
483
 
                                    <button name="button_open_analytic_lines" string="Have been corrected" type="object" icon="terp-mail-" attrs="{'invisible': [('is_corrected', '=', False)]}"/>
484
 
                                    <field name="name"/>
485
 
                                    <field name="account_id" domain="[('restricted_area', '=', 'intermission_lines')]"/>
486
 
                                    <button name="button_analytic_distribution" string="Analytical Distribution" type="object" icon="terp-stock_symbol-selection"
487
 
                                        context="{'d_journal_id': parent.journal_id , 'd_partner_id': parent.partner_id, 'd_address_invoice_id':parent.address_invoice_id,'d_date_invoice': parent.date_invoice, 'd_register_posting_date': parent.register_posting_date, 'd_account_id': parent.account_id, 'd_partner_bank_id': parent.partner_bank_id, 'd_payment_term': parent.payment_term, 'd_name': parent.name, 'd_origine': parent.origin, 'd_address_contact_id': parent.address_contact_id, 'd_user_id': parent.user_id, 'd_comment': parent.comment, 'is_intermission': True}"
488
 
                                        />
489
 
                                    <field name="analytic_distribution_state_recap" attrs="{'invisible': [('is_allocatable', '=', False)]}"/>
490
 
                                    <field name="analytic_distribution_state" invisible="1"/>
491
 
                                    <field name="have_analytic_distribution_from_header" invisible="1"/>
492
 
                                    <field name="quantity"/>
493
 
                                    <field name="uos_id" string="UOM" invisible="1" />
494
 
                                    <field name="price_unit"/>
495
 
                                    <field name="price_subtotal"/>
496
 
                                    <field name="inactive_product" invisible="1" />
497
 
                                    <field name="inactive_error" invisible="1" />
498
 
                                </tree>
499
 
                                <form string="Intermission Voucher Lines">
500
 
                                    <notebook>
501
 
                                        <page string="Line">
502
 
                                            <field name="name"/>
503
 
                                            <field name="account_id" domain="[('restricted_area', '=', 'intermission_lines')]"/>
504
 
                                            <field name="quantity"/>
505
 
                                            <field name="uos_id" string="UOM" invisible="1"/>
506
 
                                            <field name="price_unit"/>
507
 
                                            <field name="price_subtotal"/>
508
 
                                        </page>
509
 
                                        <page string="Notes">
510
 
                                            <field name="note" nolabel="1" colspan="4"/>
511
 
                                        </page>
512
 
                                    </notebook>
513
 
                                </form>
514
 
                            </field>
515
 
                            <group col="8" colspan="4">
516
 
                                <label string="" colspan="3"/>
517
 
                                <field name="state"/>
518
 
                                <field name="amount_total"/>
519
 
                            </group>
520
 
                            <group col="2" colspan="4" states="draft">
521
 
                                <label string=""/>
522
 
                                <button name="invoice_open" type="object" states="draft" string="Validate" icon="gtk-go-forward"/>
523
 
                            </group>
524
 
                            <group col="2" colspan="4" states="open,paid">
525
 
                                <label string=""/>
526
 
                                <button name="%(account.account_invoices)d" string="Print Intermission Voucher" type="action" icon="gtk-print" states="open,paid"/>
527
 
                            </group>
528
 
                        </page>
529
 
                        <page string="Other Info">
530
 
                            <field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
531
 
                            <newline/>
532
 
                            <field name="date_due"/>
533
 
                            <field name="user_id"/>
534
 
                            <newline/>
535
 
                            <field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id" />
536
 
                            <field name="origin"/>
537
 
                            <field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id" />
538
 
                            <field name="move_id" />
539
 
                            <separator colspan="4" string="Additional Information"/>
540
 
                            <field colspan="4" name="comment" nolabel="1"/>
541
 
                        </page>
542
 
                    </notebook>
543
 
                </form>
544
 
            </field>
545
 
        </record>
546
 
 
547
 
        <!--
548
 
            Delete some elements on customer invoices:
549
 
            - fiscal_position field
550
 
            - proforma button (invoice_proforma2)
551
 
            - payment_term field
552
 
            - tax frame
553
 
            - compute tax button (button_reset_taxes)
554
 
            - amount untaxed field
555
 
            - amount tax field
556
 
            Update some other ones:
557
 
            - account_id field to add a domain on accounts regarding "ACCOUNT_RESTRICTED_AREA" variable
558
 
        -->
559
 
        <record id="inherit_invoice_form" model="ir.ui.view">
560
 
            <field name="name">inherit.invoice.form</field>
561
 
            <field name="model">account.invoice</field>
562
 
            <field name="type">form</field>
563
 
            <field name="inherit_id" ref="account.invoice_form"/>
564
 
            <field name="priority">61</field>
565
 
            <field name="arch" type="xml">
566
 
                <data>
567
 
                    <xpath expr="/form" position="attributes">
568
 
                        <attribute name="string">Stock Transfer Voucher</attribute>
569
 
                    </xpath>
570
 
                    <xpath expr="/form/notebook/page[@string='Invoice']/field[@name='account_id']" position="attributes">
571
 
                        <attribute name="domain">[('company_id', '=', company_id), ('restricted_area', '=', 'out_invoice')]</attribute>
572
 
                    </xpath>
573
 
                    <field name="fiscal_position" position="replace"/>
574
 
                    <field name="payment_term" position="replace"/>
575
 
                    <field name="tax_line" position="replace"/>
576
 
                    <button name="button_reset_taxes" position="replace"/>
577
 
                    <button name="invoice_proforma2" position="replace"/>
578
 
                    <xpath expr="/form/notebook/page[@string='Invoice']/group[2]" position="replace">
579
 
                        <group col="8" colspan="4">
580
 
                            <label string="" colspan="3"/>
581
 
                            <field name="reconciled"/>
582
 
                            <field name="amount_total"/>
583
 
                            <label string="" colspan="3"/>
584
 
                            <field name="state"/>
585
 
                            <field name="residual"/>
586
 
                            <field name="is_debit_note" invisible="1"/>
587
 
                        </group>
588
 
                        <group col="8" colspan="4">
589
 
                            <button name="invoice_cancel" states="proforma2,open" string="Cancel" icon="gtk-cancel"/>
590
 
                            <button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
591
 
                            <button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="base.group_no_one"/>
592
 
                            <button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-go-forward" type="object"/>
593
 
                            <button name="%(account.account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/>
594
 
                        </group>
595
 
                    </xpath>
596
 
                    <xpath expr="//page[@string='Payments']" position="replace">
597
 
                    </xpath>
598
 
                </data>
599
 
            </field>
600
 
        </record>
601
 
 
602
 
        <!--
603
 
            Debit note actions
604
 
        -->
605
 
 
606
 
        <!-- Display debit note list (only invoice that have 'is_debit_note' to True)-->
607
 
        <record id="action_debit_note" model="ir.actions.act_window">
608
 
            <field name="name">Debit Note</field>
609
 
            <field name="res_model">account.invoice</field>
610
 
            <field name="view_type">form</field>
611
 
            <field name="view_mode">tree,form,calendar,graph</field>
612
 
            <field eval="False" name="view_id"/>
613
 
            <field name="domain">[('type','=','out_invoice'), ('is_debit_note', '!=', False), ('is_inkind_donation', '=', False)]</field>
614
 
            <field name="context">{'type':'out_invoice', 'journal_type': 'sale', 'is_debit_note': True}</field>
615
 
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
616
 
        </record>
617
 
 
618
 
        <!-- Link between previous action and Debit Note tree view -->
619
 
        <record model="ir.actions.act_window.view" id="act_debit_note_tree">
620
 
            <field name="sequence" eval="5"/>
621
 
            <field name="view_mode">tree</field>
622
 
            <field name="view_id" ref="view_debit_note_tree"/>
623
 
            <field name="act_window_id" ref="action_debit_note"/>
624
 
        </record>
625
 
 
626
 
        <!-- Link between action and Debit Note form view -->
627
 
        <record model="ir.actions.act_window.view" id="act_debit_note_form">
628
 
            <field name="sequence" eval="10"/>
629
 
            <field name="view_mode">form</field>
630
 
            <field name="view_id" ref="view_debit_note_form"/>
631
 
            <field name="act_window_id" ref="action_debit_note"/>
632
 
        </record>
633
 
 
634
 
        <!-- Donation search view filter -->
635
 
        <record id="view_account_invoice_filter_donation" model="ir.ui.view">
636
 
            <field name="name">view.account.invoice.filter.donation</field>
637
 
            <field name="model">account.invoice</field>
638
 
            <field name="type">search</field>
639
 
            <field name="priority">20</field>
640
 
            <field name="arch" type="xml">
641
 
                <search string="Search Donation">
642
 
                   <group col="10" colspan="4">
643
 
                        <filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
644
 
                        <filter name="open" icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Invoices"/>
645
 
                        <filter name="cancelled" icon="terp-dialog-close" string="Cancelled" domain="[('state','=','cancel')]" help="Cancelled Invoices"/>
646
 
                        <separator orientation="vertical"/>
647
 
                        <field name="number"/>
648
 
                        <field name="partner_id"/>
649
 
                        <field name="origin"/>
650
 
                        <field name="amount_total"/>
651
 
                    </group>
652
 
                    <newline/>
653
 
                    <group col="10" colspan="4">
654
 
                        <field name="journal_id" widget="selection" select='1'/>
655
 
                        <field name="period_id" select='1' string="Period"/>
656
 
                    </group>
657
 
                    <newline/>
658
 
                    <group expand="0" string="Group By...">
659
 
                        <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
660
 
                        <separator orientation="vertical"/>
661
 
                        <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
662
 
                        <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]"  context="{'group_by':'state'}"/>
663
 
                        <separator orientation="vertical"/>
664
 
                        <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
665
 
                        <filter string="Posting Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_invoice'}"/>
666
 
                        <filter string="Due Date" icon="terp-go-month" domain="[]"  context="{'group_by':'date_due'}"/>
667
 
                    </group>
668
 
               </search>
669
 
            </field>
670
 
        </record>
671
 
 
672
 
        <!-- Display in-kind donation list (only invoice that have 'is_inkind_donation' to True)-->
673
 
        <record id="action_inkind_donation" model="ir.actions.act_window">
674
 
            <field name="name">Donation</field>
675
 
            <field name="res_model">account.invoice</field>
676
 
            <field name="view_type">form</field>
677
 
            <field name="view_mode">tree,form,calendar,graph</field>
678
 
            <field eval="False" name="view_id"/>
679
 
            <field name="domain">[('type','=','in_invoice'), ('is_debit_note', '=', False), ('is_inkind_donation', '=', True)]</field>
680
 
            <field name="context">{'type':'in_invoice', 'journal_type': 'inkind'}</field>
681
 
            <field name="search_view_id" ref="view_account_invoice_filter_donation"/>
682
 
        </record>
683
 
 
684
 
        <!-- Link between previous action and In-kind Donation tree view -->
685
 
        <record model="ir.actions.act_window.view" id="act_inkind_donation_tree">
686
 
            <field name="sequence" eval="6"/>
687
 
            <field name="view_mode">tree</field>
688
 
            <field name="view_id" ref="view_inkind_donation_tree"/>
689
 
            <field name="act_window_id" ref="action_inkind_donation"/>
690
 
        </record>
691
 
 
692
 
        <!-- Link between action and In-kind Donation form view -->
693
 
        <record model="ir.actions.act_window.view" id="act_inkind_donation_form">
694
 
            <field name="sequence" eval="11"/>
695
 
            <field name="view_mode">form</field>
696
 
            <field name="view_id" ref="view_inkind_donation_form"/>
697
 
            <field name="act_window_id" ref="action_inkind_donation"/>
698
 
        </record>
699
 
 
700
 
        <!-- Display Intermission voucher OUT -->
701
 
        <record id="action_intermission_out" model="ir.actions.act_window">
702
 
            <field name="name">Intermission Voucher OUT</field>
703
 
            <field name="res_model">account.invoice</field>
704
 
            <field name="view_type">form</field>
705
 
            <field name="view_mode">tree,form,calendar,graph</field>
706
 
            <field eval="False" name="view_id"/>
707
 
            <field name="domain">[('type','=','out_invoice'), ('is_debit_note', '=', False), ('is_inkind_donation', '=', False), ('is_intermission', '=', True)]</field>
708
 
            <field name="context">{'type':'out_invoice', 'journal_type': 'intermission', 'is_intermission': True, 'intermission_type': 'out'}</field>
709
 
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
710
 
        </record>
711
 
 
712
 
        <!-- Link between previous action and Intermission tree view -->
713
 
        <record model="ir.actions.act_window.view" id="act_intermission_tree_out">
714
 
            <field name="sequence" eval="5"/>
715
 
            <field name="view_mode">tree</field>
716
 
            <field name="view_id" ref="view_intermission_tree"/>
717
 
            <field name="act_window_id" ref="action_intermission_out"/>
718
 
        </record>
719
 
 
720
 
        <!-- Link between action and Intermission form view -->
721
 
        <record model="ir.actions.act_window.view" id="act_intermission_form_out">
722
 
            <field name="sequence" eval="10"/>
723
 
            <field name="view_mode">form</field>
724
 
            <field name="view_id" ref="view_intermission_form"/>
725
 
            <field name="act_window_id" ref="action_intermission_out"/>
726
 
        </record>
727
 
 
728
 
        <!-- Display Intermission voucher IN -->
729
 
        <record id="action_intermission_in" model="ir.actions.act_window">
730
 
            <field name="name">Intermission Voucher IN</field>
731
 
            <field name="res_model">account.invoice</field>
732
 
            <field name="view_type">form</field>
733
 
            <field name="view_mode">tree,form,calendar,graph</field>
734
 
            <field name="view_id" ref="view_intermission_form"/>
735
 
            <field name="domain">[('type','=','in_invoice'), ('is_debit_note', '=', False), ('is_inkind_donation', '=', False), ('is_intermission', '=', True)]</field>
736
 
            <field name="context">{'type':'in_invoice', 'journal_type': 'intermission', 'is_intermission': True, 'intermission_type': 'in'}</field>
737
 
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
738
 
        </record>
739
 
 
740
 
        <!-- Link between previous action and Intermission tree view -->
741
 
        <record model="ir.actions.act_window.view" id="act_intermission_tree_in">
742
 
            <field name="sequence" eval="5"/>
743
 
            <field name="view_mode">tree</field>
744
 
            <field name="view_id" ref="view_intermission_tree"/>
745
 
            <field name="act_window_id" ref="action_intermission_in"/>
746
 
        </record>
747
 
 
748
 
        <!-- Link between action and Intermission form view -->
749
 
        <record model="ir.actions.act_window.view" id="act_intermission_form_in">
750
 
            <field name="sequence" eval="10"/>
751
 
            <field name="view_mode">form</field>
752
 
            <field name="view_id" ref="view_intermission_form"/>
753
 
            <field name="act_window_id" ref="action_intermission_in"/>
754
 
        </record>
755
 
 
756
 
        <!-- Fix customer invoice display with a bypass on 'is_debit_note' set to True -->
757
 
        <record id="account.action_invoice_tree1" model="ir.actions.act_window">
758
 
            <field name="name">Customer Invoices</field>
759
 
            <field name="res_model">account.invoice</field>
760
 
            <field name="view_type">form</field>
761
 
            <field name="view_mode">tree,form,calendar,graph</field>
762
 
            <field eval="False" name="view_id"/>
763
 
            <field name="domain">[('type','=','out_invoice'), ('is_debit_note', '=', False), ('is_inkind_donation', '=', False), ('is_intermission', '=', False)]</field>
764
 
            <field name="context">{'type':'out_invoice', 'journal_type': 'sale'}</field>
765
 
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
766
 
            <field name="help">With Customer Invoices you can create and manage sales invoices issued to your customers. OpenERP can also generate draft invoices automatically from sales orders or deliveries. You should only confirm them before sending them to your customers.</field>
767
 
        </record>
768
 
 
769
 
        <!-- Fix supplier invoice display with a bypass on 'is_inkind_donation' set to True -->
770
 
        <record id="account.action_invoice_tree2" model="ir.actions.act_window">
771
 
            <field name="name">Supplier Invoices</field>
772
 
            <field name="res_model">account.invoice</field>
773
 
            <field name="view_type">form</field>
774
 
            <field name="view_mode">tree,form,calendar,graph</field>
775
 
            <field eval="False" name="view_id"/>
776
 
            <field name="domain">[('type','=','in_invoice'), ('is_direct_invoice', '=', False), ('is_inkind_donation', '=', False), ('is_debit_note', "=", False), ('is_intermission', '=', False)]</field>
777
 
            <field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
778
 
            <field name="search_view_id" ref="account.view_account_invoice_filter"/>
779
 
            <field name="help">With Supplier Invoices you can enter and manage invoices issued by your suppliers.
780
 
                OpenERP can also generate draft invoices automatically from purchase orders or receipts. This way, you can control the invoice
781
 
                from your supplier according to what you purchased or received.</field>
782
 
        </record>
783
 
 
784
 
        <!--
785
 
            Debit Note Menu
786
 
        -->
787
 
 
788
 
        <!-- Debit Note Menu in "Customer Invoices" -->
789
 
        <menuitem action="action_debit_note" id="menu_action_debit_note" parent="account.menu_finance_receivables" sequence="10"/>
790
 
 
791
 
        <!-- In-kind Donation Menu in "Supplier Invoices" -->
792
 
        <menuitem action="action_inkind_donation" id="menu_action_inkind_donation" parent="account.menu_finance_payables" sequence="11"/>
793
 
 
794
 
        <!-- Intermission Voucher OUT in "Customer Invoices" -->
795
 
        <menuitem action="action_intermission_out" id="menu_action_intermission_out" parent="account.menu_finance_receivables" sequence="10"/>
796
 
 
797
 
        <!-- Intermission Voucher IN in "Supplier Invoices" -->
798
 
        <menuitem action="action_intermission_in" id="menu_action_intermission_in" parent="account.menu_finance_payables" sequence="12"/>
799
 
 
800
 
        <!--
801
 
            Account invoice report redefinition
802
 
        -->
803
 
 
804
 
        <report
805
 
            auto="False"
806
 
            id="account.account_invoices"
807
 
            model="account.invoice"
808
 
            name="account.invoice2"
809
 
            rml="account_override/report/account_print_invoice.rml"
810
 
            string="Print report"
811
 
            target_filename="${eval(_get_invoice_report_name)}"
812
 
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
813
 
            attachment_use="1"
814
 
            multi="True"/>
815
 
 
816
 
    </data>
817
 
</openerp>