642ffc1494af99e78d1d03f74866778e5872f0c2
[odoo/odoo.git] / addons / sale / sale_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- Top menu item -->
6         <!--
7             This menu item's purpose is to overwrite another one defined in
8             the base module in order to set new groups.
9         -->
10         <menuitem name="Sales"
11             id="base.menu_base_partner"
12             groups="base.group_sale_salesman,base.group_sale_manager"/>
13
14         <menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
15
16
17         <record id="view_shop_form" model="ir.ui.view">
18             <field name="name">sale.shop</field>
19             <field name="model">sale.shop</field>
20             <field name="arch" type="xml">
21                 <form string="Sales Shop" version="7.0">
22                     <label for="name" class="oe_edit_only"/>
23                     <h1><field name="name"/></h1>
24                     <group name="shop">
25                         <group>
26                             <field name="payment_default_id"/>
27                             <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist"/>
28                         </group>
29                         <group>
30                             <field name="project_id" groups="analytic.group_analytic_accounting"/>
31                             <field name="company_id" widget="selection" groups="base.group_multi_company"/>
32                         </group>
33                     </group>
34                 </form>
35            </field>
36         </record>
37         
38         <record id="view_shop_tree" model="ir.ui.view">
39             <field name="name">sale.shop</field>
40             <field name="model">sale.shop</field>
41             <field name="arch" type="xml">
42                 <tree string="Sales Shop">
43                     <field name="name"/>
44                     <field name="pricelist_id" groups="product.group_sale_pricelist"/>
45                     <field name="project_id" groups="analytic.group_analytic_accounting"/>
46                 </tree>
47             </field>
48         </record>
49
50         <record id="action_shop_form" model="ir.actions.act_window">
51             <field name="name">Shop</field>
52             <field name="type">ir.actions.act_window</field>
53             <field name="res_model">sale.shop</field>
54             <field name="view_type">form</field>
55             <field name="view_mode">tree,form</field>
56             <field name="view_id" ref="view_shop_tree"/>
57             <field name="help" type="html">
58               <p class="oe_view_nocontent_create">
59                 Click to define a new sale shop.
60               </p><p>
61                 Each quotation or sales order must be linked to a shop. The
62                 shop also defines the warehouse from which the products will be
63                 delivered for each particular sales.
64               </p>
65             </field>
66         </record>
67
68
69         <record id="view_sale_order_calendar" model="ir.ui.view">
70             <field name="name">sale.order.calendar</field>
71             <field name="model">sale.order</field>
72             <field name="arch" type="xml">
73                 <calendar string="Sales Orders" color="state" date_start="date_order">
74                     <field name="partner_id"/>
75                     <field name="amount_total"/>
76                 </calendar>
77             </field>
78         </record>
79         <record model="ir.ui.view" id="view_sale_order_graph">
80             <field name="name">sale.order.graph</field>
81             <field name="model">sale.order</field>
82             <field name="arch" type="xml">
83                 <graph string="Sales Orders" type="bar">
84                     <field name="partner_id"/>
85                     <field name="amount_total" operator="+"/>
86                 </graph>
87             </field>
88         </record>
89
90         <record id="view_order_tree" model="ir.ui.view">
91             <field name="name">sale.order.tree</field>
92             <field name="model">sale.order</field>
93             <field name="priority">2</field>
94             <field name="arch" type="xml">
95                 <tree string="Sales Orders" fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')">
96                     <field name="message_unread" invisible="1"/>
97                     <field name="name" string="Order Number"/>
98                     <field name="date_order"/>
99                     <field name="partner_id"/>
100                     <field name="user_id"/>
101                     <field name="amount_total" sum="Total Tax Included"/>
102                     <field name="state"/>
103                 </tree>
104             </field>
105         </record>
106
107         <record id="view_quotation_tree" model="ir.ui.view">
108             <field name="name">sale.order.tree</field>
109             <field name="model">sale.order</field>
110             <field name="priority">4</field>
111             <field name="arch" type="xml">
112                 <tree string="Quotation" fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')">
113                     <field name="message_unread" invisible="1"/>
114                     <field name="name" string="Quotation Number"/>
115                     <field name="date_order"/>
116                     <field name="partner_id"/>
117                     <field name="user_id"/>
118                     <field name="amount_total" sum="Total Tax Included"/>
119                     <field name="state"/>
120                 </tree>
121             </field>
122         </record>
123
124         <record id="view_order_form" model="ir.ui.view">
125             <field name="name">sale.order.form</field>
126             <field name="model">sale.order</field>
127             <field name="arch" type="xml">
128                 <form string="Sales Order" version="7.0">
129                     <header>
130                         <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" groups="base.group_user"/>
131                         <button name="invoice_corrected" states="invoice_except" string="Ignore Exception" groups="base.group_user"/>
132                         <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
133                         <button name="action_quotation_send" string="Send by Email" type="object" states="sent" groups="base.group_user"/>
134                         <button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
135                         <button name="print_quotation" string="Print" type="object" states="sent" groups="base.group_user"/>
136                         <button name="action_button_confirm" states="draft" string="Confirm Sale" type="object" groups="base.group_user"/>
137                         <button name="action_button_confirm" states="sent" string="Confirm Sale" class="oe_highlight" type="object" groups="base.group_user"/>
138                         <button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
139                             attrs="{'invisible': [('invoice_exists', '=', False)]}" groups="base.group_user"/>
140                         <button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
141                             type="action" states="manual" class="oe_highlight" groups="base.group_user"/>
142                         <button name="copy_quotation" states="cancel" string="New Copy of Quotation" type="object"/>
143                         <button name="cancel" states="draft,sent" string="Cancel Quotation" groups="base.group_user"/>
144                         <button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" groups="base.group_user"/>
145                         <button name="invoice_cancel" states="invoice_except" string="Cancel Order" groups="base.group_user"/>
146                         <field name="state" widget="statusbar" statusbar_visible="draft,sent,invoiced,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/>
147                 </header>
148                 <sheet>
149                     <h1>
150                         <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
151                         <label string="Sales Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
152                         <field name="name" class="oe_inline" readonly="1"/>
153                     </h1>
154                     <group>
155                         <group>
156                             <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
157                             <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/>
158                             <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/>
159                             <field name="project_id" context="{'partner_id':partner_invoice_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/>
160                         </group>
161                         <group>
162                             <field name="date_order"/>
163                             <field name="shop_id" groups="base.group_no_one" on_change="onchange_shop_id(shop_id, context)" widget="selection"/>
164                             <field name="client_order_ref"/>
165                             <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
166                             <field name="currency_id" invisible="1"/>
167                         </group>
168                     </group>
169                     <notebook>
170                         <page string="Order Lines">
171                             <field name="order_line">
172                                 <form string="Sales Order Lines" version="7.0">
173                                     <header groups="base.group_user">
174                                         <button name="%(action_view_sale_order_line_make_invoice)d" states="confirmed" string="Invoice" type="action" icon="terp-document-new"/>
175                                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
176                                     </header>
177                                     <group>
178                                         <group>
179                                             <field name="state" invisible="1" />
180                                             <field name="product_id"
181                                                 context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
182                                                 groups="base.group_user"
183                                                 on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
184                                             <label for="product_uom_qty"/>
185                                             <div>
186                                                 <field
187                                                     context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
188                                                     name="product_uom_qty" class="oe_inline"
189                                                     on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"/>
190                                                 <field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"
191
192                                                     on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, context)"/>
193                                             </div>
194                                             <label for="product_uos_qty" groups="product.group_uos"/>
195                                             <div groups="product.group_uos">
196                                                 <field name="product_uos_qty" class="oe_inline"/>
197                                                 <field name="product_uos" options='{"no_open": True}' class="oe_inline"/>
198                                             </div>
199                                             <field name="price_unit"/>
200                                             <label for="discount" groups="sale.group_discount_per_so_line"/>
201                                             <div name="discount" groups="sale.group_discount_per_so_line">
202                                                 <field name="discount" class="oe_inline"/> %%
203                                             </div>
204                                         </group>
205                                         <group>
206                                             <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
207                                             <field name="type"/>
208                                             <field name="th_weight"/>
209                                             <!-- we should put a config wizard for these two fields -->
210                                             <field name="address_allotment_id"/>
211                                         </group>
212                                     </group>
213                                     <label for="name"/>
214                                     <field name="name"/>
215                                     <div groups="base.group_no_one">
216                                         <label for="invoice_lines"/>
217                                         <field name="invoice_lines"/>
218                                     </div>
219                                 </form>
220                                 <tree string="Sales Order Lines" editable="bottom">
221                                     <field name="sequence" widget="handle"/>
222                                     <field name="state" invisible="1"/>
223                                     <field name="th_weight" invisible="1"/>
224                                     <field name="product_id"
225                                         context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
226                                         groups="base.group_user" 
227                                         on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
228                                     <field name="name"/>
229                                     <field name="product_uom_qty"
230                                         context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
231                                         on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"/>
232                                     <field name="product_uom"
233                                         on_change="product_uom_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, context)"
234                                         groups="product.group_uom" options='{"no_open": True}'/>
235                                     <field name="product_uos_qty" groups="product.group_uos" invisible="1"/>
236                                     <field name="product_uos" string="UoS" groups="product.group_uos" invisible="1"/>
237                                     <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
238                                     <field name="price_unit"/>
239                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
240                                     <field name="price_subtotal"/>
241                                 </tree>
242                             </field>
243                             <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
244                                 <field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
245                                 <field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
246                                 <div class="oe_subtotal_footer_separator oe_inline">
247                                     <label for="amount_total" />
248                                     <button name="button_dummy"
249                                         states="draft,sent" string="(update)" type="object" class="oe_edit_only oe_link"/>
250                                 </div>
251                                 <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
252                             </group>
253                             <div class="oe_clear"/>
254                             <field name="note" class="oe_inline" placeholder="Terms and conditions..."/>
255                         </page>
256                         <page string="Other Information" groups="base.group_user">
257                             <group>
258                                 <group name="sales_person" groups="base.group_user">
259                                     <field name="user_id" context="{'default_groups_ref': ['account.group_account_invoice', 'base.group_sale_salesman_all_leads']}"/>
260                                     <field groups="base.group_no_one" name="origin"/>
261                                 </group>
262                                 <group name="sale_pay">
263                                     <field name="payment_term" widget="selection"/>
264                                     <field name="fiscal_position" widget="selection"/>
265                                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
266                                 </group>
267                                 <group>
268                                     <field name="invoiced"/>
269                                     <field name="invoice_exists" invisible="1"/>
270                                 </group>
271                             </group>
272                         </page>
273                     </notebook>
274                 </sheet>
275                 <div class="oe_chatter">
276                     <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
277                     <field name="message_ids" widget="mail_thread"/>
278                 </div>
279                 </form>
280             </field>
281         </record>
282
283         <!-- inherited view to make the order lines list in the form non-editable
284              for the members of some usability groups -->
285         <record id="view_order_form_editable_list" model="ir.ui.view">
286             <field name="name">sale.order.form.editable.list</field>
287             <field name="model">sale.order</field>
288             <field name="inherit_id" ref="sale.view_order_form"/>
289             <field name="groups_id" eval="[(6, 0, [ref('product.group_uos'), ref('product.group_stock_packaging'), ref('sale.group_mrp_properties')])]"/>
290             <field name="arch" type="xml">
291                 <xpath expr="//field[@name='order_line']/tree" position="attributes">
292                     <attribute name="editable"/>
293                 </xpath>
294             </field>
295         </record>
296
297         <record id="view_sales_order_filter" model="ir.ui.view">
298             <field name="name">sale.order.list.select</field>
299             <field name="model">sale.order</field>
300             <field name="arch" type="xml">
301                 <search string="Search Sales Order">
302                     <field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>
303                     <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
304                     <separator/>
305                     <filter icon="terp-document-new" string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
306                     <filter icon="terp-check" string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
307                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
308                     <filter icon="terp-dolar_ok!" string="Done" domain="[('state','=','done')]" help="Sales Order done"/>
309                     <separator/>
310                     <filter string="My" domain="[('user_id','=',uid)]" help="My Sales Orders" icon="terp-personal" name="my_sale_orders_filter"/>
311                     <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
312                     <field name="user_id"/>
313                     <field name="project_id"/>
314                     <group expand="0" string="Group By...">
315                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
316                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
317                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
318                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
319                     </group>
320                </search>
321             </field>
322         </record>
323
324         <record id="action_orders" model="ir.actions.act_window">
325             <field name="name">Sales Orders</field>
326             <field name="type">ir.actions.act_window</field>
327             <field name="res_model">sale.order</field>
328             <field name="view_type">form</field>
329             <field name="view_mode">tree,form,calendar,graph</field>
330             <field name="search_view_id" ref="view_sales_order_filter"/>
331             <field name="context">{
332                     'search_default_my_sale_orders_filter': 1
333                 }
334             </field>
335             <field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
336             <field name="help" type="html">
337                 <p class="oe_view_nocontent_create">
338                     Click to create a quotation that can be converted into a sales
339                     order.
340                 </p><p>
341                     OpenERP will help you efficiently handle the complete sales flow:
342                     quotation, sales order, delivery, invoicing and payment.
343                 </p>
344             </field>
345         </record>
346
347         <menuitem action="action_orders" id="menu_sale_order" parent="base.menu_sales" sequence="6" groups="base.group_sale_salesman,base.group_sale_manager"/>
348
349         <record id="action_orders_exception" model="ir.actions.act_window">
350             <field name="name">Sales in Exception</field>
351             <field name="type">ir.actions.act_window</field>
352             <field name="res_model">sale.order</field>
353             <field name="view_type">form</field>
354             <field name="view_mode">tree,form,calendar,graph</field>
355             <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
356             <field name="filter" eval="True"/>
357             <field name="search_view_id" ref="view_sales_order_filter"/>
358         </record>
359
360         <record id="action_orders_in_progress" model="ir.actions.act_window">
361             <field name="name">Sales Order in Progress</field>
362             <field name="type">ir.actions.act_window</field>
363             <field name="res_model">sale.order</field>
364             <field name="view_type">form</field>
365             <field name="view_mode">tree,form,calendar,graph</field>
366             <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
367             <field name="search_view_id" ref="view_sales_order_filter"/>
368         </record>
369
370
371         <record id="action_quotations" model="ir.actions.act_window">
372             <field name="name">Quotations</field>
373             <field name="type">ir.actions.act_window</field>
374             <field name="res_model">sale.order</field>
375             <field name="view_type">form</field>
376             <field name="view_id" ref="view_quotation_tree"/>
377             <field name="view_mode">tree,form,calendar,graph</field>
378             <field name="context">{'search_default_my_sale_orders_filter': 1}</field>
379             <field name="domain">[('state','in',('draft','sent','cancel'))]</field>
380             <field name="search_view_id" ref="view_sales_order_filter"/>
381             <field name="help" type="html">
382               <p class="oe_view_nocontent_create">
383                 Click to create a quotation, the first step of a new sale.
384               </p><p>
385                 OpenERP will help you handle efficiently the complete sale flow:
386                 from the quotation to the sales order, the
387                 delivery, the invoicing and the payment collection.
388               </p><p>
389                 The social feature helps you organize discussions on each sales
390                 order, and allow your customers to keep track of the evolution
391                 of the sales order.
392               </p>
393             </field>
394         </record>
395
396         <menuitem id="menu_sale_quotations"
397                 action="action_quotations" parent="base.menu_sales"
398                 sequence="5"/>
399
400         <record id="action_order_tree" model="ir.actions.act_window">
401             <field name="name">Old Quotations</field>
402             <field name="type">ir.actions.act_window</field>
403             <field name="res_model">sale.order</field>
404             <field name="view_type">form</field>
405             <field name="view_mode">tree,form,calendar,graph</field>
406             <field name="domain">[('state','=','draft'),('date_order','&lt;',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
407             <field name="filter" eval="True"/>
408             <field name="search_view_id" ref="view_sales_order_filter"/>
409         </record>
410
411
412         <record id="view_order_line_tree" model="ir.ui.view">
413             <field name="name">sale.order.line.tree</field>
414             <field name="model">sale.order.line</field>
415             <field name="arch" type="xml">
416                 <tree string="Sales Order Lines">
417                     <field name="product_id" invisible="1"/>
418                     <field name="order_id"/>
419                     <field name="order_partner_id"/>
420                     <field name="name"/>
421                     <field name="product_uom_qty" string="Qty"/>
422                     <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
423                     <field name="salesman_id"/>
424                     <field name="price_subtotal" sum="Total"/>
425                     <field name="state"/>
426                     <field name="invoiced"/>
427                 </tree>
428             </field>
429         </record>
430         <record id="view_order_line_form2" model="ir.ui.view">
431             <field name="name">sale.order.line.form2</field>
432             <field name="model">sale.order.line</field>
433             <field name="arch" type="xml">
434                 <form string="Sales Order Lines" version="7.0">
435                     <header>
436                         <button name="%(action_view_sale_order_line_make_invoice)d" string="Create Invoice" type="action" attrs="{'invisible': ['|',('invoiced', '=', 1), ('state', 'not in', ('confirmed', 'draft'))]}" class="oe_highlight" groups="base.group_user"/>
437                         <button name="button_cancel" string="Cancel Line" type="object" states="confirmed,exception" groups="base.group_user"/>
438                         <button name="button_done" string="Done" type="object"  attrs="{'invisible': ['|',('invoiced', '=', 0), ('state', 'not in', ('confirmed', 'exception'))]}" class="oe_highlight" groups="base.group_user"/>
439                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
440                     </header>
441                     <sheet>
442                     <label for="order_id" class="oe_edit_only"/>
443                     <h1><field name="order_id" domain="[('state','!=','done')]"/></h1>
444                     <label for="order_partner_id" class="oe_edit_only"/>
445                     <h2><field name="order_partner_id"/></h2>
446                     <group>
447                         <group>
448                             <field name="product_id"/>
449                             <label for="product_uom_qty"/>
450                             <div>
451                                 <field name="product_uom_qty" readonly="1" class="oe_inline"/>
452                                 <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
453                             </div>
454                         </group>
455                         <group>
456                             <field name="price_unit"/>
457                             <field name="discount" groups="sale.group_discount_per_so_line"/>
458                             <field name="price_subtotal"/>
459                             <field name="invoiced"/>
460                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
461                         </group>
462                     </group>
463                     <label for="name"/>
464                     <field name="name"/>
465                     </sheet>
466                 </form>
467             </field>
468         </record>
469
470         <record id="view_sales_order_line_filter" model="ir.ui.view">
471             <field name="name">sale.order.line.select</field>
472             <field name="model">sale.order.line</field>
473             <field name="arch" type="xml">
474                 <search string="Search Sales Order">
475                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('invoiced','&lt;&gt;', 1),('state','=','done')]"  help="Sales Order Lines ready to be invoiced"/>
476                     <separator/>
477                     <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
478                     <field name="order_id"/>
479                     <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/>
480                     <field name="product_id"/>
481                     <field name="salesman_id"/>
482                     <group expand="0" string="Group By...">
483                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
484                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}"/>
485                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'salesman_id'}"/>
486                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
487                     </group>
488                 </search>
489             </field>
490         </record>
491
492         <record id="view_sales_order_uninvoiced_line_filter" model="ir.ui.view">
493             <field name="name">sale.order.uninvoiced.line</field>
494             <field name="model">sale.order.line</field>
495             <field name="arch" type="xml">
496                 <search string="Search Uninvoiced Lines">
497                     <filter icon="terp-gtk-go-back-rtl" string="To Do" domain="[('state','=','confirmed')]" name="sale order" help="Confirmed sales order lines, not yet delivered"/>
498                     <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" name="sale_order_done" help="Sales order lines done"/>
499                     <filter icon="terp-accessories-archiver" string="Shipped" domain="[('state','=','done')]" name="unshipped" help="Sales Order Lines that are in 'done' state"/>
500                     <separator/>
501                     <filter icon="terp-dolar_ok!" string="Uninvoiced" name="uninvoiced" domain="[('invoiced','&lt;&gt;', 1),('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]" help="Sales Order Lines that are confirmed, done or in exception state and haven't yet been invoiced"/>
502                     <separator/>
503                     <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/>
504                     <field name="order_id"/>
505                     <field name="order_partner_id" filter_domain="[('order_partner_id', 'child_of', self)]"/>
506                     <field name="product_id"/>
507                     <field name="salesman_id"/>
508                     <group expand="0" string="Group By...">
509                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}" help="Order reference"/>
510                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
511                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
512                     </group>
513                 </search>
514             </field>
515         </record>
516
517         <record id="action_order_line_tree2" model="ir.actions.act_window">
518             <field name="name">Order Lines to Invoice</field>
519             <field name="type">ir.actions.act_window</field>
520             <field name="res_model">sale.order.line</field>
521             <field name="view_type">form</field>
522             <field name="view_mode">tree,form</field>
523             <field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
524             <field name="context">{"search_default_uninvoiced":1}</field>
525             <field name="filter" eval="True"/>
526             <field name="help" type="html">
527               <p>
528                 Here is a list of each sales order line to be invoiced. You can
529                 invoice sales orders partially, by lines of sales order. You do
530                 not need this list if you invoice from the delivery orders or
531                 if you invoice sales totally.
532               </p>
533             </field>
534         </record>
535
536         <record id="action_order_line_tree3" model="ir.actions.act_window">
537             <field name="name">Uninvoiced and Delivered Lines</field>
538             <field name="type">ir.actions.act_window</field>
539             <field name="res_model">sale.order.line</field>
540             <field name="view_type">form</field>
541             <field name="view_mode">tree,form</field>
542             <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
543             <field name="filter" eval="True"/>
544         </record>
545         <record id="action_order_line_product_tree" model="ir.actions.act_window">
546             <field name="context">{'search_default_product_id': active_id, 'default_product_id': active_id}</field>
547             <field name="name">Sales Order Lines</field>
548             <field name="res_model">sale.order.line</field>
549             <field name="view_id" ref="view_order_line_tree"/>
550         </record>
551         <record model="ir.ui.view" id="product_form_view_sale_order_button">
552             <field name="name">product.product.sale.order</field>
553             <field name="model">product.product</field>
554             <field name="inherit_id" ref="product.product_normal_form_view"/>
555             <field name="arch" type="xml">
556                 <xpath expr="//div[@name='buttons']" position="inside">
557                     <button string="Sales" name="%(action_order_line_product_tree)d" type="action" groups="base.group_sale_salesman"/>
558                 </xpath>
559             </field>
560         </record>
561         <menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
562         <menuitem id="menu_invoicing_sales_order_lines" parent="base.menu_invoiced" action="action_order_line_tree2" sequence="10" groups="sale.group_invoice_so_lines"/>
563
564         <record model="ir.ui.view" id="view_company_inherit_form2">
565             <field name="name">res.company.form.inherit</field>
566             <field name="inherit_id" ref="base.view_company_form"/>
567             <field name="model">res.company</field>
568             <field name="arch" type="xml">
569                 <xpath expr="//group[@name='account_grp']" position="after">
570                     <group name="sale_grp" string="Sales">
571                         <field name="sale_note" nolabel="1" placeholder="Default terms &amp; conditions..."/>
572                     </group>
573                 </xpath>
574             </field>
575         </record>
576     </data>
577 </openerp>