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