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