[MERGE] merged with trunk
[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                             <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'])]"/>
178                         </group>
179                         <group>
180                             <field name="date_order"/>
181                             <field name="shop_id" on_change="onchange_shop_id(shop_id)" widget="selection" groups="stock.group_locations"/>
182                             <field name="client_order_ref"/>
183                             <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
184                         </group>
185                     </group>
186                     <notebook>
187                         <page string="Order Lines">
188                             <field name="order_line">
189                                 <form string="Sales Order Lines" version="7.0">
190                                     <header>
191                                         <button name="%(action_view_sale_order_line_make_invoice)d" states="confirmed" string="Invoice" type="action" icon="terp-document-new"/>
192                         <field name="invoiced" invisible="1"/>
193                                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
194                                     </header>
195                                     <group>
196                                         <group>
197                                             <field name="product_id"
198                                                 context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
199                                                 groups="base.group_user" 
200                                                 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)"/>
201                                             <label for="product_uom_qty"/>
202                                             <div>
203                                                 <field
204                                                     context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
205                                                     name="product_uom_qty" class="oe_inline"
206                                                     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)"/>
207                                                 <field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"
208                                                     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)"/>
209                                             </div>
210                                             <label for="product_uos_qty" groups="product.group_uos"/>
211                                             <div groups="product.group_uos">
212                                                 <field name="product_uos_qty" class="oe_inline"/>
213                                                 <field name="product_uos" class="oe_inline oe_no_button"/>
214                                             </div>
215                                             <field name="price_unit"/>
216                                             <label for="discount" groups="sale.group_discount_per_so_line"/>
217                                             <div groups="sale.group_discount_per_so_line">
218                                                 <field name="discount" class="oe_inline"/> %%
219                                             </div>
220                                         </group>
221                                         <group>
222                                             <field name="product_packaging"
223                                                 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)"
224                                                 domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging"
225                                                 colspan="3"/>
226                                             <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
227                                             <label for="delay"/>
228                                             <div>
229                                                 <field name="delay" class="oe_inline"/> days
230                                             </div>
231                                             <field name="type"/>
232                                             <field name="th_weight"/>
233
234                                             <!-- we should put a config wizard for these two fields -->
235                                             <field name="address_allotment_id"/>
236                                             <field name="property_ids" widget="many2many_tags"/>
237                                         </group>
238                                     </group>
239                                     <label for="name"/>
240                                     <field name="name"/>
241                                     <div groups="base.group_no_one">
242                                         <label for="invoice_lines"/>
243                                         <field name="invoice_lines"/>
244                                         <label for="move_ids"/>
245                                         <field name="move_ids" widget="many2many"/>
246                                     </div>
247                                 </form>
248                                 <tree string="Sales Order Lines">
249                                     <field name="sequence"/>
250                                     <field name="name"/>
251                                     <field name="product_uom_qty" string="Quantity"/>
252                                     <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
253                                     <field groups="product.group_uos" name="product_uos_qty" string="Quantity (UoS)"/>
254                                     <field groups="product.group_uos" name="product_uos" string="UoS"/>
255                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
256                                     <field name="price_unit"/>
257                                     <field name="price_subtotal" groups="base.group_sale_notes_subtotal"/>
258                                 </tree>
259                             </field>
260                             <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
261                                 <field name="amount_untaxed"/>
262                                 <field name="amount_tax"/>
263                                 <field name="amount_total" class="oe_subtotal_footer_separator"/>
264                             </group>
265                             <group name="sale_delivery">
266                             </group>
267                             <div class="oe_clear">
268                                 <label for="note"/>
269                             </div>
270                             <field name="note" class="oe_inline"/>
271                         </page>
272                         <page string="Other Information" groups="base.group_user">
273                             <group>
274                                 <group name="logistics">
275                                     <field name="incoterm" widget="selection" groups="base.group_user"/>
276                                     <field name="picking_policy" required="True"/>
277                                     <field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
278                                     <field name="invoice_quantity" invisible="True"/>
279                                 </group>
280                                 <group groups="base.group_user">
281                                     <field name="user_id"/>
282                                     <field groups="base.group_no_one" name="origin"/>
283                                 </group>
284                                 <group name="sale_pay">
285                                     <field name="payment_term" widget="selection"/>
286                                     <field name="fiscal_position" widget="selection"/>
287                                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
288                                 </group>
289                                 <group>
290                                     <field name="invoiced"/>
291                                     <field name="shipped"/>
292                                 </group>
293                             </group>
294                         </page>
295                         <page string="History">
296                             <separator string="Invoices"/>
297                             <field name="invoice_ids" context="{'form_view_ref':'account.invoice_form'}">
298                                 <tree string="Invoices" colors="blue:state == 'draft';black:state in ('proforma','proforma2','open');gray:state == 'cancel'">
299                                     <field name="date_invoice"/>
300                                     <field name="number"/>
301                                     <field name="partner_id" string="Customer"/>
302                                     <field name="user_id"/>
303                                     <field name="date_due"/>
304                                     <field name="amount_total"/>
305                                     <field name="state"/>
306                                 </tree>
307                             </field>
308                             <separator string="Delivery Orders"/>
309                             <field name="picking_ids" context="{'default_type': 'out'}">
310                                 <tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and min_date &lt; current_date" string="Delivery Orders">
311                                     <field name="name"/>
312                                     <field name="partner_id" string="Customer"/>
313                                     <field name="min_date"/>
314                                     <field name="state"/>
315                                     <button name="action_process" states="assigned" string="Deliver" type="object" icon="gtk-go-forward" context="{'default_type': 'out'}"/>
316                                 </tree>
317                             </field>
318                         </page>
319                     </notebook>
320                 </sheet>
321                 <div class="oe_chatter">
322                     <field name="message_ids" widget="mail_thread"/>
323                 </div>
324                 </form>
325             </field>
326         </record>
327
328         <record id="view_sales_order_filter" model="ir.ui.view">
329             <field name="name">sale.order.list.select</field>
330             <field name="model">sale.order</field>
331             <field name="type">search</field>
332             <field name="arch" type="xml">
333                 <search string="Search Sales Order">
334                     <field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>
335                     <separator orientation="vertical"/>
336                     <filter icon="terp-mail-message-new"
337                         string="Inbox" help="Unread messages"
338                         name="needaction_pending"
339                         domain="[('needaction_pending','=',True)]"/>
340                     <separator orientation="vertical"/>
341                     <filter icon="terp-document-new" string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
342                     <filter icon="terp-check" string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
343                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
344                     <filter string="My Sale Orders" domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal" name="my_sale_orders_filter"/>
345                     <separator orientation="vertical"/>
346                     <field name="partner_id"/>
347                     <field name="user_id"/>
348                     <newline/>
349                     <group expand="0" string="Group By...">
350                         <filter string="Customer" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
351                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
352                         <separator orientation="vertical"/>
353                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
354                         <separator orientation="vertical"/>
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">{"search_default_sales":1}</field>
369             <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>
370         </record>
371         <menuitem action="action_order_form" id="menu_sale_order" parent="base.menu_sales" sequence="5" groups="base.group_sale_salesman,base.group_sale_manager"/>
372
373         <record id="action_order_tree2" model="ir.actions.act_window">
374             <field name="name">Sales in Exception</field>
375             <field name="type">ir.actions.act_window</field>
376             <field name="res_model">sale.order</field>
377             <field name="view_type">form</field>
378             <field name="view_mode">tree,form,calendar,graph</field>
379             <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
380             <field name="filter" eval="True"/>
381             <field name="search_view_id" ref="view_sales_order_filter"/>
382         </record>
383
384         <record id="action_order_tree4" model="ir.actions.act_window">
385             <field name="name">Sales Order in Progress</field>
386             <field name="type">ir.actions.act_window</field>
387             <field name="res_model">sale.order</field>
388             <field name="view_type">form</field>
389             <field name="view_mode">tree,form,calendar,graph</field>
390             <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
391             <field name="search_view_id" ref="view_sales_order_filter"/>
392         </record>
393
394
395         <record id="action_order_tree5" model="ir.actions.act_window">
396             <field name="name">Quotations</field>
397             <field name="type">ir.actions.act_window</field>
398             <field name="res_model">sale.order</field>
399             <field name="view_type">form</field>
400             <field name="view_mode">tree,form,calendar,graph</field>
401             <field name="context">{"search_default_draft":1}</field>
402             <field name="search_view_id" ref="view_sales_order_filter"/>
403             <field name="help">
404                 Click here to create a new quotation.
405                 &lt;p&gt;
406                 The "Quotation" is the first step of the Sales flow.  Manage your sales from quotation to invoice.
407                 &lt;p&gt;
408                 You will be able to sell products (manage deliveries) as well as services (create projects).
409             </field>
410         </record>
411
412         <menuitem id="menu_sale_quotations"
413         action="action_order_tree5" parent="base.menu_sales"
414         sequence="4"/>
415
416         <record id="action_order_tree" model="ir.actions.act_window">
417             <field name="name">Old Quotations</field>
418             <field name="type">ir.actions.act_window</field>
419             <field name="res_model">sale.order</field>
420             <field name="view_type">form</field>
421             <field name="view_mode">tree,form,calendar,graph</field>
422             <field name="domain">[('state','=','draft'),('date_order','&lt;',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
423             <field name="filter" eval="True"/>
424             <field name="search_view_id" ref="view_sales_order_filter"/>
425         </record>
426
427         <record id="view_order_line_graph" model="ir.ui.view">
428             <field name="name">sale.order.line.graph</field>
429             <field name="model">sale.order.line</field>
430             <field name="type">graph</field>
431             <field name="arch" type="xml">
432                 <graph string="Sales Order Lines">
433                     <field name="product_id"/>
434                     <field name="price_subtotal" operator="+"/>
435                 </graph>
436             </field>
437         </record>
438
439         <record id="view_order_line_tree" model="ir.ui.view">
440             <field name="name">sale.order.line.tree</field>
441             <field name="model">sale.order.line</field>
442             <field name="type">tree</field>
443             <field name="arch" type="xml">
444                 <tree string="Sales Order Lines">
445                     <field name="order_id"/>
446                     <field name="order_partner_id"/>
447                     <field name="product_id"/>
448                     <field name="product_uom_qty" string="Qty"/>
449                     <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
450                     <field name="salesman_id"/>
451                     <field name="price_subtotal" sum="Total" groups="base.group_sale_notes_subtotal"/>
452                     <field name="state"/>
453                     <field name="invoiced"/>
454                 </tree>
455             </field>
456         </record>
457         <record id="view_order_line_form2" model="ir.ui.view">
458             <field name="name">sale.order.line.form2</field>
459             <field name="model">sale.order.line</field>
460             <field name="type">form</field>
461             <field name="arch" type="xml">
462                 <form string="Sales Order Lines" version="7.0">
463                     <header>
464                         <span groups="base.group_user">
465                             <button name="button_cancel" string="Cancel" type="object" icon="gtk-cancel" states="confirmed,exception"/>
466                             <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"/>
467                             <button name="button_done" string="Done" type="object" states="confirmed,exception" icon="gtk-go-forward" class="oe_highlight"/>
468                         </span>
469                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
470                     </header>
471                     <sheet>
472                     <label for="order_id" class="oe_edit_only"/>
473                     <h1><field name="order_id"/></h1>
474                     <label for="order_partner_id" class="oe_edit_only"/>
475                     <h2><field name="order_partner_id"/></h2>
476                     <group>
477                         <group>
478                             <field name="product_id" readonly="1"/>
479                             <label name="product_uom_qty"/>
480                             <div>
481                                 <field name="product_uom_qty" readonly="1" class="oe_inline"/>
482                                 <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
483                             </div>
484                         </group>
485                         <group>
486                             <field name="price_unit"/>
487                             <field name="discount" groups="sale.group_discount_per_so_line"/>
488                             <field name="price_subtotal" groups="base.group_sale_notes_subtotal"/>
489                             <field name="invoiced"/>
490                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
491                         </group>
492                     </group>
493                     <label for="name"/>
494                     <field name="name"/>
495                     </sheet>
496                 </form>
497             </field>
498         </record>
499
500         <record id="view_sales_order_line_filter" model="ir.ui.view">
501             <field name="name">sale.order.line.select</field>
502             <field name="model">sale.order.line</field>
503             <field name="type">search</field>
504             <field name="arch" type="xml">
505                 <search string="Search Sales Order">
506                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('invoiced','&lt;&gt;', 1),('state','=','done')]"  help="Sale Order Lines ready to be invoiced"/>
507                     <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
508                     <separator orientation="vertical"/>
509                     <field name="order_id"/>
510                     <field name="order_partner_id"/>
511                     <field name="product_id"/>
512                     <field name="salesman_id"/>
513                     <newline/>
514                     <group expand="0" string="Group By...">
515                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
516                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}"/>
517                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'salesman_id'}"/>
518                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
519                     </group>
520                 </search>
521             </field>
522         </record>
523
524         <record id="view_sales_order_uninvoiced_line_filter" model="ir.ui.view">
525             <field name="name">sale.order.uninvoiced.line</field>
526             <field name="model">sale.order.line</field>
527             <field name="type">search</field>
528             <field name="arch" type="xml">
529                 <search string="Search Uninvoiced Lines">
530                     <filter icon="terp-gtk-go-back-rtl" string="To Do" domain="[('state','=','confirmed')]" name="sale order" help="Confirmed sale order lines, not yet delivered"/>
531                     <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" name="sale_order_done" help="Sale order lines done"/>
532                     <filter icon="terp-accessories-archiver" string="Shipped" domain="[('state','=','done')]" name="unshipped" help="Sale Order Lines that are in 'done' state"/>
533                     <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"/>
534                     <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/>
535                     <separator orientation="vertical"/>
536                     <field name="order_id"/>
537                     <field name="order_partner_id"/>
538                     <field name="product_id"/>
539                     <field name="salesman_id"/>
540                     <newline/>
541                     <group expand="0" string="Group By...">
542                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}" help="Order reference"/>
543                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
544                         <separator orientation="vertical"/>
545                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
546                     </group>
547                 </search>
548             </field>
549         </record>
550
551         <record id="action_order_line_tree2" model="ir.actions.act_window">
552             <field name="name">Order Lines to Invoice</field>
553             <field name="type">ir.actions.act_window</field>
554             <field name="res_model">sale.order.line</field>
555             <field name="view_type">form</field>
556             <field name="view_mode">tree,form,graph</field>
557             <field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
558             <field name="context">{"search_default_uninvoiced":1}</field>
559             <field name="filter" eval="True"/>
560             <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>
561         </record>
562
563         <record id="action_order_line_tree3" model="ir.actions.act_window">
564             <field name="name">Uninvoiced and Delivered Lines</field>
565             <field name="type">ir.actions.act_window</field>
566             <field name="res_model">sale.order.line</field>
567             <field name="view_type">form</field>
568             <field name="view_mode">tree,form,graph</field>
569             <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
570             <field name="filter" eval="True"/>
571         </record>
572
573         <act_window
574             context="{'search_default_product_id': active_id, 'default_product_id': active_id}"
575             id="action_order_line_product_tree"
576             name="Sales Order Lines"
577             res_model="sale.order.line"
578             src_model="product.product"
579             groups="base.group_sale_salesman"/>
580
581         <menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
582         <menuitem id="menu_invoicing_sales_order_lines" parent="base.menu_invoiced" action="action_order_line_tree2" sequence="10" groups="sale.group_invoice_so_lines"/>
583
584     </data>
585 </openerp>