[ADD] Added kanban global click to opportunities
[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" 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" 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_title">
92                         <label for="number" class="oe_edit_only"/>
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_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_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                     <div class="oe_title">
229                         <label for="number" class="oe_edit_only"/>
230                         <h1><field name="number" readonly="0" /></h1>
231                     </div>
232
233                     <field name="pay_now" invisible="1"/>
234                     <group>
235                         <group>
236                             <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}" />
237                             <field name="date" string="Bill Date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
238                             <field name="date_due"/>
239                             <field name="name" colspan="2"/>
240
241                         </group>
242                         <group>
243                             <field name="paid" invisible="1"/>
244                             <field name="currency_id"/>
245                             <field name="journal_id"
246                                 domain="[('type','in',['purchase','purchase_refund'])]"
247                                 widget="selection"
248                                 on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
249                             <field name="reference"/>
250                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
251                         </group>
252
253                     </group>
254                     <group col="6">
255                         <field name="account_id" domain="[('type','=','other')]"  invisible="True"/>
256                         <field name="type" invisible="True"/>
257                     </group>
258                     <notebook colspan="4">
259                         <page string="Bill Information">
260                             <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}">
261                                 <tree string="Expense Lines" editable="bottom">
262                                     <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
263                                     <field name="name"/>
264                                     <field name="amount"/>
265                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
266                                 </tree>
267                             </field>
268                             <group>
269                                 <group>
270                                     <field name="narration" placeholder="Internal Notes" nolabel="1" />
271                                 </group>
272                                 <group class="oe_subtotal_footer">
273                                     <!--
274                                     <div>
275                                         <label for="tax_id" />
276                                         <button type="object" 
277                                             icon="terp-stock_format-scientific" 
278                                             name="compute_tax"
279                                             attrs="{'invisible': [('state','!=','draft')]}"/>
280                                     </div>
281                                     -->
282                                     <field name="tax_id" 
283                                         on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
284                                         widget="selection"
285                                         domain="[('type_tax_use','in',('purchase','all')), ('parent_id', '=', False)]"
286                                         />
287                                     <field name="tax_amount" />
288                                     <field name="amount" string="Total" class="oe_subtotal_footer_separator"/>
289                                 </group>                                    
290
291                             </group>
292                         </page>
293                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
294                             <group col="4">
295                                 <field name="period_id"/>
296                                 <field name="audit"/>
297                             </group>
298                             <field name="move_ids" readonly="1">
299                                <tree string="Journal Items">
300                                    <field name="move_id"/>
301                                    <field name="ref"/>
302                                    <field name="date"/>
303                                    <field name="statement_id"/>
304                                    <field name="partner_id"/>
305                                    <field name="account_id"/>
306                                    <field name="name"/>
307                                    <field name="debit"/>
308                                    <field name="credit"/>
309                                    <field name="state"/>
310                                    <field name="reconcile_id"/>
311                                </tree>
312                             </field>
313                         </page>
314                     </notebook>
315                     </sheet>
316                 </form>
317             </field>
318         </record>
319         <record id="action_purchase_receipt" model="ir.actions.act_window">
320             <field name="name">Purchase Receipt</field>
321             <field name="res_model">account.voucher</field>
322             <field name="view_type">form</field>
323             <field name="domain">[('journal_id.type','in',['purchase','purchase_refund']), ('type','=','purchase')]</field>
324             <field name="context">{'default_type': 'purchase', 'type': 'purchase'}</field>
325             <field name="view_id" eval="False"/>
326             <field name="search_view_id" eval="view_voucher_filter_vendor"/>
327             <field name="target">current</field>
328         </record>
329         <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
330             <field eval="1" name="sequence"/>
331             <field name="view_mode">tree</field>
332             <field name="act_window_id" ref="action_purchase_receipt"/>
333         </record>
334         <record id="action_purchase_receipt_form" model="ir.actions.act_window.view">
335             <field eval="2" name="sequence"/>
336             <field name="view_mode">form</field>
337             <field name="view_id" ref="view_purchase_receipt_form"/>
338             <field name="act_window_id" ref="action_purchase_receipt"/>
339         </record>
340
341         <menuitem id="menu_action_purchase_receipt" icon="STOCK_JUSTIFY_FILL"
342             action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10"/>
343
344     </data>
345 </openerp>