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