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