[IMP] improved menu tips - 10 firsts clicks
[odoo/odoo.git] / addons / account_voucher / voucher_sales_purchase_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4         <record id="view_voucher_filter_vendor" model="ir.ui.view">
5             <field name="name">account.voucher.purchase.select</field>
6             <field name="model">account.voucher</field>
7             <field name="type">search</field>
8             <field name="arch" type="xml">
9                 <search string="Search Vouchers">
10                     <field name="number" string="Voucher"/>
11                     <field name="date"/>
12                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
13                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
14                     <field name="partner_id" string="Supplier"/>
15                     <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('purchase','purchase_refund'))]"/>
16                     <field name="period_id"/>
17                     <group expand="0" string="Group By...">
18                         <filter string="Supplier" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
19                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
20                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
21                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
22                     </group>
23                 </search>
24             </field>
25         </record>
26
27         <record id="view_voucher_filter_sale" model="ir.ui.view">
28             <field name="name">account.voucher.sale.select</field>
29             <field name="model">account.voucher</field>
30             <field name="type">search</field>
31             <field name="arch" type="xml">
32                 <search string="Search Vouchers">
33                     <field name="number" string="Voucher"/>
34                     <field name="date"/>
35                     <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
36                     <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
37                     <field name="partner_id" string="Customer"/>
38                     <field name="journal_id" context="{'journal_id': self, 'set_visible':False}" domain="[('type','in',('sale','sale_refund'))]"/>
39                     <field name="period_id"/>
40                     <group expand="0" string="Group By...">
41                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
42                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
43                         <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id','visible':True}"/>
44                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
45                     </group>
46                 </search>
47             </field>
48         </record>
49
50         <record id="act_pay_voucher" model="ir.actions.act_window">
51             <field name="name">Customer Payment</field>
52             <field name="res_model">account.voucher</field>
53             <field name="view_type">form</field>
54             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
55             <field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
56             <field name="view_id" ref="view_vendor_receipt_form"/>
57             <field name="target">current</field>
58         </record>
59
60         <record model="ir.ui.view" id="view_sale_receipt_form">
61             <field name="name">account.voucher.sale.form</field>
62             <field name="model">account.voucher</field>
63             <field name="type">form</field>
64             <field name="arch" type="xml">
65                 <form version="7.0">
66                 <header>
67                     <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
68                     <button name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_highlight"/>
69                     <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
70                     <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
71                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
72                     <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
73                 </header>
74                 <sheet string="Sales Receipt" >
75                     <h1><label for="number" string="Sale Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
76                     <group>
77                         <group>
78                             <field name="partner_id" domain="[('customer','=',True)]" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": true}'/>
79                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
80                         </group>
81                         <group>
82                             <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)" groups="account.group_account_user"/>
83                             <field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
84                             <field name="name"/>
85                             <field name="paid" invisible="1"/>
86                             <field name="currency_id" invisible="1"/>
87                         </group>
88                         <field name="type" invisible="True"/>
89                     </group>
90                     <notebook>
91                         <page string="Sales Information">
92                             <field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}">
93                                 <tree string="Sales Lines" editable="bottom">
94                                     <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection" groups="account.group_account_user"/>
95                                     <field name="name"/>
96                                     <field name="amount" sum="Total"/>
97                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
98                                 </tree>
99                             </field>
100                                         <group>
101                                 <field name="narration" placeholder="Internal Notes" nolabel="1"/>
102                                 <group class="oe_subtotal_footer oe_right">
103                                     <field name="tax_id" 
104                                         on_change="onchange_price(line_cr_ids, tax_id, partner_id)"
105                                         widget="selection" nolabel="1"
106                                         placeholder="select tax..."
107                                         domain="[('type_tax_use','in',('sale','all')), ('parent_id', '=', False)]"/>
108                                     <field name="tax_amount" nolabel="1"/>
109                                     <div class="oe_subtotal_footer_separator">
110                                         <label for="amount"/>
111                                         <button type="object" class="oe_link oe_edit_only"
112                                             name="compute_tax" string="(update)"
113                                             attrs="{'invisible': [('state','!=','draft')]}"/>
114                                                 </div>
115                                     <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
116                                 </group>                                    
117                                             <group>
118                                     <field name="pay_now" on_change="onchange_payment(pay_now, journal_id, partner_id)" required="1"/>
119                                     <field name="date_due" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
120                                     <field name="account_id"
121                                          attrs="{'invisible':[('pay_now','!=','pay_now')]}"
122                                           domain="[('type','=','liquidity')]"/>
123                                     <field name="reference"
124                                          attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
125                                 </group>
126                                         </group>
127                         </page>
128                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
129                             <group col="4">
130                                 <field name="period_id"/>
131                                 <field name="audit"/>
132                             </group>
133                             <field name="move_ids" readonly="1">
134                                <tree string="Journal Items">
135                                    <field name="move_id"/>
136                                    <field name="ref"/>
137                                    <field name="date"/>
138                                    <field name="statement_id"/>
139                                    <field name="partner_id"/>
140                                    <field name="account_id"/>
141                                    <field name="name"/>
142                                    <field name="debit"/>
143                                    <field name="credit"/>
144                                    <field name="state"/>
145                                    <field name="reconcile_id"/>
146                                </tree>
147                             </field>
148                         </page>
149                     </notebook>
150                     </sheet>
151                     <div class="oe_chatter">
152                         <field name="message_ids" widget="mail_thread"/>
153                     </div>
154                 </form>
155             </field>
156         </record>
157
158         <!-- Sales Voucher -->
159         <record id="action_sale_receipt" model="ir.actions.act_window">
160             <field name="name">Sales Receipt</field>
161             <field name="res_model">account.voucher</field>
162             <field name="view_type">form</field>
163             <field name="domain">[('journal_id.type','in',['sale','sale_refund']), ('type','=','sale')]</field>
164             <field name="context">{'default_type': 'sale', 'type': 'sale'}</field>
165             <field name="view_id" eval="False"/>
166             <field name="search_view_id" ref="view_voucher_filter_sale"/>
167             <field name="target">current</field>
168             <field name="help" type="xml">
169               <p>
170                 Click to create a sale receipt.
171               </p><p>
172                 When the sale receipt is confirmed, you can record the customer
173                 payment related to this sales receipt.
174               </p>
175             </field>
176         </record>
177         <record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
178             <field eval="1" name="sequence"/>
179             <field name="view_mode">tree</field>
180             <field name="act_window_id" ref="action_sale_receipt"/>
181         </record>
182         <record id="action_sale_receipt_form" model="ir.actions.act_window.view">
183             <field eval="2" name="sequence"/>
184             <field name="view_mode">form</field>
185             <field name="view_id" ref="view_sale_receipt_form"/>
186             <field name="act_window_id" ref="action_sale_receipt"/>
187         </record>
188
189         <menuitem id="menu_action_sale_receipt" icon="STOCK_JUSTIFY_FILL"
190             action="action_sale_receipt"
191             parent="account.menu_finance_receivables"
192             sequence="10"/>
193
194         <!--  Purchase Vouchers -->
195         <record id="act_pay_bills" model="ir.actions.act_window">
196             <field name="name">Bill Payment</field>
197             <field name="res_model">account.voucher</field>
198             <field name="view_type">form</field>
199             <field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
200             <field name="context">{'default_type':'payment', 'type':'payment', 'default_partner_id': partner_id, 'partner_id': partner_id, 'default_reference':reference}</field>
201             <field name="view_id" ref="view_vendor_payment_form"/>
202             <field name="target">current</field>
203         </record>
204         <record model="ir.ui.view" id="view_purchase_receipt_form">
205             <field name="name">account.voucher.purchase.form</field>
206             <field name="model">account.voucher</field>
207             <field name="type">form</field>
208             <field name="arch" type="xml">
209                 <form version="7.0">
210                 <header>
211                     <button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
212                     <button name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_highlight"/>
213                     <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
214                     <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
215                     <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
216                     <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
217                 </header>
218                 <sheet string="Supplier Voucher">
219                     <h1><label for="number" string="Purchase Receipt"/> <field name="number" class="oe_inline" readonly="1"/></h1>
220
221                     <field name="pay_now" invisible="1"/>
222                     <field name="account_id" domain="[('type','=','other')]"  invisible="True"/>
223                     <field name="type" invisible="True"/>
224                     <group>
225                         <group>
226                             <field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />
227                             <field name="name" colspan="2"/>
228                             <field name="reference"/>
229                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
230                         </group>
231                         <group>
232                             <field name="date" string="Bill Date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
233                             <field name="date_due"/>
234                             <field name="paid" invisible="1"/>
235                             <field name="currency_id" invisible="1"/>
236                             <field name="journal_id"
237                                 domain="[('type','in',['purchase','purchase_refund'])]"
238                                 widget="selection"
239                                 on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"
240                                 groups="account.group_account_user"/>
241                         </group>
242                     </group>
243                     <notebook>
244                         <page string="Bill Information">
245                             <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}">
246                                 <tree string="Expense Lines" editable="bottom">
247                                     <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]" groups="account.group_account_user"/>
248                                     <field name="name"/>
249                                     <field name="amount"/>
250                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
251                                 </tree>
252                             </field>
253                             <group>
254                                 <field name="narration" placeholder="Internal Notes" nolabel="1"/>
255                                 <group class="oe_subtotal_footer oe_right">
256                                     <!--
257                                     <div>
258                                         <label for="tax_id" />
259                                         <button type="object" 
260                                             icon="terp-stock_format-scientific" 
261                                             name="compute_tax"
262                                             attrs="{'invisible': [('state','!=','draft')]}"/>
263                                     </div>
264                                     -->
265                                     <field name="tax_id" 
266                                         on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
267                                         widget="selection" nolabel="1"
268                                         placeholder="select tax..."
269
270                                         domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"
271                                         />
272                                     <field name="tax_amount" nolabel="1"/>
273                                     <div class="oe_subtotal_footer_separator">
274                                         <label for="amount"/>
275                                         <button type="object" class="oe_link oe_edit_only"
276                                             name="compute_tax" string="(update)"
277                                             attrs="{'invisible': [('state','!=','draft')]}"/>
278                                     </div>
279                                     <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
280                                 </group>
281                             </group>
282                         </page>
283                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
284                             <group col="4">
285                                 <field name="period_id"/>
286                                 <field name="audit"/>
287                             </group>
288                             <field name="move_ids" readonly="1">
289                                <tree string="Journal Items">
290                                    <field name="move_id"/>
291                                    <field name="ref"/>
292                                    <field name="date"/>
293                                    <field name="statement_id"/>
294                                    <field name="partner_id"/>
295                                    <field name="account_id"/>
296                                    <field name="name"/>
297                                    <field name="debit"/>
298                                    <field name="credit"/>
299                                    <field name="state"/>
300                                    <field name="reconcile_id"/>
301                                </tree>
302                             </field>
303                         </page>
304                     </notebook>
305                     </sheet>
306                     <div class="oe_chatter">
307                         <field name="message_ids" widget="mail_thread"/>
308                     </div>
309                 </form>
310             </field>
311         </record>
312         <record id="action_purchase_receipt" model="ir.actions.act_window">
313             <field name="name">Purchase Receipt</field>
314             <field name="res_model">account.voucher</field>
315             <field name="view_type">form</field>
316             <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
317             <field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
318             <field name="view_id" eval="False"/>
319             <field name="search_view_id" eval="view_voucher_filter_vendor"/>
320             <field name="target">current</field>
321             <field name="help" type="xml">
322               <p>
323                 Click to register a purchase receipt. 
324               </p><p>
325                 When the purchase receipt is confirmed, you can record the
326                 supplier payment related to this purchase receipt.
327               </p>
328             </field>
329         </record>
330         <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
331             <field eval="1" name="sequence"/>
332             <field name="view_mode">tree</field>
333             <field name="act_window_id" ref="action_purchase_receipt"/>
334         </record>
335         <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
336             <field eval="2" name="sequence"/>
337             <field name="view_mode">form</field>
338             <field name="view_id" ref="view_purchase_receipt_form"/>
339             <field name="act_window_id" ref="action_purchase_receipt"/>
340         </record>
341
342         <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
343             action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
344
345     </data>
346 </openerp>