[IMP]improve company form view as per review. improve email_template,user form and...
[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                     <group col="6" colspan="4">
54                         <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
55                         <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
56                         <field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
57                         <field name="type" required="1"/>
58                         <field name="name" colspan="2"/>
59                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
60                         <field name="reference"/>
61                         <field name="account_id" widget="selection" invisible="True"/>
62                     </group>
63                     <notebook colspan="4">
64                         <page string="Voucher Entry">
65                             <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}">
66                                 <tree string="Voucher Items" editable="bottom">
67                                     <field name="account_id"/>
68                                     <field name="name"/>
69                                     <field name="amount" sum="Total Amount"/>
70                                     <field name="type"/>
71                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
72                                 </tree>
73                             </field>
74                             <group col="3">
75                                 <group string="Internal Notes">
76                                     <field name="narration" colspan="2" nolabel="1"/>
77                                 </group>
78                                 <group string="Other Information">
79                                     <field name="number"/>
80                                     <field name="currency_id"/>
81                                 </group>
82                                 <group col="4" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
83                                     <separator string="Total" colspan="4"/>
84                                     <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection"/>
85                                     <field name="tax_amount" nolabel="1"/>
86                                     <button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
87                                     <label colspan="1" string=""/><field name="amount" string="Total"/>
88                                 </group>
89                             </group>
90                         </page>
91                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
92                             <group col="4">
93                                 <field name="period_id"/>
94                                 <field name="audit"/>
95                             </group>
96                             <field name="move_ids" readonly="1">
97                                <tree string="Journal Items">
98                                    <field name="move_id"/>
99                                    <field name="ref"/>
100                                    <field name="date"/>
101                                    <field name="statement_id"/>
102                                    <field name="partner_id"/>
103                                    <field name="account_id"/>
104                                    <field name="name"/>
105                                    <field name="debit"/>
106                                    <field name="credit"/>
107                                    <field name="state"/>
108                                    <field name="reconcile_id"/>
109                                </tree>
110                             </field>
111                         </page>
112                     </notebook>
113                   </sheet>
114                     <footer>
115                         <field name="message_ids" widget="mail_thread"/>
116                     </footer>
117                 </form>
118             </field>
119         </record>
120
121         <record id="view_voucher_filter" model="ir.ui.view">
122             <field name="name">account.voucher.select</field>
123             <field name="model">account.voucher</field>
124             <field name="type">search</field>
125             <field name="priority">1</field>
126             <field name="arch" type="xml">
127                 <search string="Search Vouchers">
128                     <group>
129                         <field name="number" string="Voucher"/>
130                         <separator orientation="vertical"/>
131                         <field name="date"/>
132                         <separator orientation="vertical"/>
133                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
134                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
135                         <separator orientation="vertical"/>
136                         <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/>
137                         <separator orientation="vertical"/>
138                         <field name="partner_id"/>
139                         <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" />
140                         <field name="period_id"/>
141                     </group>
142                     <newline/>
143                     <group expand="0" string="Group By...">
144                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
145                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
146                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
147                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
148                     </group>
149                 </search>
150             </field>
151         </record>
152
153         <record id="account_cash_statement_graph" model="ir.ui.view">
154             <field name="name">account.voucher.graph</field>
155             <field name="model">account.voucher</field>
156             <field name="type">graph</field>
157             <field name="arch" type="xml">
158                 <graph string="Voucher Statistics" type="bar">
159                     <field name="date"/>
160                     <field name="amount" operator="+"/>
161                 </graph>
162             </field>
163          </record>
164
165         <!-- Journal Vouchers -->
166         <record model="ir.actions.act_window" id="action_voucher_list">
167             <field name="name">Journal Vouchers</field>
168             <field name="res_model">account.voucher</field>
169             <field name="view_type">form</field>
170             <field name="view_mode">tree,form,graph</field>
171             <field name="context">{'type':'general'}</field>
172             <field name="view_id" eval="view_voucher_tree"/>
173             <field name="search_view_id" ref="view_voucher_filter"/>
174         </record>
175         <record id="action_journal_voucher_tree" model="ir.actions.act_window.view">
176             <field eval="1" name="sequence"/>
177             <field name="view_mode">tree</field>
178             <field name="act_window_id" ref="action_voucher_list"/>
179         </record>
180         <record id="action_journal_voucher_form" model="ir.actions.act_window.view">
181             <field eval="2" name="sequence"/>
182             <field name="view_mode">form</field>
183             <field name="view_id" ref="view_voucher_form"/>
184             <field name="act_window_id" ref="action_voucher_list"/>
185         </record>
186         <menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6"/>
187
188         <act_window
189             id="act_journal_voucher_open"
190             name="Voucher Entries"
191             context="{'search_default_journal_id': active_id, 'type':type, 'default_journal_id': active_id}"
192             res_model="account.voucher"
193             src_model="account.journal"/>
194
195         <record model="ir.actions.act_window" id="action_review_voucher_list">
196             <field name="name">Vouchers Entries</field>
197             <field name="res_model">account.voucher</field>
198             <field name="view_type">form</field>
199             <field name="view_mode">tree,form</field>
200             <field name="view_id" eval="view_voucher_tree"/>
201             <field name="domain">[('state','=','posted')]</field>
202             <field name="context">{'state':'posted'}</field>
203             <field name="search_view_id" ref="view_voucher_filter"/>
204         </record>
205
206         <record id="view_bank_statement_form_invoice" model="ir.ui.view">
207             <field name="name">account.bank.statement.invoice.form.inherit</field>
208             <field name="model">account.bank.statement</field>
209             <field name="type">form</field>
210             <field name="inherit_id" ref="account.view_bank_statement_form"/>
211             <field name="arch" type="xml">
212               <field name="currency" invisible="1" position="after">
213                 <button name="%(action_view_account_statement_from_invoice_lines)d"
214                             string="Import Invoices" type="action" icon="gtk-execute"
215                             attrs="{'invisible':[('state','=','confirm')]}"/>
216               </field>
217             </field>
218         </record>
219
220         <record id="view_bank_statement_tree_voucher" model="ir.ui.view">
221             <field name="name">account.bank.statement.voucher.tree.inherit</field>
222             <field name="model">account.bank.statement</field>
223             <field name="type">form</field>
224             <field name="inherit_id" ref="account.view_bank_statement_form"/>
225             <field name="arch" type="xml">
226                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
227                     <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}"/>
228                 </xpath>
229             </field>
230         </record>
231
232         <record id="view_bank_statement_form_voucher" model="ir.ui.view">
233             <field name="name">account.bank.statement.voucher.form.inherit</field>
234             <field name="model">account.bank.statement</field>
235             <field name="type">form</field>
236             <field name="inherit_id" ref="account.view_bank_statement_form"/>
237             <field name="arch" type="xml">
238                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
239                     <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}"/>
240                 </xpath>
241             </field>
242         </record>
243         <record id="view_cash_statement_tree_voucher" model="ir.ui.view">
244             <field name="name">account.cash.statement.voucher.tree.inherit</field>
245             <field name="model">account.bank.statement</field>
246             <field name="type">form</field>
247             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
248             <field name="arch" type="xml">
249                 <xpath expr="//page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
250                     <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}"/>
251                 </xpath>
252             </field>
253         </record>
254
255         <record id="view_cash_statement_form_voucher" model="ir.ui.view">
256             <field name="name">account.cash.statement.voucher.form.inherit</field>
257             <field name="model">account.bank.statement</field>
258             <field name="type">form</field>
259             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
260             <field name="arch" type="xml">
261                 <xpath expr="//page/field[@name='line_ids']/form/group/field[@name='amount']" position="after">
262                     <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}"/>
263                 </xpath>
264             </field>
265         </record>
266
267         <!-- res.company form view -->
268         <record model="ir.ui.view" id="view_company_inherit_currency_xchange_form">
269             <field name="name">res.company.form.inherit</field>
270             <field name="inherit_id" ref="base.view_company_form"/>
271             <field name="model">res.company</field>
272             <field name="type">form</field>
273             <field name="arch" type="xml">
274                 <field name="currency_id" position="after">
275                       <field name="income_currency_exchange_account_id"/>
276                       <field name="expense_currency_exchange_account_id"/>
277                 </field>
278             </field>
279         </record>
280
281     </data>
282 </openerp>