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