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 Requisition" icon="gtk-ok"/>
191 <button name="ship_corrected" states="shipping_except" string="Requisition 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 <field name="company_id" groups="base.group_extended" widget="selection"/>
210 <separator colspan="4" string="Notes"/>
211 <field colspan="4" name="note" nolabel="1"/>
213 <page string="History">
214 <separator colspan="4" string="Related invoices"/>
215 <field colspan="4" name="invoice_ids" nolabel="1"/>
216 <field colspan="4" name="picking_ids" nolabel="1"/>
223 <record id="view_sales_order_filter" model="ir.ui.view">
224 <field name="name">sale.order.list.select</field>
225 <field name="model">sale.order</field>
226 <field name="type">search</field>
227 <field name="arch" type="xml">
228 <search string="Search Sales Order">
229 <group col='8' colspan='4'>
230 <filter icon="terp-sale" string="Quotation" domain="[('state','=','draft')]"/>
231 <filter icon="terp-sale" string="Running" domain="[('state','in',('manual','progress'))]"/>
232 <separator orientation="vertical"/>
233 <field name="name" select="1"/>
234 <field name="partner_id" select="1"/>
235 <field name="user_id" select="1" widget="selection">
236 <filter icon="terp-sale" domain="[('user_id','=',uid)]" help="My Sale Orders"/>
237 <filter icon="terp-sale" domain="[('user_id','child_of',[uid])]" help="My Departments Sale Orders"/>
239 <field name="date_order" select="1"/>
245 <record id="action_order_form" model="ir.actions.act_window">
246 <field name="name">Sales Orders</field>
247 <field name="type">ir.actions.act_window</field>
248 <field name="res_model">sale.order</field>
249 <field name="view_type">form</field>
250 <field name="view_mode">tree,form,calendar,graph</field>
251 <field name="search_view_id" ref="view_sales_order_filter"/>
253 <menuitem action="action_order_form" id="menu_sale_order" parent="sale.menu_sale_root"/>
255 <record id="action_order_tree" model="ir.actions.act_window">
256 <field name="name">My Sales Order</field>
257 <field name="type">ir.actions.act_window</field>
258 <field name="res_model">sale.order</field>
259 <field name="view_type">form</field>
260 <field name="view_mode">tree,form,calendar,graph</field>
261 <field name="domain">[('user_id','=',uid)]</field>
262 <field name="search_view_id" ref="view_sales_order_filter"/>
264 <menuitem action="action_order_tree" id="menu_action_order_tree" parent="sale.menu_sale_order" groups="base.group_extended"/>
266 <record id="action_order_tree_all" model="ir.actions.act_window">
267 <field name="name">All Sales Order</field>
268 <field name="type">ir.actions.act_window</field>
269 <field name="res_model">sale.order</field>
270 <field name="view_type">form</field>
271 <field name="view_mode">tree,form,calendar,graph</field>
272 <field name="search_view_id" ref="view_sales_order_filter"/>
274 <menuitem action="action_order_tree_all" id="menu_action_order_tree_all" parent="sale.menu_sale_order" groups="base.group_extended"/>
276 <record id="action_order_tree_new" model="ir.actions.act_window">
277 <field name="name">New Quotation</field>
278 <field name="type">ir.actions.act_window</field>
279 <field name="res_model">sale.order</field>
280 <field name="view_type">form</field>
281 <field name="view_mode">form,tree,calendar,graph</field>
283 <menuitem action="action_order_tree_new" id="menu_action_order_tree_new" parent="sale.menu_sale_order"/>
285 <record id="action_order_tree2" model="ir.actions.act_window">
286 <field name="name">Sales in Exception</field>
287 <field name="type">ir.actions.act_window</field>
288 <field name="res_model">sale.order</field>
289 <field name="view_type">form</field>
290 <field name="view_mode">tree,form,calendar,graph</field>
291 <field name="domain">[('state','in',('shipping_except','invoice_except'))]</field>
292 <field name="filter" eval="True"/>
293 <field name="search_view_id" ref="view_sales_order_filter"/>
296 <record id="action_order_tree3" model="ir.actions.act_window">
297 <field name="name">Sales Order To Be Invoiced</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','=','manual')]</field>
303 <field name="filter" eval="True"/>
304 <field name="search_view_id" ref="view_sales_order_filter"/>
307 <record id="action_order_tree4" 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"/>
318 <record id="action_order_tree5" model="ir.actions.act_window">
319 <field name="name">All 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_mode">tree,form,calendar,graph</field>
324 <field name="domain">[('state','=','draft')]</field>
325 <field name="search_view_id" ref="view_sales_order_filter"/>
328 <record id="action_order_tree7" model="ir.actions.act_window">
329 <field name="name">My sales in shipping exception</field>
330 <field name="type">ir.actions.act_window</field>
331 <field name="res_model">sale.order</field>
332 <field name="view_type">form</field>
333 <field name="view_mode">tree,form,calendar,graph</field>
334 <field name="domain">[('state','in',('shipping_except','invoice_except')),('user_id','=',uid)]</field>
335 <field name="search_view_id" ref="view_sales_order_filter"/>
338 <record id="action_order_tree8" model="ir.actions.act_window">
339 <field name="name">My sales order waiting Invoice</field>
340 <field name="type">ir.actions.act_window</field>
341 <field name="res_model">sale.order</field>
342 <field name="view_type">form</field>
343 <field name="view_mode">tree,form,calendar,graph</field>
344 <field name="domain">[('state','=','manual'),('user_id','=',uid)]</field>
345 <field name="search_view_id" ref="view_sales_order_filter"/>
348 <record id="action_order_tree9" model="ir.actions.act_window">
349 <field name="name">My sales order in progress</field>
350 <field name="type">ir.actions.act_window</field>
351 <field name="res_model">sale.order</field>
352 <field name="view_type">form</field>
353 <field name="view_mode">tree,form,calendar,graph</field>
354 <field name="domain">[('state','in',('progress','waiting_date','manual')),('user_id','=',uid)]</field>
355 <field name="search_view_id" ref="view_sales_order_filter"/>
358 <record id="action_order_tree10" model="ir.actions.act_window">
359 <field name="name">My Quotations</field>
360 <field name="type">ir.actions.act_window</field>
361 <field name="res_model">sale.order</field>
362 <field name="view_type">form</field>
363 <field name="view_mode">tree,form,calendar,graph</field>
364 <field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
365 <field name="search_view_id" ref="view_sales_order_filter"/>
368 <record id="action_order_tree" model="ir.actions.act_window">
369 <field name="name">Old Quotations</field>
370 <field name="type">ir.actions.act_window</field>
371 <field name="res_model">sale.order</field>
372 <field name="view_type">form</field>
373 <field name="view_mode">tree,form,calendar,graph</field>
374 <field name="domain">[('state','=','draft'),('date_order','<',time.strftime('%Y-%m-%d %H:%M:%S'))]</field>
375 <field name="filter" eval="True"/>
376 <field name="search_view_id" ref="view_sales_order_filter"/>
379 <record id="view_order_line_graph" model="ir.ui.view">
380 <field name="name">sale.order.line.graph</field>
381 <field name="model">sale.order.line</field>
382 <field name="type">graph</field>
383 <field name="arch" type="xml">
384 <graph string="Sales order lines">
385 <field name="product_id"/>
386 <field name="price_subtotal" operator="+"/>
392 <record id="view_order_line_tree" model="ir.ui.view">
393 <field name="name">sale.order.line.tree</field>
394 <field name="model">sale.order.line</field>
395 <field name="type">tree</field>
396 <field name="arch" type="xml">
397 <tree string="Sales order lines">
398 <field name="order_id"/>
399 <field name="order_partner_id"/>
401 <field name="product_id"/>
402 <field name="product_uom_qty" string="Qty"/>
403 <field name="product_uom" string="UoM"/>
404 <field name="discount"/>
405 <field name="price_unit"/>
406 <field name="price_net"/>
407 <field name="price_subtotal"/>
408 <field name="th_weight"/>
409 <field name="state"/>
413 <record id="view_order_line_form2" model="ir.ui.view">
414 <field name="name">sale.order.line.form2</field>
415 <field name="model">sale.order.line</field>
416 <field name="type">form</field>
417 <field name="arch" type="xml">
418 <form string="Sales Order Lines">
420 <page string="Order Lines">
421 <separator colspan="4" string="Automatic Declaration"/>
422 <field name="order_id" select="1"/>
423 <field name="order_partner_id" readonly="1" select="1" invisible="1"/>
424 <field name="product_uom_qty" readonly="1" select="2"/>
425 <field name="product_uom"/>
426 <field name="product_id" readonly="1" select="1"/>
427 <field name="invoiced" select="2"/>
429 <separator colspan="4" string="Manual Designation"/>
430 <field colspan="4" name="name" select="2"/>
431 <field name="price_unit" select="2"/>
432 <field name="discount"/>
434 <field name="delay" select="2"/>
435 <field name="price_subtotal"/>
436 <field name="th_weight"/>
437 <field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
438 <separator colspan="4" string="States"/>
439 <field name="state" select="2"/>
440 <group col="2" colspan="2">
441 <button name="button_done" states="confirmed,exception" string="Done" type="object" icon="gtk-no"/>
442 <button name="button_cancel" states="confirmed,exception" string="Cancel" type="object" icon="gtk-cancel" />
445 <page string="Properties">
446 <field name="property_ids" nolabel="1"/>
448 <page string="Notes">
449 <field colspan="4" name="notes" nolabel="1"/>
451 <page string="Invoice Lines">
452 <field colspan="4" name="invoice_lines" nolabel="1"/>
459 <record id="view_sales_order_line_filter" model="ir.ui.view">
460 <field name="name">sale.order.line.select</field>
461 <field name="model">sale.order.line</field>
462 <field name="type">search</field>
463 <field name="arch" type="xml">
464 <search string="Search Sales Order">
465 <group col='8' colspan='4'>
466 <filter icon="terp-purchase" string="To Invoice" domain="[('invoiced','<>', 1),('state','=','done')]" separator="1"/>
467 <separator orientation="vertical"/>
468 <field name="order_id" select="1"/>
469 <field name="order_partner_id" select="1"/>
470 <field name="product_id" select="1"/>
471 <field name="salesman_id" select="1" widget="selection">
472 <filter icon="terp-sale" domain="[('salesman_id','=',uid)]" help="My Sale Order Lines"/>
473 <filter icon="terp-sale" domain="[('salesman_id','child_of',[uid])]" help="My Departments Sale Order Lines"/>
480 <record id="action_order_line_tree1" model="ir.actions.act_window">
481 <field name="name">Sales Order Lines</field>
482 <field name="type">ir.actions.act_window</field>
483 <field name="res_model">sale.order.line</field>
484 <field name="view_type">form</field>
485 <field name="view_id" eval="False"/>
486 <field name="search_view_id" ref="view_sales_order_line_filter"/>
488 <menuitem action="action_order_line_tree1" id="menu_action_order_line_tree1" parent="sale.menu_sale_root"
489 groups="base.group_extended"/>
491 <record id="action_order_line_tree2" model="ir.actions.act_window">
492 <field name="name">Uninvoiced Lines</field>
493 <field name="type">ir.actions.act_window</field>
494 <field name="res_model">sale.order.line</field>
495 <field name="view_type">form</field>
496 <field name="view_mode">tree,form,graph</field>
497 <field name="domain">[('invoiced','<>', 1),('state','<>','draft'),('state','<>','cancel')]</field>
498 <field name="filter" eval="True"/>
501 <record id="action_order_line_tree3" model="ir.actions.act_window">
502 <field name="name">Uninvoiced and Delivered Lines</field>
503 <field name="type">ir.actions.act_window</field>
504 <field name="res_model">sale.order.line</field>
505 <field name="view_type">form</field>
506 <field name="view_mode">tree,form,graph</field>
507 <field name="domain">[('invoiced','<>', 1),('state','=','done')]</field>
508 <field name="filter" eval="True"/>
511 <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"/>
513 <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"/>
515 <!-- configartion view -->
517 <record id="view_config_picking_policy" model="ir.ui.view">
518 <field name="name">Configure Picking Policy for Sale Order </field>
519 <field name="model">sale.config.picking_policy</field>
520 <field name="type">form</field>
521 <field name="arch" type="xml">
522 <form string="Sales Configuration">
523 <separator colspan="4" string="Configure Sale Order Logistic"/>
525 <field name="picking_policy"/>
527 <field name="order_policy"/>
530 <separator string="" colspan="4"/>
531 <group col="4" colspan="4">
532 <button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
533 <button icon="gtk-ok" name="set_default" string="Set Default" type="object"/>
539 <record id="action_config_picking_policy" model="ir.actions.act_window">
540 <field name="name">Configure Picking Policy for Sale Order</field>
541 <field name="type">ir.actions.act_window</field>
542 <field name="res_model">sale.config.picking_policy</field>
543 <field name="view_type">form</field>
544 <field name="view_mode">form</field>
545 <field name="target">new</field>
548 <!-- register configuration wizard -->
549 <record id="config_wizard_step_sale_picking_policy" model="ir.actions.todo">
550 <field name="name">Select the default picking policy for Sale Order</field>
551 <field name="note">This Configuration step use to set default picking policy when make sale order</field>
552 <field name="action_id" ref="action_config_picking_policy"/>