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