[FIX]: Fix general issue.
[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="type">tree</field>
8             <field name="arch" type="xml">
9                 <tree colors="blue:state == 'draft';gray:state == 'cancel';red:audit" string="Voucher Entries">
10                     <field name="date"/>
11                     <field name="number"/>
12                     <field name="reference"/>
13                     <field name="partner_id"/>
14                     <field name="journal_id" groups="account.group_account_user"/>
15                     <field name="period_id" invisible="context.get('visible', True)"/>
16                     <field name="type" invisible="context.get('visible', True)"/>
17                     <field name="amount" sum="Total Amount"/>
18                     <field name="audit"/>
19                     <field name="state"/>
20                 </tree>
21             </field>
22         </record>
23         <record model="ir.ui.view" id="view_voucher_line_form">
24             <field name="name">account.voucher.line.form</field>
25             <field name="model">account.voucher.line</field>
26             <field name="type">form</field>
27             <field name="arch" type="xml">
28                 <form string="Voucher Lines" version="7.0">
29                     <group col="4">
30                         <field name="name"/>
31                         <field name="account_id"/>
32                         <field name="partner_id"/>
33                         <field name="amount"/>
34                     </group>
35                 </form>
36             </field>
37         </record>
38
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="type">form</field>
43             <field name="arch" type="xml">
44                 <form version="7.0">
45                   <header>
46                       <button name="proforma_voucher" string="Post" states="draft" class="oe_highlight"/>
47                       <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to unreconcile this record?"/>
48                       <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
49                       <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
50                       <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
51                   </header>
52                   <sheet string="Accounting Voucher">
53                     <div class="oe_title">
54                            <label for="number" class="oe_edit_only"/>
55                            <h1>
56                                <field name="number"   class="oe_inline"/>
57                                <span attr="{'invisible': [('type','=',False)]}" class="oe_inline"> ( </span>
58                                <field name="type" required="1"  class="oe_inline"/>
59                                <span attr="{'invisible': [('type','=',False)]}" class="oe_inline"> ) </span>
60                            </h1>
61                     </div>  
62                     <group>
63                         <group>
64                                <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
65                                <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
66                                <field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
67                         </group>
68                         <group>
69                             <field name="currency_id"/>
70                             <field name="payment_rate_currency_id"  invisible="1"/>
71                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
72                             <field name="reference"/>
73                             <field name="name"/>
74                         </group>
75                     </group>
76                     <field name="account_id" widget="selection" invisible="True"/>
77                     <notebook colspan="4">
78                         <page string="Voucher Entry">
79                             <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}">
80                                 <tree string="Voucher Items" editable="bottom">
81                                     <field name="account_id"/>
82                                     <field name="name"/>
83                                     <field name="amount" sum="Total Amount"/>
84                                     <field name="type"/>
85                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
86                                 </tree>
87                             </field>
88                             <group>
89                                 <group>
90                                     <field name="narration" colspan="2" nolabel="1"  placeholder="Add an internal note"/>
91                                 </group>
92                                 <group class="oe_subtotal_footer oe_right" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}" >
93                                     <group>
94                                         <label for="tax_id"/>
95                                         <field name="tax_id" nolabel="1" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection"/>
96                                         <button type="object" colspan="2" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
97                                     </group>
98                                     <group>
99                                         <field name="amount_untaxed"/>
100                                         <field name="tax_amount" readonly="1" />
101                                         <field name="amount"  class="oe_subtotal_footer_separator" readonly="1"/>
102                                     </group>
103                                 </group>
104                             </group>
105                         </page>
106                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
107                             <group col="4">
108                                 <field name="period_id"/>
109                                 <field name="audit"/>
110                             </group>
111                             <field name="move_ids" readonly="1">
112                                 <tree string="Journal Items">
113                                     <field name="move_id"/>
114                                     <field name="ref"/>
115                                     <field name="date"/>
116                                     <field name="statement_id"/>
117                                     <field name="partner_id"/>
118                                     <field name="account_id"/>
119                                     <field name="name"/>
120                                     <field name="debit"/>
121                                     <field name="credit"/>
122                                     <field name="state"/>
123                                     <field name="reconcile_id"/>
124                                 </tree>
125                             </field>
126                         </page>
127                     </notebook>
128                   </sheet>
129                   <div class="oe_chatter">
130                       <field name="message_ids" widget="mail_thread"/>
131                   </div>
132                 </form>
133             </field>
134         </record>
135
136         <record id="view_voucher_filter" model="ir.ui.view">
137             <field name="name">account.voucher.select</field>
138             <field name="model">account.voucher</field>
139             <field name="type">search</field>
140             <field name="priority">1</field>
141             <field name="arch" type="xml">
142                 <search string="Search Vouchers">
143                     <group>
144                         <field name="number" string="Voucher"/>
145                         <separator orientation="vertical"/>
146                         <field name="date"/>
147                         <separator orientation="vertical"/>
148                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
149                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
150                         <separator orientation="vertical"/>
151                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/>
152                         <separator orientation="vertical"/>
153                         <field name="partner_id"/>
154                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" />
155                         <field name="period_id"/>
156                     </group>
157                     <newline/>
158                     <group expand="0" string="Group By...">
159                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
160                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
161                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
162                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
163                     </group>
164                 </search>
165             </field>
166         </record>
167
168         <record id="account_cash_statement_graph" model="ir.ui.view">
169             <field name="name">account.voucher.graph</field>
170             <field name="model">account.voucher</field>
171             <field name="type">graph</field>
172             <field name="arch" type="xml">
173                 <graph string="Voucher Statistics" type="bar">
174                     <field name="date"/>
175                     <field name="amount" operator="+"/>
176                 </graph>
177             </field>
178          </record>
179
180         <!-- Journal Vouchers -->
181         <record model="ir.actions.act_window" id="action_voucher_list">
182             <field name="name">Journal Vouchers</field>
183             <field name="res_model">account.voucher</field>
184             <field name="view_type">form</field>
185             <field name="view_mode">tree,form,graph</field>
186             <field name="context">{'type':'general'}</field>
187             <field name="view_id" eval="view_voucher_tree"/>
188             <field name="search_view_id" ref="view_voucher_filter"/>
189         </record>
190         <record id="action_journal_voucher_tree" model="ir.actions.act_window.view">
191             <field eval="1" name="sequence"/>
192             <field name="view_mode">tree</field>
193             <field name="act_window_id" ref="action_voucher_list"/>
194         </record>
195         <record id="action_journal_voucher_form" model="ir.actions.act_window.view">
196             <field eval="2" name="sequence"/>
197             <field name="view_mode">form</field>
198             <field name="view_id" ref="view_voucher_form"/>
199             <field name="act_window_id" ref="action_voucher_list"/>
200         </record>
201         <menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6"/>
202
203         <act_window
204             id="act_journal_voucher_open"
205             name="Voucher Entries"
206             context="{'search_default_journal_id': active_id, 'type':type, 'default_journal_id': active_id}"
207             res_model="account.voucher"
208             src_model="account.journal"/>
209
210         <record model="ir.actions.act_window" id="action_review_voucher_list">
211             <field name="name">Vouchers Entries</field>
212             <field name="res_model">account.voucher</field>
213             <field name="view_type">form</field>
214             <field name="view_mode">tree,form</field>
215             <field name="view_id" eval="view_voucher_tree"/>
216             <field name="domain">[('state','=','posted')]</field>
217             <field name="context">{'state':'posted'}</field>
218             <field name="search_view_id" ref="view_voucher_filter"/>
219         </record>
220
221         <record id="view_bank_statement_form_invoice" model="ir.ui.view">
222             <field name="name">account.bank.statement.invoice.form.inherit</field>
223             <field name="model">account.bank.statement</field>
224             <field name="type">form</field>
225             <field name="inherit_id" ref="account.view_bank_statement_form"/>
226             <field name="arch" type="xml">
227                 <xpath expr="//div[@name='import_buttons']" position="inside">
228                     <button name="%(action_view_account_statement_from_invoice_lines)d"
229                             string="Import Invoices" type="action" icon="gtk-execute"
230                             attrs="{'invisible':[('state','=','confirm')]}"/>
231                 </xpath>
232             </field>
233         </record>
234
235         <record id="view_bank_statement_tree_voucher" model="ir.ui.view">
236             <field name="name">account.bank.statement.voucher.tree.inherit</field>
237             <field name="model">account.bank.statement</field>
238             <field name="type">form</field>
239             <field name="inherit_id" ref="account.view_bank_statement_form"/>
240             <field name="arch" type="xml">
241                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
242                     <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}"/>
243                 </xpath>
244             </field>
245         </record>
246
247         <record id="view_bank_statement_form_voucher" model="ir.ui.view">
248             <field name="name">account.bank.statement.voucher.form.inherit</field>
249             <field name="model">account.bank.statement</field>
250             <field name="type">form</field>
251             <field name="inherit_id" ref="account.view_bank_statement_form"/>
252             <field name="arch" type="xml">
253                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
254                     <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}"/>
255                 </xpath>
256             </field>
257         </record>
258         <record id="view_cash_statement_tree_voucher" model="ir.ui.view">
259             <field name="name">account.cash.statement.voucher.tree.inherit</field>
260             <field name="model">account.bank.statement</field>
261             <field name="type">form</field>
262             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
263             <field name="arch" type="xml">
264                 <xpath expr="//page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
265                     <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}"/>
266                 </xpath>
267             </field>
268         </record>
269
270         <record id="view_cash_statement_form_voucher" model="ir.ui.view">
271             <field name="name">account.cash.statement.voucher.form.inherit</field>
272             <field name="model">account.bank.statement</field>
273             <field name="type">form</field>
274             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
275             <field name="arch" type="xml">
276                 <xpath expr="//page/field[@name='line_ids']/form/group/field[@name='amount']" position="after">
277                     <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}"/>
278                 </xpath>
279             </field>
280         </record>
281
282         <!-- res.company form view -->
283         <record model="ir.ui.view" id="view_company_inherit_currency_xchange_form">
284             <field name="name">res.company.form.inherit</field>
285             <field name="inherit_id" ref="base.view_company_form"/>
286             <field name="model">res.company</field>
287             <field name="type">form</field>
288             <field name="arch" type="xml">
289                 <field name="currency_id" position="after">
290                       <field name="income_currency_exchange_account_id" colspan="2"/>
291                       <field name="expense_currency_exchange_account_id" colspan="2"/>
292                 </field>
293             </field>
294         </record>
295
296     </data>
297 </openerp>