1 <?xml version="1.0" encoding="utf-8"?>
4 <menuitem icon="terp-sale" id="menu_sale_root" name="Sales Management"
5 groups="group_sale_user"/>
7 <record id="view_shop_form" model="ir.ui.view">
8 <field name="name">sale.shop</field>
9 <field name="model">sale.shop</field>
10 <field name="type">form</field>
11 <field name="arch" type="xml">
12 <form string="Sale Shop">
13 <field name="name" select="1"/>
14 <field name="warehouse_id" required="1" select="1" widget="selection"/>
15 <separator colspan="4" string="Accounting"/>
16 <field name="payment_default_id"/>
17 <field domain="[('type','=','sale')]" name="pricelist_id" select="1"/>
18 <field name="project_id" select="1"/>
22 <record id="view_shop_tree" model="ir.ui.view">
23 <field name="name">sale.shop</field>
24 <field name="model">sale.shop</field>
25 <field name="type">tree</field>
26 <field name="arch" type="xml">
27 <tree string="Sale Shop">
29 <field name="pricelist_id"/>
30 <field name="project_id"/>
31 <field name="warehouse_id"/>
36 <record id="action_shop_form" model="ir.actions.act_window">
37 <field name="name">Shop</field>
38 <field name="type">ir.actions.act_window</field>
39 <field name="res_model">sale.shop</field>
40 <field name="view_type">form</field>
41 <field name="view_mode">tree,form</field>
42 <field name="view_id" ref="view_shop_tree"/>
44 <menuitem id="menu_shop_configuration" name="Configuration" parent="sale.menu_sale_root" sequence="1"/>
45 <menuitem action="action_shop_form" id="menu_action_shop_form" parent="sale.menu_shop_configuration"/>
47 <record id="view_sale_order_calendar" model="ir.ui.view">
48 <field name="name">sale.order.calendar</field>
49 <field name="model">sale.order</field>
50 <field name="type">calendar</field>
51 <field name="arch" type="xml">
52 <calendar string="Sales orders" color="state" date_start="date_order">
53 <field name="partner_id"/>
54 <field name="amount_total"/>
58 <record model="ir.ui.view" id="view_sale_order_graph">
59 <field name="name">sale.order.graph</field>
60 <field name="model">sale.order</field>
61 <field name="type">graph</field>
62 <field name="arch" type="xml">
63 <graph string="Sales orders" type="bar">
64 <field name="partner_id"/>
65 <field name="amount_total" operator="+"/>
70 <record id="view_order_tree" model="ir.ui.view">
71 <field name="name">sale.order.tree</field>
72 <field name="model">sale.order</field>
73 <field name="type">tree</field>
74 <field name="arch" type="xml">
75 <tree string="Sales orders">
76 <field name="date_order"/>
77 <field name="name" string="Reference"/>
78 <field name="partner_id"/>
79 <field name="partner_shipping_id"/>
80 <field name="picked_rate" widget="progressbar"/>
81 <field name="invoiced_rate" widget="progressbar"/>
82 <field name="amount_untaxed"/>
88 <record id="view_order_form" model="ir.ui.view">
89 <field name="name">sale.order.form</field>
90 <field name="model">sale.order</field>
91 <field name="type">form</field>
92 <field name="arch" type="xml">
93 <form string="Sales order">
94 <group col="6" colspan="4">
95 <field name="name" select="1"/>
96 <field name="client_order_ref" select="2"/>
97 <field name="shipped" select="2"/>
98 <field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2" widget="selection"/>
99 <field name="date_order" select="1"/>
100 <field name="invoiced" select="2"/>
102 <notebook colspan="4">
103 <page string="Sale Order">
104 <field name="partner_id" on_change="onchange_partner_id(partner_id)" required="1" select="1"/>
105 <field domain="[('partner_id','=',partner_id)]" name="partner_order_id"/>
106 <field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id"/>
107 <field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id"/>
108 <field domain="[('type','=','sale')]" name="pricelist_id"/>
109 <field name="project_id" select="2" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}"/>
111 <field colspan="4" mode="tree,form,graph" name="order_line" nolabel="1" widget="one2many_list">
112 <form string="Sale Order Lines">
114 <page string="Order Line">
115 <separator colspan="4" string="Automatic Declaration"/>
117 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
119 on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], True, parent.date_order, product_packaging, parent.fiscal_position)"
122 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
123 name="product_uom_qty"
124 on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True)"
126 <field name="product_uom"
127 on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)"/>
129 name="product_packaging"
130 context="partner_id=parent.partner_id,quantity=product_uom_qty,pricelist=parent.pricelist_id,shop=parent.shop_id,uom=product_uom"
131 on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
132 domain="[('product_id','=',product_id)]"
133 groups="base.group_extended"/>
134 <separator colspan="4" string="Manual Description"/>
135 <field colspan="4" name="name" select="2"/>
136 <field name="price_unit" select="2"/>
137 <field name="discount"/>
139 <field name="delay" select="2"/>
141 <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
142 <separator colspan="4" string="States"/>
143 <field name="state" select="2"/>
144 <group col="3" colspan="2">
145 <field name="invoiced" select="2"/>
146 <button colspan="1" name="%(wizard_sale_order_line_invoice)d" states="confirmed" string="Make Invoice" type="action" icon="gtk-print"/>
149 <page groups="base.group_extended" string="Extra Info">
150 <field groups="product.group_uos" name="product_uos_qty" on_change="uos_change(product_uos, product_uos_qty, product_id)"/>
151 <field groups="product.group_uos" name="product_uos"/>
152 <field name="th_weight"/>
153 <field name="address_allotment_id" select="2"/>
154 <separator colspan="4" string="Properties"/>
155 <field colspan="4" name="property_ids" nolabel="1"/>
157 <page string="Notes">
158 <field colspan="4" name="notes" nolabel="1"/>
160 <page string="History" groups="base.group_extended">
161 <separator colspan="4" string="Invoice Lines"/>
162 <field colspan="4" name="invoice_lines" nolabel="1"/>
163 <separator colspan="4" string="Stock Moves"/>
164 <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
168 <tree string="Sales order lines">
169 <field colspan="4" name="name"/>
170 <field name="product_uom_qty" string="Qty"/>
171 <field name="product_uom" string="UoM"/>
172 <field name="discount"/>
173 <field name="price_unit"/>
174 <field name="price_net"/>
175 <field name="price_subtotal"/>
179 <group col="7" colspan="4">
180 <field name="amount_untaxed" sum="Untaxed amount"/>
181 <field name="amount_tax"/>
182 <field name="amount_total" sum="Total amount"/>
183 <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
185 <group col="13" colspan="4">
186 <field name="state" select="2"/>
187 <button name="order_confirm" states="draft" string="Confirm Order" icon="gtk-apply"/>
188 <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" icon="gtk-print"/>
189 <button name="invoice_corrected" states="invoice_except" string="Invoice Corrected" icon="gtk-apply"/>
190 <button name="ship_recreate" states="shipping_except" string="Recreate Procurement" icon="gtk-ok"/>
191 <button name="ship_corrected" states="shipping_except" string="Procurement Corrected" icon="gtk-apply"/>
192 <button name="manual_invoice" states="manual" string="Create Invoice" icon="gtk-print"/>
193 <button name="ship_cancel" states="shipping_except" string="Cancel Order" icon="gtk-cancel"/>
194 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
195 <button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" icon="gtk-cancel"/>
196 <button name="cancel" states="draft" string="Cancel Order" icon="gtk-cancel"/>
197 <button name="invoice_cancel" states="invoice_except" string="Cancel Order" icon="gtk-cancel"/>
200 <page string="Other data">
201 <field groups="base.group_extended" name="incoterm"/>
202 <field groups="base.group_extended" name="picking_policy" required="True"/>
203 <field name="user_id"/>
204 <field name="order_policy" on_change="shipping_policy_change(order_policy)"/>
205 <field groups="base.group_extended" name="origin"/>
206 <field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','prepaid'),('order_policy','=','picking')]}"/>
207 <field name="payment_term" widget="selection"/>
208 <field name="fiscal_position" groups="base.group_extended" widget="selection"/>
209 <separator colspan="4" string="Notes"/>
210 <field colspan="4" name="note" nolabel="1"/>
212 <page string="History">
213 <separator colspan="4" string="Related invoices"/>
214 <field colspan="4" name="invoice_ids" nolabel="1"/>
215 <field colspan="4" name="picking_ids" nolabel="1"/>
222 <record id="view_sales_order_filter" model="ir.ui.view">
223 <field name="name">sale.order.list.select</field>
224 <field name="model">sale.order</field>
225 <field name="type">search</field>
226 <field name="arch" type="xml">
227 <search string="Search Sales Order">
228 <group col='8' colspan='4'>
229 <filter icon="terp-sale" string="Quotation" domain="[('state','=','draft')]"/>
230 <filter icon="terp-sale" string="Running" domain="[('state','in',('manual','progress'))]"/>
231 <separator orientation="vertical"/>
232 <field name="name" select="1"/>
233 <field name="partner_id" select="1"/>
234 <field name="user_id" select="1" widget="selection">
235 <filter icon="terp-sale" domain="[('user_id','=',uid)]" help="My Sale Orders"/>
236 <filter icon="terp-sale" domain="[('user_id','child_of',[uid])]" help="My Departments Sale Orders"/>
238 <field name="date_order" select="1"/>
244 <record id="action_order_form" model="ir.actions.act_window">
245 <field name="name">Sales Orders</field>
246 <field name="type">ir.actions.act_window</field>
247 <field name="res_model">sale.order</field>
248 <field name="view_type">form</field>
249 <field name="view_mode">tree,form,calendar,graph</field>
250 <field name="search_view_id" ref="view_sales_order_filter"/>
252 <menuitem action="action_order_form" id="menu_sale_order" parent="sale.menu_sale_root"/>
254 <record id="action_order_tree" model="ir.actions.act_window">
255 <field name="name">My Sales Order</field>
256 <field name="type">ir.actions.act_window</field>
257 <field name="res_model">sale.order</field>
258 <field name="view_type">form</field>
259 <field name="view_mode">tree,form,calendar,graph</field>
260 <field name="domain">[('user_id','=',uid)]</field>
261 <field name="search_view_id" ref="view_sales_order_filter"/>
263 <menuitem action="action_order_tree" id="menu_action_order_tree" parent="sale.menu_sale_order" groups="base.group_extended"/>
265 <record id="action_order_tree_all" model="ir.actions.act_window">
266 <field name="name">All Sales Order</field>
267 <field name="type">ir.actions.act_window</field>
268 <field name="res_model">sale.order</field>
269 <field name="view_type">form</field>
270 <field name="view_mode">tree,form,calendar,graph</field>
271 <field name="search_view_id" ref="view_sales_order_filter"/>
273 <menuitem action="action_order_tree_all" id="menu_action_order_tree_all" parent="sale.menu_sale_order" groups="base.group_extended"/>
275 <record id="action_order_tree_new" model="ir.actions.act_window">
276 <field name="name">New Quotation</field>
277 <field name="type">ir.actions.act_window</field>
278 <field name="res_model">sale.order</field>
279 <field name="view_type">form</field>
280 <field name="view_mode">form,tree,calendar,graph</field>
282 <menuitem action="action_order_tree_new" id="menu_action_order_tree_new" parent="sale.menu_sale_order"/>
284 <record id="action_order_tree2" model="ir.actions.act_window">
285 <field name="name">Sales in Exception</field>
286 <field name="type">ir.actions.act_window</field>
287 <field name="res_model">sale.order</field>
288 <field name="view_type">form</field>
289 <field name="view_mode">tree,form,calendar,graph</field>
290 <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
291 <field name="filter" eval="True"/>
292 <field name="search_view_id" ref="view_sales_order_filter"/>
295 <record id="action_order_tree3" model="ir.actions.act_window">
296 <field name="name">Sales Order To Be Invoiced</field>
297 <field name="type">ir.actions.act_window</field>
298 <field name="res_model">sale.order</field>
299 <field name="view_type">form</field>
300 <field name="view_mode">tree,form,calendar,graph</field>
301 <field name="domain">[('state','=','manual')]</field>
302 <field name="filter" eval="True"/>
303 <field name="search_view_id" ref="view_sales_order_filter"/>
306 <record id="action_order_tree4" model="ir.actions.act_window">
307 <field name="name">Sales Order in Progress</field>
308 <field name="type">ir.actions.act_window</field>
309 <field name="res_model">sale.order</field>
310 <field name="view_type">form</field>
311 <field name="view_mode">tree,form,calendar,graph</field>
312 <field name="domain">[('state','in',('progress','waiting_date','manual'))]</field>
313 <field name="search_view_id" ref="view_sales_order_filter"/>
317 <record id="action_order_tree5" model="ir.actions.act_window">
318 <field name="name">All Quotations</field>
319 <field name="type">ir.actions.act_window</field>
320 <field name="res_model">sale.order</field>
321 <field name="view_type">form</field>
322 <field name="view_mode">tree,form,calendar,graph</field>
323 <field name="domain">[('state','=','draft')]</field>
324 <field name="search_view_id" ref="view_sales_order_filter"/>
327 <record id="action_order_tree7" model="ir.actions.act_window">
328 <field name="name">My sales in shipping exception</field>
329 <field name="type">ir.actions.act_window</field>
330 <field name="res_model">sale.order</field>
331 <field name="view_type">form</field>
332 <field name="view_mode">tree,form,calendar,graph</field>
333 <field name="domain">[('state','in',('shipping_except','invoice_except')),('user_id','=',uid)]</field>
334 <field name="search_view_id" ref="view_sales_order_filter"/>
337 <record id="action_order_tree8" model="ir.actions.act_window">
338 <field name="name">My sales order waiting Invoice</field>
339 <field name="type">ir.actions.act_window</field>
340 <field name="res_model">sale.order</field>
341 <field name="view_type">form</field>
342 <field name="view_mode">tree,form,calendar,graph</field>
343 <field name="domain">[('state','=','manual'),('user_id','=',uid)]</field>
344 <field name="search_view_id" ref="view_sales_order_filter"/>
347 <record id="action_order_tree9" model="ir.actions.act_window">
348 <field name="name">My sales order in progress</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','in',('progress','waiting_date','manual')),('user_id','=',uid)]</field>
354 <field name="search_view_id" ref="view_sales_order_filter"/>
357 <record id="action_order_tree10" model="ir.actions.act_window">
358 <field name="name">My Quotations</field>
359 <field name="type">ir.actions.act_window</field>
360 <field name="res_model">sale.order</field>
361 <field name="view_type">form</field>
362 <field name="view_mode">tree,form,calendar,graph</field>
363 <field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
364 <field name="search_view_id" ref="view_sales_order_filter"/>
367 <record id="action_order_tree" model="ir.actions.act_window">
368 <field name="name">Old Quotations</field>
369 <field name="type">ir.actions.act_window</field>
370 <field name="res_model">sale.order</field>
371 <field name="view_type">form</field>
372 <field name="view_mode">tree,form,calendar,graph</field>
373 <field name="domain">[('state','=','draft'),('date_order','<',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
374 <field name="filter" eval="True"/>
375 <field name="search_view_id" ref="view_sales_order_filter"/>
378 <record id="view_order_line_graph" model="ir.ui.view">
379 <field name="name">sale.order.line.graph</field>
380 <field name="model">sale.order.line</field>
381 <field name="type">graph</field>
382 <field name="arch" type="xml">
383 <graph string="Sales order lines">
384 <field name="product_id"/>
385 <field name="price_subtotal" operator="+"/>
391 <record id="view_order_line_tree" model="ir.ui.view">
392 <field name="name">sale.order.line.tree</field>
393 <field name="model">sale.order.line</field>
394 <field name="type">tree</field>
395 <field name="arch" type="xml">
396 <tree string="Sales order lines">
397 <field name="order_id"/>
398 <field name="order_partner_id"/>
400 <field name="product_id"/>
401 <field name="product_uom_qty" string="Qty"/>
402 <field name="product_uom" string="UoM"/>
403 <field name="discount"/>
404 <field name="price_unit"/>
405 <field name="price_net"/>
406 <field name="price_subtotal"/>
407 <field name="th_weight"/>
408 <field name="state"/>
412 <record id="view_order_line_form2" model="ir.ui.view">
413 <field name="name">sale.order.line.form2</field>
414 <field name="model">sale.order.line</field>
415 <field name="type">form</field>
416 <field name="arch" type="xml">
417 <form string="Sales Order Lines">
419 <page string="Order Lines">
420 <separator colspan="4" string="Automatic Declaration"/>
421 <field name="order_id" select="1"/>
422 <field name="order_partner_id" readonly="1" select="1" invisible="1"/>
423 <field name="product_uom_qty" readonly="1" select="2"/>
424 <field name="product_uom"/>
425 <field name="product_id" readonly="1" select="1"/>
426 <field name="invoiced" select="2"/>
428 <separator colspan="4" string="Manual Designation"/>
429 <field colspan="4" name="name" select="2"/>
430 <field name="price_unit" select="2"/>
431 <field name="discount"/>
433 <field name="delay" select="2"/>
434 <field name="price_subtotal"/>
435 <field name="th_weight"/>
436 <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
437 <separator colspan="4" string="States"/>
438 <field name="state" select="2"/>
439 <group col="2" colspan="2">
440 <button name="button_done" states="confirmed,exception" string="Done" type="object" icon="gtk-no"/>
441 <button name="button_cancel" states="confirmed,exception" string="Cancel" type="object" icon="gtk-cancel" />
444 <page string="Properties">
445 <field name="property_ids" nolabel="1"/>
447 <page string="Notes">
448 <field colspan="4" name="notes" nolabel="1"/>
450 <page string="Invoice Lines">
451 <field colspan="4" name="invoice_lines" nolabel="1"/>
458 <record id="view_sales_order_line_filter" model="ir.ui.view">
459 <field name="name">sale.order.line.select</field>
460 <field name="model">sale.order.line</field>
461 <field name="type">search</field>
462 <field name="arch" type="xml">
463 <search string="Search Sales Order">
464 <group col='8' colspan='4'>
465 <filter icon="terp-purchase" string="To Invoice" domain="[('invoiced','<>', 1),('state','=','done')]" separator="1"/>
466 <separator orientation="vertical"/>
467 <field name="order_id" select="1"/>
468 <field name="order_partner_id" select="1"/>
469 <field name="product_id" select="1"/>
470 <field name="salesman_id" select="1" widget="selection">
471 <filter icon="terp-sale" domain="[('salesman_id','=',uid)]" help="My Sale Order Lines"/>
472 <filter icon="terp-sale" domain="[('salesman_id','child_of',[uid])]" help="My Departments Sale Order Lines"/>
479 <record id="action_order_line_tree1" model="ir.actions.act_window">
480 <field name="name">Sales Order Lines</field>
481 <field name="type">ir.actions.act_window</field>
482 <field name="res_model">sale.order.line</field>
483 <field name="view_type">form</field>
484 <field name="view_id" eval="False"/>
485 <field name="search_view_id" ref="view_sales_order_line_filter"/>
487 <menuitem action="action_order_line_tree1" id="menu_action_order_line_tree1" parent="sale.menu_sale_root"
488 groups="base.group_extended"/>
490 <record id="action_order_line_tree2" model="ir.actions.act_window">
491 <field name="name">Uninvoiced Lines</field>
492 <field name="type">ir.actions.act_window</field>
493 <field name="res_model">sale.order.line</field>
494 <field name="view_type">form</field>
495 <field name="view_mode">tree,form,graph</field>
496 <field name="domain">[('invoiced','<>', 1),('state','<>','draft'),('state','<>','cancel')]</field>
497 <field name="filter" eval="True"/>
500 <record id="action_order_line_tree3" model="ir.actions.act_window">
501 <field name="name">Uninvoiced and Delivered Lines</field>
502 <field name="type">ir.actions.act_window</field>
503 <field name="res_model">sale.order.line</field>
504 <field name="view_type">form</field>
505 <field name="view_mode">tree,form,graph</field>
506 <field name="domain">[('invoiced','<>', 1),('state','=','done')]</field>
507 <field name="filter" eval="True"/>
510 <act_window context="{'partner_id': active_id}" domain="[('partner_id', '=', active_id)]" id="act_res_partner_2_sale_order" name="Sales" res_model="sale.order" src_model="res.partner"/>
512 <act_window domain="[('product_id','=',active_id)]" id="action_order_line_product_tree" name="Product sales" res_model="sale.order.line" src_model="product.product"/>
514 <!-- configartion view -->
516 <record id="view_config_picking_policy" model="ir.ui.view">
517 <field name="name">Configure Picking Policy for Sale Order </field>
518 <field name="model">sale.config.picking_policy</field>
519 <field name="type">form</field>
520 <field name="arch" type="xml">
521 <form string="Sales Configuration">
522 <separator colspan="4" string="Configure Sale Order Logistic"/>
524 <field name="picking_policy"/>
526 <field name="order_policy"/>
529 <separator string="" colspan="4"/>
530 <group col="4" colspan="4">
531 <button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
532 <button icon="gtk-ok" name="set_default" string="Set Default" type="object"/>
538 <record id="action_config_picking_policy" model="ir.actions.act_window">
539 <field name="name">Configure Picking Policy for Sale Order</field>
540 <field name="type">ir.actions.act_window</field>
541 <field name="res_model">sale.config.picking_policy</field>
542 <field name="view_type">form</field>
543 <field name="view_mode">form</field>
544 <field name="target">new</field>
547 <!-- register configuration wizard -->
548 <record id="config_wizard_step_sale_picking_policy" model="ir.actions.todo">
549 <field name="name">Select the default picking policy for Sale Order</field>
550 <field name="note">This Configuration step use to set default picking policy when make sale order</field>
551 <field name="action_id" ref="action_config_picking_policy"/>