[MERGE] trunk-fix-mail-mail-rules-tde: OpenChatter 'Rule Yur Daddy' Branch
[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"/>
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_order_form" model="ir.ui.view">
145             <field name="name">sale.order.form</field>
146             <field name="model">sale.order</field>
147             <field name="arch" type="xml">
148                 <form string="Sales Order" version="7.0">
149                     <header>
150                         <span groups="base.group_user">
151                             <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice"/>
152                             <button name="invoice_corrected" states="invoice_except" string="Ignore Exception"/>
153                             <button name="action_quotation_send" string="Send by Mail" type="object" states="draft" class="oe_highlight"/>
154                             <button name="action_quotation_send" string="Send by Mail" type="object" states="sent"/>
155                             <button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight"/>
156                             <button name="print_quotation" string="Print" type="object" states="sent"/>
157                             <button name="action_button_confirm" states="draft" string="Confirm" type="object"/>
158                             <button name="action_button_confirm" states="sent" string="Confirm" class="oe_highlight" type="object"/>
159                             <button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
160                               attrs="{'invisible': [('invoice_exists', '=', False)]}"/>
161                             <button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
162                                 type="action" states="manual" class="oe_highlight"/>
163                             <button name="cancel" states="draft,sent" string="Cancel"/>
164                             <button name="action_cancel" states="manual,progress" string="Cancel" type="object"/>
165                             <button name="invoice_cancel" states="invoice_except" string="Cancel"/>
166                         </span>
167                         <field name="state" widget="statusbar" statusbar_visible="draft,sent,invoiced,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/>
168                 </header>
169                 <sheet>
170                     <h1>
171                         <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
172                         <label string="Sale Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
173                         <field name="name" class="oe_inline" readonly="1"/>
174                     </h1>
175                     <group>
176                         <group>
177                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}"/>
178                             <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address"/>
179                             <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address"/>
180                             <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'])]"/>
181                         </group>
182                         <group>
183                             <field name="date_order"/>
184                             <field name="shop_id" invisible="1"/>
185                             <field name="client_order_ref"/>
186                             <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
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="th_weight"/>
228
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"/>
265                                 <field name="amount_tax"/>
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"/>
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_is_follower" invisible="1"/>
314                     <field name="message_ids" widget="mail_thread"/>
315                     <field name="message_follower_ids" widget="mail_followers"/>
316                 </div>
317                 </form>
318             </field>
319         </record>
320
321         <!-- inherited view to make the order lines list in the form non-editable
322              for the members of some usability groups -->
323         <record id="view_order_form_editable_list" model="ir.ui.view">
324             <field name="name">sale.order.form.editable.list</field>
325             <field name="model">sale.order</field>
326             <field name="inherit_id" ref="sale.view_order_form"/>
327             <field name="groups_id" eval="[(6, 0, [ref('product.group_uos'), ref('product.group_stock_packaging'), ref('sale.group_mrp_properties')])]"/>
328             <field name="arch" type="xml">
329                 <xpath expr="//field[@name='order_line']/tree" position="attributes">
330                     <attribute name="editable"/>
331                 </xpath>
332             </field>
333         </record>
334
335         <record id="view_sales_order_filter" model="ir.ui.view">
336             <field name="name">sale.order.list.select</field>
337             <field name="model">sale.order</field>
338             <field name="arch" type="xml">
339                 <search string="Search Sales Order">
340                     <field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>
341                     <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
342                     <separator/>
343                     <filter icon="terp-document-new" string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
344                     <filter icon="terp-check" string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
345                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
346                     <filter icon="terp-dolar_ok!" string="Done" domain="[('state','=','done')]" help="Sales Order done"/>
347                     <separator/>
348                     <filter string="My Sale Orders" domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal" name="my_sale_orders_filter"/>
349                     <field name="partner_id"/>
350                     <field name="user_id"/>
351                     <group expand="0" string="Group By...">
352                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
353                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
354                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
355                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
356                     </group>
357                </search>
358             </field>
359         </record>
360
361         <record id="action_order_form" model="ir.actions.act_window">
362             <field name="name">Sales Orders</field>
363             <field name="type">ir.actions.act_window</field>
364             <field name="res_model">sale.order</field>
365             <field name="view_type">form</field>
366             <field name="view_mode">tree,form,calendar,graph</field>
367             <field name="search_view_id" ref="view_sales_order_filter"/>
368             <field name="context">{'show_address': 1}</field>
369             <field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
370             <field name="help" type="html">
371               <p class="oe_view_nocontent_create">
372                 Click to create a quotation that can be converted into a sale
373                 order.
374               </p><p>
375                 OpenERP will help you efficiently handle the complete sales flow:
376                 quotation, sale order, delivery, invoicing and payment.
377               </p>
378             </field>
379         </record>
380         <menuitem action="action_order_form" id="menu_sale_order" parent="base.menu_sales" sequence="5" groups="base.group_sale_salesman,base.group_sale_manager"/>
381
382         <record id="action_order_tree2" model="ir.actions.act_window">
383             <field name="name">Sales in Exception</field>
384             <field name="type">ir.actions.act_window</field>
385             <field name="res_model">sale.order</field>
386             <field name="view_type">form</field>
387             <field name="view_mode">tree,form,calendar,graph</field>
388             <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
389             <field name="filter" eval="True"/>
390             <field name="search_view_id" ref="view_sales_order_filter"/>
391         </record>
392
393         <record id="action_order_tree4" model="ir.actions.act_window">
394             <field name="name">Sales Order in Progress</field>
395             <field name="type">ir.actions.act_window</field>
396             <field name="res_model">sale.order</field>
397             <field name="view_type">form</field>
398             <field name="view_mode">tree,form,calendar,graph</field>
399             <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
400             <field name="search_view_id" ref="view_sales_order_filter"/>
401         </record>
402
403
404         <record id="action_order_tree5" model="ir.actions.act_window">
405             <field name="name">Quotations</field>
406             <field name="type">ir.actions.act_window</field>
407             <field name="res_model">sale.order</field>
408             <field name="view_type">form</field>
409             <field name="view_mode">tree,form,calendar,graph</field>
410             <field name="context">{'show_address': 1}</field>
411             <field name="domain">[('state','in',('draft','sent','cancel'))]</field>
412             <field name="search_view_id" ref="view_sales_order_filter"/>
413             <field name="help" type="html">
414               <p class="oe_view_nocontent_create">
415                 Click to create a quotation, the first step of a new sale.
416               </p><p>
417                 OpenERP will help you handle efficiently the complete sale flow:
418                 from the quotation to the sale order, the
419                 delivery, the invoicing and the payment collection.
420               </p><p>
421                 The social feature helps you organize discussions on each sale
422                 order, and allow your customers to keep track of the evolution
423                 of the sale order.
424               </p>
425             </field>
426         </record>
427
428         <menuitem id="menu_sale_quotations"
429         action="action_order_tree5" parent="base.menu_sales"
430         sequence="4"/>
431
432         <record id="action_order_tree" model="ir.actions.act_window">
433             <field name="name">Old Quotations</field>
434             <field name="type">ir.actions.act_window</field>
435             <field name="res_model">sale.order</field>
436             <field name="view_type">form</field>
437             <field name="view_mode">tree,form,calendar,graph</field>
438             <field name="domain">[('state','=','draft'),('date_order','&lt;',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
439             <field name="filter" eval="True"/>
440             <field name="search_view_id" ref="view_sales_order_filter"/>
441         </record>
442
443         <record id="view_order_line_graph" model="ir.ui.view">
444             <field name="name">sale.order.line.graph</field>
445             <field name="model">sale.order.line</field>
446             <field name="arch" type="xml">
447                 <graph string="Sales Order Lines">
448                     <field name="product_id"/>
449                     <field name="price_subtotal" operator="+"/>
450                 </graph>
451             </field>
452         </record>
453
454         <record id="view_order_line_tree" model="ir.ui.view">
455             <field name="name">sale.order.line.tree</field>
456             <field name="model">sale.order.line</field>
457             <field name="arch" type="xml">
458                 <tree string="Sales Order Lines">
459                     <field name="order_id"/>
460                     <field name="order_partner_id"/>
461                     <field name="name"/>
462                     <field name="product_uom_qty" string="Qty"/>
463                     <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
464                     <field name="salesman_id"/>
465                     <field name="price_subtotal" sum="Total"/>
466                     <field name="state"/>
467                     <field name="invoiced"/>
468                 </tree>
469             </field>
470         </record>
471         <record id="view_order_line_form2" model="ir.ui.view">
472             <field name="name">sale.order.line.form2</field>
473             <field name="model">sale.order.line</field>
474             <field name="arch" type="xml">
475                 <form string="Sales Order Lines" version="7.0">
476                     <header>
477                         <span groups="base.group_user">
478                             <button name="button_cancel" string="Cancel" type="object" states="confirmed,exception"/>
479                             <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"/>
480                             <button name="button_done" string="Done" type="object"  attrs="{'invisible': ['|',('invoiced', '=', 0), ('state', 'not in', ('confirmed', 'exception'))]}" class="oe_highlight"/>
481                         </span>
482                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
483                     </header>
484                     <sheet>
485                     <label for="order_id" class="oe_edit_only"/>
486                     <h1><field name="order_id"/></h1>
487                     <label for="order_partner_id" class="oe_edit_only"/>
488                     <h2><field name="order_partner_id"/></h2>
489                     <group>
490                         <group>
491                             <field name="product_id" readonly="1"/>
492                             <label for="product_uom_qty"/>
493                             <div>
494                                 <field name="product_uom_qty" readonly="1" class="oe_inline"/>
495                                 <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
496                             </div>
497                         </group>
498                         <group>
499                             <field name="price_unit"/>
500                             <field name="discount" groups="sale.group_discount_per_so_line"/>
501                             <field name="price_subtotal"/>
502                             <field name="invoiced"/>
503                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
504                         </group>
505                     </group>
506                     <label for="name"/>
507                     <field name="name"/>
508                     </sheet>
509                 </form>
510             </field>
511         </record>
512
513         <record id="view_sales_order_line_filter" model="ir.ui.view">
514             <field name="name">sale.order.line.select</field>
515             <field name="model">sale.order.line</field>
516             <field name="arch" type="xml">
517                 <search string="Search Sales Order">
518                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('invoiced','&lt;&gt;', 1),('state','=','done')]"  help="Sale Order Lines ready to be invoiced"/>
519                     <separator/>
520                     <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
521                     <field name="order_id"/>
522                     <field name="order_partner_id"/>
523                     <field name="product_id"/>
524                     <field name="salesman_id"/>
525                     <group expand="0" string="Group By...">
526                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
527                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}"/>
528                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'salesman_id'}"/>
529                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
530                     </group>
531                 </search>
532             </field>
533         </record>
534
535         <record id="view_sales_order_uninvoiced_line_filter" model="ir.ui.view">
536             <field name="name">sale.order.uninvoiced.line</field>
537             <field name="model">sale.order.line</field>
538             <field name="arch" type="xml">
539                 <search string="Search Uninvoiced Lines">
540                     <filter icon="terp-gtk-go-back-rtl" string="To Do" domain="[('state','=','confirmed')]" name="sale order" help="Confirmed sale order lines, not yet delivered"/>
541                     <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" name="sale_order_done" help="Sale order lines done"/>
542                     <filter icon="terp-accessories-archiver" string="Shipped" domain="[('state','=','done')]" name="unshipped" help="Sale Order Lines that are in 'done' state"/>
543                     <separator/>
544                     <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"/>
545                     <separator/>
546                     <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/>
547                     <field name="order_id"/>
548                     <field name="order_partner_id"/>
549                     <field name="product_id"/>
550                     <field name="salesman_id"/>
551                     <group expand="0" string="Group By...">
552                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}" help="Order reference"/>
553                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
554                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
555                     </group>
556                 </search>
557             </field>
558         </record>
559
560         <record id="action_order_line_tree2" model="ir.actions.act_window">
561             <field name="name">Order Lines to Invoice</field>
562             <field name="type">ir.actions.act_window</field>
563             <field name="res_model">sale.order.line</field>
564             <field name="view_type">form</field>
565             <field name="view_mode">tree,form,graph</field>
566             <field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
567             <field name="context">{"search_default_uninvoiced":1}</field>
568             <field name="filter" eval="True"/>
569             <field name="help" type="html">
570               <p>
571                 Here is a list of each sales order line to be invoiced. You can
572                 invoice sales orders partially, by lines of sales order. You do
573                 not need this list if you invoice from the delivery orders or
574                 if you invoice sales totally.
575               </p>
576             </field>
577         </record>
578
579         <record id="action_order_line_tree3" model="ir.actions.act_window">
580             <field name="name">Uninvoiced and Delivered Lines</field>
581             <field name="type">ir.actions.act_window</field>
582             <field name="res_model">sale.order.line</field>
583             <field name="view_type">form</field>
584             <field name="view_mode">tree,form,graph</field>
585             <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
586             <field name="filter" eval="True"/>
587         </record>
588
589         <act_window
590             context="{'search_default_product_id': active_id, 'default_product_id': active_id}"
591             id="action_order_line_product_tree"
592             name="Sales Order Lines"
593             res_model="sale.order.line"
594             src_model="product.product"
595             groups="base.group_sale_salesman"/>
596
597         <menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
598         <menuitem id="menu_invoicing_sales_order_lines" parent="base.menu_invoiced" action="action_order_line_tree2" sequence="10" groups="sale.group_invoice_so_lines"/>
599
600     </data>
601 </openerp>