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