[IMP] sale_stock: routes in sale orders default and no create

When the module sale_stock is installed, the MTO route is now by default
available on sale order lines.

We also remove the ability to create routes from sale order lines, as a
salesman will never have to configure new stock routings.
This commit is contained in:
Dhaval Panchal
2017-03-29 14:20:56 +02:00
committed by Pierre Masereel
parent ce4cc6ebb4
commit 5732bf2d64
3 changed files with 12 additions and 3 deletions
+1
View File
@@ -36,6 +36,7 @@ You can choose flexible invoicing methods:
'views/account_invoice_views.xml',
'report/sale_order_report_templates.xml',
'report/stock_report_deliveryslip.xml',
'data/sale_stock_data.xml',
],
'demo': ['data/sale_order_demo.xml'],
'installable': True,
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="stock.route_warehouse0_mto" model="stock.location.route">
<field name="sale_selectable">True</field>
</record>
</data>
</odoo>
+3 -3
View File
@@ -27,10 +27,10 @@
<field name="product_packaging" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" />
</xpath>
<xpath expr="//field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="route_id" groups="sale_stock.group_route_so_lines"/>
<field name="route_id" groups="sale_stock.group_route_so_lines" options="{'no_create': True}"/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="before">
<field name="route_id" groups="sale_stock.group_route_so_lines"/>
<field name="route_id" groups="sale_stock.group_route_so_lines" options="{'no_create': True}"/>
</xpath>
</field>
</record>
@@ -41,7 +41,7 @@
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='price_subtotal']" position="before">
<field name="route_id" groups="sale_stock.group_route_so_lines"/>
<field name="route_id" groups="sale_stock.group_route_so_lines" options="{'no_create': True}"/>
</xpath>
</field>
</record>