[MERGE] forward port of branch 8.0 up to ed1c173
[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         <record id="view_sale_order_calendar" model="ir.ui.view">
17             <field name="name">sale.order.calendar</field>
18             <field name="model">sale.order</field>
19             <field name="arch" type="xml">
20                 <calendar string="Sales Orders" color="state" date_start="date_order">
21                     <field name="partner_id"/>
22                     <field name="amount_total"/>
23                 </calendar>
24             </field>
25         </record>
26         <record model="ir.ui.view" id="view_sale_order_graph">
27             <field name="name">sale.order.graph</field>
28             <field name="model">sale.order</field>
29             <field name="arch" type="xml">
30                 <graph string="Sales Orders" type="bar">
31                     <field name="partner_id" type="row"/>
32                     <field name="amount_total" type="measure"/>
33                 </graph>
34             </field>
35         </record>
36
37         <record id="view_order_tree" model="ir.ui.view">
38             <field name="name">sale.order.tree</field>
39             <field name="model">sale.order</field>
40             <field name="priority">2</field>
41             <field name="arch" type="xml">
42                 <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')">
43                     <field name="message_unread" invisible="1"/>
44                     <field name="name" string="Order Number"/>
45                     <field name="date_order"/>
46                     <field name="partner_id"/>
47                     <field name="user_id"/>
48                     <field name="amount_total" sum="Total Tax Included"/>
49                     <field name="state"/>
50                 </tree>
51             </field>
52         </record>
53
54         <record id="view_quotation_tree" model="ir.ui.view">
55             <field name="name">sale.order.tree</field>
56             <field name="model">sale.order</field>
57             <field name="priority">4</field>
58             <field name="arch" type="xml">
59                 <tree string="Quotation" fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')">
60                     <field name="message_unread" invisible="1"/>
61                     <field name="name" string="Quotation Number"/>
62                     <field name="date_order"/>
63                     <field name="partner_id"/>
64                     <field name="user_id"/>
65                     <field name="amount_total" sum="Total Tax Included"/>
66                     <field name="state"/>
67                 </tree>
68             </field>
69         </record>
70
71         <record id="view_order_form" model="ir.ui.view">
72             <field name="name">sale.order.form</field>
73             <field name="model">sale.order</field>
74             <field name="arch" type="xml">
75                 <form string="Sales Order">
76                     <header>
77                         <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" groups="base.group_user"/>
78                         <button name="invoice_corrected" states="invoice_except" string="Ignore Exception" groups="base.group_user"/>
79                         <button name="action_button_confirm" states="sent" string="Confirm Sale" class="oe_highlight" type="object" groups="base.group_user"/>
80                         <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
81                         <button name="action_quotation_send" string="Send by Email" type="object" states="sent,progress,manual" groups="base.group_user"/>
82                         <button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
83                         <button name="print_quotation" string="Print" type="object" states="sent,progress,manual" groups="base.group_user"/>
84                         <button name="action_button_confirm" states="draft" string="Confirm Sale" type="object" groups="base.group_user"/>
85                         <button name="action_view_invoice" string="View Invoice" type="object" class="oe_highlight"
86                             attrs="{'invisible': [('invoice_exists', '=', False)]}" groups="base.group_user"/>
87                         <button name="%(action_view_sale_advance_payment_inv)d" string="Create Invoice"
88                             type="action" states="manual" class="oe_highlight" groups="base.group_user"/>
89                         <button name="copy_quotation" states="cancel" string="New Copy of Quotation" type="object"/>
90                         <button name="cancel" states="draft,sent" string="Cancel" groups="base.group_user"/>
91                         <button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" groups="base.group_user"/>
92                         <button name="invoice_cancel" states="invoice_except" string="Cancel Order" groups="base.group_user"/>
93                         <field name="state" widget="statusbar" statusbar_visible="draft,sent,progress,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/>
94                 </header>
95                 <sheet>
96                     <h1>
97                         <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
98                         <label string="Sales Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
99                         <field name="name" class="oe_inline" readonly="1"/>
100                     </h1>
101                     <group>
102                         <group>
103                             <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
104                             <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}"/>
105                             <field name="partner_shipping_id" on_change="onchange_delivery_id(company_id, partner_id, partner_shipping_id, fiscal_position)" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/>
106                             <field name="project_id" context="{'partner_id':partner_invoice_id, 'default_pricelist_id':pricelist_id, 'default_name':name, 'default_type': 'contract'}" groups="sale.group_analytic_accounting" domain="[('type','in',['view','normal','contract'])]"/>
107                         </group>
108                         <group>
109                             <field name="date_order"/>
110                             <field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
111                             <field name="currency_id" invisible="1"/>
112                         </group>
113                     </group>
114                     <notebook>
115                         <page string="Order Lines">
116                             <field name="order_line">
117                                 <form string="Sales Order Lines">
118                                     <header groups="base.group_user">
119                                         <button name="%(action_view_sale_order_line_make_invoice)d" states="confirmed" string="Invoice" type="action" icon="terp-document-new"/>
120                                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
121                                     </header>
122                                     <group>
123                                         <group>
124                                             <field name="product_id"
125                                                 context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
126                                                 groups="base.group_user"
127                                                 on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
128                                             <label for="product_uom_qty"/>
129                                             <div>
130                                                 <field
131                                                     context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
132                                                     name="product_uom_qty" class="oe_inline"
133                                                     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)"/>
134                                                 <field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"
135
136                                                     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)"/>
137                                             </div>
138                                             <label for="product_uos_qty" groups="product.group_uos"/>
139                                             <div groups="product.group_uos">
140                                                 <field name="product_uos_qty" class="oe_inline"/>
141                                                 <field name="product_uos" options='{"no_open": True}' class="oe_inline"/>
142                                             </div>
143                                             <field name="price_unit"/>
144                                             <label for="discount" groups="sale.group_discount_per_so_line"/>
145                                             <div name="discount" groups="sale.group_discount_per_so_line">
146                                                 <field name="discount" class="oe_inline"/> %%
147                                             </div>
148                                         </group>
149                                         <group>
150                                             <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
151                                             <field name="th_weight"/>
152                                             <!-- we should put a config wizard for these two fields -->
153                                             <field name="address_allotment_id"/>
154                                         </group>
155                                     </group>
156                                     <label for="name"/>
157                                     <field name="name"/>
158                                     <div groups="base.group_no_one">
159                                         <label for="invoice_lines"/>
160                                         <field name="invoice_lines"/>
161                                     </div>
162                                 </form>
163                                 <tree string="Sales Order Lines" editable="bottom">
164                                     <field name="sequence" widget="handle"/>
165                                     <field name="state" invisible="1"/>
166                                     <field name="th_weight" invisible="1"/>
167                                     <field name="product_id"
168                                         context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
169                                         groups="base.group_user"
170                                         on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
171                                     <field name="name"/>
172                                     <field name="product_uom_qty"
173                                         context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
174                                         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)"/>
175                                     <field name="product_uom"
176                                         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)"
177                                         groups="product.group_uom" options='{"no_open": True}'/>
178                                     <field name="product_uos_qty" groups="product.group_uos" invisible="1"/>
179                                     <field name="product_uos" string="UoS" groups="product.group_uos" invisible="1"/>
180                                     <field name="price_unit"/>
181                                     <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
182                                     <field name="discount" groups="sale.group_discount_per_so_line"/>
183                                     <field name="price_subtotal"/>
184                                 </tree>
185                             </field>
186                             <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
187                                 <field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
188                                 <field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
189                                 <div class="oe_subtotal_footer_separator oe_inline">
190                                     <label for="amount_total" />
191                                     <button name="button_dummy"
192                                         states="draft,sent" string="(update)" type="object" class="oe_edit_only oe_link"/>
193                                 </div>
194                                 <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
195                             </group>
196                             <div class="oe_clear"/>
197                             <field name="note" class="oe_inline" placeholder="Terms and conditions..."/>
198                         </page>
199                         <page string="Other Information" groups="base.group_user">
200                             <group>
201                                 <group name="sales_person" groups="base.group_user">
202                                     <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'account.group_account_invoice', 'base.group_sale_salesman_all_leads']}"/>
203                                     <field name="section_id" options="{'no_create': True}" groups="base.group_multi_salesteams"/>
204                                     <field groups="base.group_no_one" name="origin"/>
205                                     <field name="client_order_ref"/>
206                                     <field name="validity_date"/>
207                                 </group>
208                                 <group name="sale_pay">
209                                     <field name="payment_term" options="{'no_create': True}"/>
210                                     <field name="fiscal_position" options="{'no_create': True}"
211                                         on_change="onchange_fiscal_position(fiscal_position, order_line, context)"/>
212                                     <field name="company_id" widget="selection" groups="base.group_multi_company"/>
213                                 </group>
214                                 <group>
215                                     <field name="invoiced"/>
216                                     <field name="invoice_exists" invisible="1"/>
217                                 </group>
218                             </group>
219                         </page>
220                     </notebook>
221                 </sheet>
222                 <div class="oe_chatter">
223                     <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
224                     <field name="message_ids" widget="mail_thread"/>
225                 </div>
226                 </form>
227             </field>
228         </record>
229
230         <!-- inherited view to make the order lines list in the form non-editable
231              for the members of some usability groups -->
232         <record id="view_order_form_editable_list" model="ir.ui.view">
233             <field name="name">sale.order.form.editable.list</field>
234             <field name="model">sale.order</field>
235             <field name="inherit_id" ref="sale.view_order_form"/>
236             <field name="groups_id" eval="[(4, ref('product.group_uos')), (4, ref('product.group_stock_packaging')), (4, ref('sale.group_mrp_properties'))]"/>
237             <field name="arch" type="xml">
238                 <xpath expr="//field[@name='order_line']/tree" position="attributes">
239                     <attribute name="editable"/>
240                 </xpath>
241             </field>
242         </record>
243
244         <record id="view_sales_order_filter" model="ir.ui.view">
245             <field name="name">sale.order.list.select</field>
246             <field name="model">sale.order</field>
247             <field name="arch" type="xml">
248                 <search string="Search Sales Order">
249                     <field name="name" string="Sales Order" filter_domain="['|',('name','ilike',self),('client_order_ref','ilike',self)]"/>
250                     <field name="partner_id" operator="child_of"/>
251                     <field name="user_id"/>
252                     <field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/>
253                     <field name="project_id"/>
254                     <filter string="My" domain="[('user_id','=',uid)]" name="my_sale_orders_filter"/>
255                     <separator/>
256                     <filter string="Quotations" name="draft" domain="[('state','in',('draft','sent'))]" help="Sales Order that haven't yet been confirmed"/>
257                     <filter string="Sales" name="sales" domain="[('state','in',('manual','progress'))]"/>
258                     <filter string="To Invoice" domain="[('state','=','manual')]" help="Sales Order ready to be invoiced"/>
259                     <filter string="Done" domain="[('state','=','done')]" help="Sales Order done"/>
260                     <separator/>
261                     <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
262                     <group expand="0" string="Group By">
263                         <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
264                         <filter string="Customer" domain="[]" context="{'group_by':'partner_id'}"/>
265                         <filter string="Order Month" domain="[]" context="{'group_by':'date_order'}"/>
266                     </group>
267                </search>
268             </field>
269         </record>
270
271         <record id="action_orders" model="ir.actions.act_window">
272             <field name="name">Sales Orders</field>
273             <field name="type">ir.actions.act_window</field>
274             <field name="res_model">sale.order</field>
275             <field name="view_type">form</field>
276             <field name="view_mode">tree,form,calendar,graph</field>
277             <field name="search_view_id" ref="view_sales_order_filter"/>
278             <field name="context">{
279                     'search_default_my_sale_orders_filter': 1
280                 }
281             </field>
282             <field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
283             <field name="help" type="html">
284                 <p class="oe_view_nocontent_create">
285                     Click to create a quotation that can be converted into a sales
286                     order.
287                 </p><p>
288                     Odoo will help you efficiently handle the complete sales flow:
289                     quotation, sales order, delivery, invoicing and payment.
290                 </p>
291             </field>
292         </record>
293
294         <menuitem action="action_orders" id="menu_sale_order" parent="base.menu_sales" sequence="6" groups="base.group_sale_salesman,base.group_sale_manager"/>
295
296         <record id="action_orders_exception" model="ir.actions.act_window">
297             <field name="name">Sales in Exception</field>
298             <field name="type">ir.actions.act_window</field>
299             <field name="res_model">sale.order</field>
300             <field name="view_type">form</field>
301             <field name="view_mode">tree,form,calendar,graph</field>
302             <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
303             <field name="filter" eval="True"/>
304             <field name="search_view_id" ref="view_sales_order_filter"/>
305         </record>
306
307         <record id="action_orders_in_progress" model="ir.actions.act_window">
308             <field name="name">Sales Order in Progress</field>
309             <field name="type">ir.actions.act_window</field>
310             <field name="res_model">sale.order</field>
311             <field name="view_type">form</field>
312             <field name="view_mode">tree,form,calendar,graph</field>
313             <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
314             <field name="search_view_id" ref="view_sales_order_filter"/>
315         </record>
316
317
318         <record id="action_quotations" model="ir.actions.act_window">
319             <field name="name">Quotations</field>
320             <field name="type">ir.actions.act_window</field>
321             <field name="res_model">sale.order</field>
322             <field name="view_type">form</field>
323             <field name="view_id" ref="view_quotation_tree"/>
324             <field name="view_mode">tree,form,calendar,graph</field>
325             <field name="context">{'search_default_my_sale_orders_filter': 1}</field>
326             <field name="domain">[('state','in',('draft','sent','cancel'))]</field>
327             <field name="search_view_id" ref="view_sales_order_filter"/>
328             <field name="help" type="html">
329               <p class="oe_view_nocontent_create">
330                 Click to create a quotation, the first step of a new sale.
331               </p><p>
332                 Odoo will help you handle efficiently the complete sale flow:
333                 from the quotation to the sales order, the
334                 delivery, the invoicing and the payment collection.
335               </p><p>
336                 The social feature helps you organize discussions on each sales
337                 order, and allow your customers to keep track of the evolution
338                 of the sales order.
339               </p>
340             </field>
341         </record>
342
343         <menuitem id="menu_sale_quotations"
344                 action="action_quotations" parent="base.menu_sales"
345                 sequence="5"/>
346
347         <record id="action_order_tree" model="ir.actions.act_window">
348             <field name="name">Old Quotations</field>
349             <field name="type">ir.actions.act_window</field>
350             <field name="res_model">sale.order</field>
351             <field name="view_type">form</field>
352             <field name="view_mode">tree,form,calendar,graph</field>
353             <field name="domain">[('state','=','draft'),('date_order','&lt;',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
354             <field name="filter" eval="True"/>
355             <field name="search_view_id" ref="view_sales_order_filter"/>
356         </record>
357
358
359         <record id="view_order_line_tree" model="ir.ui.view">
360             <field name="name">sale.order.line.tree</field>
361             <field name="model">sale.order.line</field>
362             <field name="arch" type="xml">
363                 <tree string="Sales Order Lines" create="false">
364                     <field name="product_id" invisible="1"/>
365                     <field name="order_id"/>
366                     <field name="order_partner_id"/>
367                     <field name="name"/>
368                     <field name="product_uom_qty" string="Qty"/>
369                     <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
370                     <field name="salesman_id"/>
371                     <field name="price_subtotal" sum="Total"/>
372                     <field name="state"/>
373                     <field name="invoiced"/>
374                 </tree>
375             </field>
376         </record>
377         <record id="view_order_line_form2" model="ir.ui.view">
378             <field name="name">sale.order.line.form2</field>
379             <field name="model">sale.order.line</field>
380             <field name="arch" type="xml">
381                 <form string="Sales Order Lines" create="false">
382                     <header>
383                         <button name="%(action_view_sale_order_line_make_invoice)d" string="Create Invoice" type="action" attrs="{'invisible': ['|',('invoiced', '=', 1), ('state', 'not in', ('confirmed', 'draft'))]}" class="oe_highlight" groups="base.group_user"/>
384                         <button name="button_cancel" string="Cancel Line" type="object" states="confirmed,exception" groups="base.group_user"/>
385                         <button name="button_done" string="Done" type="object"  attrs="{'invisible': ['|',('invoiced', '=', 0), ('state', 'not in', ('confirmed', 'exception'))]}" class="oe_highlight" groups="base.group_user"/>
386                         <field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
387                     </header>
388                     <sheet>
389                     <label for="order_id" class="oe_edit_only"/>
390                     <h1><field name="order_id" domain="[('state','!=','done')]"/></h1>
391                     <label for="order_partner_id" class="oe_edit_only"/>
392                     <h2><field name="order_partner_id"/></h2>
393                     <group>
394                         <group>
395                             <field name="product_id"/>
396                             <label for="product_uom_qty"/>
397                             <div>
398                                 <field name="product_uom_qty" readonly="1" class="oe_inline"/>
399                                 <field name="product_uom" groups="product.group_uom" class="oe_inline"/>
400                             </div>
401                         </group>
402                         <group>
403                             <field name="price_unit"/>
404                             <field name="discount" groups="sale.group_discount_per_so_line"/>
405                             <field name="price_subtotal"/>
406                             <field name="invoiced"/>
407                             <field name="company_id" groups="base.group_multi_company" readonly="1"/>
408                         </group>
409                     </group>
410                     <label for="name"/>
411                     <field name="name"/>
412                     </sheet>
413                 </form>
414             </field>
415         </record>
416
417         <record id="view_sales_order_line_filter" model="ir.ui.view">
418             <field name="name">sale.order.line.select</field>
419             <field name="model">sale.order.line</field>
420             <field name="arch" type="xml">
421                 <search string="Search Sales Order">
422                     <filter icon="terp-dolar_ok!" string="To Invoice" domain="[('invoiced','&lt;&gt;', 1),('state','=','done')]"  help="Sales Order Lines ready to be invoiced"/>
423                     <separator/>
424                     <filter string="My Sales Order Lines" icon="terp-personnal" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
425                     <field name="order_id"/>
426                     <field name="order_partner_id" operator="child_of"/>
427                     <field name="product_id"/>
428                     <field name="salesman_id"/>
429                     <group expand="0" string="Group By">
430                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
431                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}"/>
432                         <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'salesman_id'}"/>
433                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
434                     </group>
435                 </search>
436             </field>
437         </record>
438
439         <record id="view_sales_order_uninvoiced_line_filter" model="ir.ui.view">
440             <field name="name">sale.order.uninvoiced.line</field>
441             <field name="model">sale.order.line</field>
442             <field name="arch" type="xml">
443                 <search string="Search Uninvoiced Lines">
444                     <filter icon="terp-gtk-go-back-rtl" string="To Do" domain="[('state','=','confirmed')]" name="sale order" help="Confirmed sales order lines, not yet delivered"/>
445                     <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" name="sale_order_done" help="Sales order lines done"/>
446                     <filter icon="terp-accessories-archiver" string="Shipped" domain="[('state','=','done')]" name="unshipped" help="Sales Order Lines that are in 'done' state"/>
447                     <separator/>
448                     <filter icon="terp-dolar_ok!" string="Uninvoiced" name="uninvoiced" domain="[('invoiced','&lt;&gt;', 1),('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]" help="Sales Order Lines that are confirmed, done or in exception state and haven't yet been invoiced"/>
449                     <separator/>
450                     <filter string="My Sales Order Lines" icon="terp-personal" domain="[('salesman_id','=',uid)]" help="My Sales Order Lines"/>
451                     <field name="order_id"/>
452                     <field name="order_partner_id" operator="child_of"/>
453                     <field name="product_id"/>
454                     <field name="salesman_id"/>
455                     <group expand="0" string="Group By">
456                         <filter string="Order" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'order_id'}" help="Order reference"/>
457                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
458                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
459                     </group>
460                 </search>
461             </field>
462         </record>
463
464         <record id="action_order_line_tree2" model="ir.actions.act_window">
465             <field name="name">Order Lines to Invoice</field>
466             <field name="type">ir.actions.act_window</field>
467             <field name="res_model">sale.order.line</field>
468             <field name="view_type">form</field>
469             <field name="view_mode">tree,form</field>
470             <field name="search_view_id" ref="view_sales_order_uninvoiced_line_filter"/>
471             <field name="context">{"search_default_uninvoiced":1}</field>
472             <field name="filter" eval="True"/>
473             <field name="help" type="html">
474               <p>
475                 Here is a list of each sales order line to be invoiced. You can
476                 invoice sales orders partially, by lines of sales order. You do
477                 not need this list if you invoice from the delivery orders or
478                 if you invoice sales totally.
479               </p>
480             </field>
481         </record>
482
483         <record id="action_order_line_tree3" model="ir.actions.act_window">
484             <field name="name">Uninvoiced and Delivered Lines</field>
485             <field name="type">ir.actions.act_window</field>
486             <field name="res_model">sale.order.line</field>
487             <field name="view_type">form</field>
488             <field name="view_mode">tree,form</field>
489             <field name="domain">[('invoiced','&lt;&gt;', 1),('state','=','done')]</field>
490             <field name="filter" eval="True"/>
491         </record>
492         <record id="action_order_line_product_tree" model="ir.actions.act_window">
493             <field name="context">{'search_default_product_id': active_id, 'default_product_id': active_id}</field>
494             <field name="name">Sales Order Lines</field>
495             <field name="res_model">sale.order.line</field>
496             <field name="view_id" ref="view_order_line_tree"/>
497         </record>
498         <record model="ir.ui.view" id="product_form_view_sale_order_button">
499             <field name="name">product.product.sale.order</field>
500             <field name="model">product.product</field>
501             <field name="inherit_id" ref="product.product_normal_form_view"/>
502             <field name="groups_id" eval="[(4, ref('base.group_sale_salesman'))]"/>
503             <field name="arch" type="xml">
504                 <xpath expr="//div[@name='buttons']" position="inside">
505                     <button class="oe_inline oe_stat_button" name="%(action_order_line_product_tree)d" 
506                         type="action" icon="fa-strikethrough">
507                         <field string="Sales" name="sales_count" widget="statinfo" />
508                     </button>
509                 </xpath>
510             </field>
511         </record>
512
513         <record model="ir.ui.view" id="product_template_form_view_sale_order_button">
514             <field name="name">product.template.sale.order.button</field>
515             <field name="model">product.template</field>
516             <field name="inherit_id" ref="product.product_template_only_form_view"/>
517             <field name="groups_id" eval="[(4, ref('base.group_sale_salesman'))]"/>
518             <field name="arch" type="xml">
519                 <xpath expr="//div[@name='buttons']" position="inside">
520                     <button class="oe_inline oe_stat_button" name="action_view_sales" 
521                         type="object" icon="fa-strikethrough">
522                         <field string="Sales" name="sales_count" widget="statinfo" />
523                     </button>
524                 </xpath>
525             </field>
526         </record>
527
528
529         <record model="ir.ui.view" id="view_company_inherit_form2">
530             <field name="name">res.company.form.inherit</field>
531             <field name="inherit_id" ref="base.view_company_form"/>
532             <field name="model">res.company</field>
533             <field name="arch" type="xml">
534                 <xpath expr="//group[@name='account_grp']" position="after">
535                     <group name="sale_grp" string="Sales">
536                         <field name="sale_note" nolabel="1" placeholder="Default terms &amp; conditions..."/>
537                     </group>
538                 </xpath>
539             </field>
540         </record>
541
542        <!-- Update account invoice list view!-->
543         <record model="ir.ui.view" id="account_invoice_tree">
544             <field name="name">Account Invoice</field>
545             <field name="model">account.invoice</field>
546             <field name="inherit_id" ref="account.invoice_tree"/>
547             <field name="arch" type="xml">
548                 <data>
549                     <xpath expr="//field[@name='user_id']" position="after">
550                         <field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/>
551                     </xpath>
552                 </data>
553             </field>
554         </record>
555
556         <!-- Update account invoice search view!-->
557         <record id="account_invoice_groupby_inherit" model="ir.ui.view">
558             <field name="name">account.invoice.groupby</field>
559             <field name="model">account.invoice</field>
560             <field name="inherit_id" ref="account.view_account_invoice_filter"/>
561             <field name="arch" type="xml">
562                 <xpath expr="//field[@name='user_id']" position="after">
563                     <field name="section_id" groups="base.group_multi_salesteams"/>
564                 </xpath>
565                 <xpath expr="//group/filter[@string='Status']" position="after">
566                     <filter string="Sales Team" domain="[]" context="{'group_by':'section_id'}" groups="base.group_multi_salesteams"/>
567                 </xpath>
568             </field>
569         </record>
570
571         <!-- Update account invoice !-->
572         <record model="ir.ui.view" id="account_invoice_form">
573             <field name="name">Account Invoice</field>
574             <field name="model">account.invoice</field>
575             <field name="inherit_id" ref="account.invoice_form"/>
576             <field name="arch" type="xml">
577                 <data>
578                     <xpath expr="//field[@name='user_id']" position="after">
579                         <field name="section_id" groups="base.group_multi_salesteams"/>
580                     </xpath>
581                 </data>
582             </field>
583         </record>
584
585         <!-- search by Salesteams -->
586         <record id="action_orders_salesteams" model="ir.actions.act_window">
587             <field name="name">Sales Orders</field>
588             <field name="type">ir.actions.act_window</field>
589             <field name="res_model">sale.order</field>
590             <field name="view_type">form</field>
591             <field name="view_mode">tree,form,calendar,graph</field>
592             <field name="search_view_id" ref="sale.view_sales_order_filter"/>
593             <field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
594             <field name="context">{
595                     'search_default_section_id': [active_id],
596                     'default_section_id': active_id,
597                 }
598             </field>
599             <field name="help" type="html">
600               <p class="oe_view_nocontent_create">
601                 Click to create a quotation that can be converted into a sales
602                 order.
603               </p><p>
604                 Odoo will help you efficiently handle the complete sales flow:
605                 quotation, sales order, delivery, invoicing and payment.
606               </p>
607             </field>
608         </record>
609
610         <record id="action_quotations_salesteams" model="ir.actions.act_window">
611             <field name="name">Quotations</field>
612             <field name="type">ir.actions.act_window</field>
613             <field name="res_model">sale.order</field>
614             <field name="view_type">form</field>
615             <field name="view_id" ref="sale.view_quotation_tree"/>
616             <field name="view_mode">tree,form,calendar,graph</field>
617             <field name="context">{
618                     'search_default_section_id': [active_id],
619                     'default_section_id': active_id,
620                     'show_address': 1,
621                 }
622             </field>
623             <field name="domain">[('state','in',('draft','sent','cancel'))]</field>
624             <field name="search_view_id" ref="sale.view_sales_order_filter"/>
625             <field name="help" type="html">
626               <p class="oe_view_nocontent_create">
627                 Click to create a quotation, the first step of a new sale.
628               </p><p>
629                 Odoo will help you handle efficiently the complete sale flow:
630                 from the quotation to the sales order, the
631                 delivery, the invoicing and the payment collection.
632               </p><p>
633                 The social feature helps you organize discussions on each sales
634                 order, and allow your customers to keep track of the evolution
635                 of the sales order.
636               </p>
637             </field>
638         </record>
639
640         <record id="action_invoice_salesteams" model="ir.actions.act_window">
641             <field name="name">Invoices</field>
642             <field name="res_model">account.invoice</field>
643             <field name="view_type">form</field>
644             <field name="view_mode">tree,form,calendar,graph</field>
645             <field name="view_id" ref="account.invoice_tree"/>
646             <field name="domain">[
647                 ('state', 'not in', ['draft', 'cancel']),
648                 ('type', '=', 'out_invoice')]</field>
649             <field name="context">{
650                     'search_default_section_id': [active_id],
651                     'default_section_id': active_id,
652                     'default_type':'out_invoice',
653                     'type':'out_invoice',
654                     'journal_type': 'sale',
655                 }
656             </field>
657             <field name="search_view_id" ref="account.view_account_invoice_filter"/>
658         </record>
659
660         <record id="action_invoice_salesteams_view_tree" model="ir.actions.act_window.view">
661             <field name="sequence">1</field>
662             <field name="view_mode">tree</field>
663             <field name="act_window_id" ref="sale.action_invoice_salesteams"/>
664         </record>
665
666         <record id="action_invoice_salesteams_view_form" model="ir.actions.act_window.view">
667             <field name="sequence">2</field>
668             <field name="view_mode">form</field>
669             <field name="view_id" ref="account.invoice_form"/>
670             <field name="act_window_id" ref="sale.action_invoice_salesteams"/>
671         </record>
672
673         <record id="action_order_report_quotation_salesteam" model="ir.actions.act_window">
674             <field name="name">Quotations Analysis</field>
675             <field name="res_model">sale.report</field>
676             <field name="view_mode">graph</field>
677             <field name="domain">[('state','=','draft'),('section_id', '=', active_id)]</field>
678             <field name="context">{'search_default_order_month':1}</field>
679             <field name="help">This report performs analysis on your quotations. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
680         </record>
681
682         <record id="action_order_report_so_salesteam" model="ir.actions.act_window">
683             <field name="name">Sales Analysis</field>
684             <field name="res_model">sale.report</field>
685             <field name="view_mode">graph</field>
686             <field name="domain">[('state','not in',('draft','sent','cancel')),('section_id', '=', active_id)]</field>
687             <field name="context">{'search_default_order_month':1}</field>
688             <field name="help">This report performs analysis on your sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
689         </record>
690
691         <record id="action_account_invoice_report_salesteam" model="ir.actions.act_window">
692             <field name="name">Invoices Analysis</field>
693             <field name="res_model">account.invoice.report</field>
694             <field name="view_mode">graph</field>
695             <field name="domain">[('section_id', '=', active_id),('state', 'not in', ['draft', 'cancel'])]</field>
696             <field name="context">{'search_default_month':1}</field>
697             <field name="help">From this report, you can have an overview of the amount invoiced to your customer. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
698         </record>
699     </data>
700 </openerp>