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