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