[MERGE] [FIX] models: do not drop low level columns (aka 'magic columns') when deleti...
[odoo/odoo.git] / addons / account_voucher / account_voucher_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4         <record model="ir.ui.view" id="view_voucher_tree">
5             <field name="name">account.voucher.tree</field>
6             <field name="model">account.voucher</field>
7             <field name="arch" type="xml">
8                 <tree colors="blue:state == 'draft';gray:state == 'cancel';red:audit" string="Voucher Entries">
9                     <field name="date"/>
10                     <field name="number"/>
11                     <field name="reference"/>
12                     <field name="partner_id"/>
13                     <field name="journal_id" groups="account.group_account_user"/>
14                     <field name="period_id" invisible="context.get('visible', True)"/>
15                     <field name="type" invisible="context.get('visible', True)"/>
16                     <field name="amount" sum="Total Amount"/>
17                     <field name="audit" invisible="1"/>
18                     <field name="state"/>
19                 </tree>
20             </field>
21         </record>
22         <record model="ir.ui.view" id="view_voucher_line_form">
23             <field name="name">account.voucher.line.form</field>
24             <field name="model">account.voucher.line</field>
25             <field name="arch" type="xml">
26                 <form string="Voucher Lines" version="7.0">
27                     <group col="4">
28                         <field name="name"/>
29                         <field name="account_id"/>
30                         <field name="partner_id"/>
31                         <field name="amount"/>
32                     </group>
33                 </form>
34             </field>
35         </record>
36
37         <!-- This general view is used in 
38              Invoicing - Journal Entries - Journal Vouchers -->
39         <record model="ir.ui.view" id="view_voucher_form">
40             <field name="name">account.voucher.form</field>
41             <field name="model">account.voucher</field>
42             <field name="arch" type="xml">
43                 <form string="Accounting Voucher" version="7.0">
44                   <header>
45                       <button name="proforma_voucher" string="Post" states="draft" class="oe_highlight"/>
46                       <button name="cancel_voucher" string="Cancel Voucher" type="object" states="posted" confirm="Are you sure you want to unreconcile this record?"/>
47                       <button name="cancel_voucher" string="Cancel Voucher" states="draft,proforma" />
48                       <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
49                       <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
50                   </header>
51                   <sheet string="Accounting Voucher">
52                     <group col="4" colspan="4">
53                         <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
54                         <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
55                         <field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
56                         <field name="type" required="1"/>
57                         <field name="name" colspan="2"/>
58                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
59                         <field name="reference"/>
60                         <field name="number"/>
61                         <field name="currency_id" groups="base.group_multi_currency"/>
62                         <field name="account_id" widget="selection" invisible="True"/>
63                         <field name="payment_rate_currency_id" invisible="1"/>
64                     </group>
65                     <notebook colspan="4">
66                         <page string="Voucher Entry">
67                             <field name="line_ids" on_change="onchange_price(line_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
68                                 <tree string="Voucher Items" editable="bottom">
69                                     <field name="account_id"/>
70                                     <field name="name"/>
71                                     <field name="amount" sum="Total Amount"/>
72                                     <field name="type"/>
73                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
74                                 </tree>
75                             </field>
76                             <group>
77                                 <field name="narration" nolabel="1" placeholder="Internal Notes"/>
78                                 <group class="oe_subtotal_footer oe_right" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
79                                     <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection" nolabel="1"/>
80                                     <field name="tax_amount" nolabel="1"/>
81                                     <div class="oe_subtotal_footer_separator">
82                                         <label for="amount"/>
83                                         <button type="object" icon="terp-stock_format-scientific"   name="compute_tax" class="oe_link oe_edit_only" string="(Update)" attrs="{'invisible': [('state','!=','draft')]}"/>
84                                     </div>
85                                     <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
86                                 </group>
87                             </group>
88                         </page>
89                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
90                             <group col="4">
91                                 <field name="period_id"/>
92                                 <field name="audit"/>
93                             </group>
94                             <field name="move_ids" readonly="1">
95                                <tree string="Journal Items">
96                                    <field name="move_id"/>
97                                    <field name="ref"/>
98                                    <field name="date"/>
99                                    <field name="statement_id"/>
100                                    <field name="partner_id"/>
101                                    <field name="account_id"/>
102                                    <field name="name"/>
103                                    <field name="debit"/>
104                                    <field name="credit"/>
105                                    <field name="state"/>
106                                    <field name="reconcile_id"/>
107                                </tree>
108                             </field>
109                         </page>
110                     </notebook>
111                   </sheet>
112                   <div class="oe_chatter">
113                       <field name="message_follower_ids" widget="mail_followers"/>
114                       <field name="message_ids" widget="mail_thread"/>
115                   </div>
116                 </form>
117             </field>
118         </record>
119
120         <record id="view_voucher_filter" model="ir.ui.view">
121             <field name="name">account.voucher.select</field>
122             <field name="model">account.voucher</field>
123             <field name="priority">1</field>
124             <field name="arch" type="xml">
125                 <search string="Search Vouchers">
126                     <field name="number" string="Voucher"/>
127                     <field name="date"/>
128                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
129                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
130                     <separator/>
131                     <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/>
132                     <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
133                     <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" /> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
134                     <field name="period_id"/>
135                     <group expand="0" string="Group By...">
136                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
137                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
138                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
139                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
140                     </group>
141                 </search>
142             </field>
143         </record>
144
145         <record id="account_cash_statement_graph" model="ir.ui.view">
146             <field name="name">account.voucher.graph</field>
147             <field name="model">account.voucher</field>
148             <field name="arch" type="xml">
149                 <graph string="Voucher Statistics" type="bar">
150                     <field name="date"/>
151                     <field name="amount" operator="+"/>
152                 </graph>
153             </field>
154          </record>
155
156         <!-- Journal Vouchers -->
157         <record model="ir.actions.act_window" id="action_voucher_list">
158             <field name="name">Journal Vouchers</field>
159             <field name="res_model">account.voucher</field>
160             <field name="view_type">form</field>
161             <field name="view_mode">tree,form,graph</field>
162             <field name="context">{'type':'general'}</field>
163             <field name="view_id" eval="view_voucher_tree"/>
164             <field name="search_view_id" ref="view_voucher_filter"/>
165         </record>
166         <record id="action_journal_voucher_tree" model="ir.actions.act_window.view">
167             <field eval="1" name="sequence"/>
168             <field name="view_mode">tree</field>
169             <field name="act_window_id" ref="action_voucher_list"/>
170         </record>
171         <record id="action_journal_voucher_form" model="ir.actions.act_window.view">
172             <field eval="2" name="sequence"/>
173             <field name="view_mode">form</field>
174             <field name="view_id" ref="view_voucher_form"/>
175             <field name="act_window_id" ref="action_voucher_list"/>
176         </record>
177         <menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6" groups="base.group_no_one"/>
178
179         <act_window
180             id="act_journal_voucher_open"
181             name="Voucher Entries"
182             context="{'search_default_journal_id': active_id, 'type':type, 'default_journal_id': active_id}"
183             res_model="account.voucher"
184             src_model="account.journal"/>
185
186         <record model="ir.actions.act_window" id="action_review_voucher_list">
187             <field name="name">Vouchers Entries</field>
188             <field name="res_model">account.voucher</field>
189             <field name="view_type">form</field>
190             <field name="view_mode">tree,form</field>
191             <field name="view_id" eval="view_voucher_tree"/>
192             <field name="domain">[('state','=','posted')]</field>
193             <field name="context">{'state':'posted'}</field>
194             <field name="search_view_id" ref="view_voucher_filter"/>
195         </record>
196
197         <record id="view_bank_statement_form_invoice" model="ir.ui.view">
198             <field name="name">account.bank.statement.invoice.form.inherit</field>
199             <field name="model">account.bank.statement</field>
200             <field name="inherit_id" ref="account.view_bank_statement_form"/>
201             <field name="arch" type="xml">
202                 <xpath expr="//div[@name='import_buttons']" position="inside">
203                     <button name="%(action_view_account_statement_from_invoice_lines)d"
204                             string="Import Invoices" type="action"
205                             attrs="{'invisible':[('state','=','confirm')]}"/>
206                 </xpath>
207             </field>
208         </record>
209
210         <record id="view_bank_statement_form_voucher" model="ir.ui.view">
211             <field name="name">account.bank.statement.voucher.tree.inherit</field>
212             <field name="model">account.bank.statement</field>
213             <field name="inherit_id" ref="account.view_bank_statement_form"/>
214             <field name="arch" type="xml">
215                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
216                     <field name="voucher_id" string="" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
217                 </xpath>
218                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
219                     <field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
220                 </xpath>
221                 <field name="amount" position="attributes">
222                     <attribute name="on_change">onchange_amount(amount)</attribute>
223                 </field>
224             </field>
225         </record>
226
227         <record id="view_cash_statement_tree_voucher" model="ir.ui.view">
228             <field name="name">account.cash.statement.voucher.tree.inherit</field>
229             <field name="model">account.bank.statement</field>
230             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
231             <field name="arch" type="xml">
232                 <xpath expr="//page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
233                     <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
234                 </xpath>
235             </field>
236         </record>
237
238         <record id="view_cash_statement_form_voucher" model="ir.ui.view">
239             <field name="name">account.cash.statement.voucher.form.inherit</field>
240             <field name="model">account.bank.statement</field>
241             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
242             <field name="arch" type="xml">
243                 <xpath expr="//page/field[@name='line_ids']/form/group/field[@name='amount']" position="after">
244                     <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
245                 </xpath>
246             </field>
247         </record>
248
249         <!-- res.config form view -->
250         <record model="ir.ui.view" id="view_account_settings_currency_xchange_form">
251             <field name="name">account.config.settings.inherit</field>
252             <field name="inherit_id" ref="account.view_account_config_settings"/>
253             <field name="model">account.config.settings</field>
254             <field name="priority">20</field>
255             <field name="arch" type="xml">
256                 <xpath expr="//div[@name='group_multi_currency']" position="after">
257                     <group attrs="{'invisible': [('group_multi_currency', '&lt;&gt;', True)]}" col="2">
258                         <group>
259                             <field name="income_currency_exchange_account_id"/>
260                             <field name="expense_currency_exchange_account_id"/>
261                         </group>
262                         <group>
263                         </group>
264                     </group>
265                 </xpath>
266             </field>
267         </record>
268
269     </data>
270     <data noupdate="1">
271
272         <!-- After installation of the module, open the related menu -->
273         <record id="action_client_invoice_menu" model="ir.actions.client">
274             <field name="name">Open Invoicing Menu</field>
275             <field name="tag">reload</field>
276             <field name="params" eval="{'menu_id': ref('account.menu_finance')}"/>
277         </record>
278         <record id="base.open_menu" model="ir.actions.todo">
279             <field name="action_id" ref="action_client_invoice_menu"/>
280             <field name="state">open</field>
281         </record>
282
283     </data>
284 </openerp>