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