summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2019-08-01 13:52:31 +0000
committerGoffin Simon <sig@odoo.com>2019-08-06 08:23:44 +0000
commitf93fcaffb5287bc6ff52e33e3cc9edecb50058c4 (patch)
tree2da77f7dd675d5dffbaf5bdfced29f856f1e0d65 /addons
parentd91b1e5bd56373f869bdc0db2215818e9ce11cbc (diff)
[FIX] stock_dropshipping: Updating dropship product
Steps to reproduce the bug: - Install stock_dropshipping module and enable Routes on SO lines - Create a storable product P with a supplier S - Create a SO with P and set this line with the route dropship - Confirm the SO ( a PO has been created to S with P) - Change P on the SO with an other product Bug: The product P stayed on the PO. So a product linked to a PO line cannot be changed on a SO. Do not forward-port in 12.0 and upper opw:2040249 closes odoo/odoo#35454 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/stock_dropshipping/__manifest__.py2
-rw-r--r--addons/stock_dropshipping/views/sale_order_views.xml25
2 files changed, 26 insertions, 1 deletions
diff --git a/addons/stock_dropshipping/__manifest__.py b/addons/stock_dropshipping/__manifest__.py
index c00b3985a63..5c917c2d67b 100644
--- a/addons/stock_dropshipping/__manifest__.py
+++ b/addons/stock_dropshipping/__manifest__.py
@@ -22,7 +22,7 @@ internal transfer document is needed.
""",
'website': 'https://www.odoo.com/page/warehouse',
'depends': ['purchase', 'sale_stock'],
- 'data': ['data/stock_data.xml'],
+ 'data': ['data/stock_data.xml', 'views/sale_order_views.xml'],
'test': [
'../account/test/account_minimal_test.xml',
'../stock_account/test/stock_valuation_account.xml',
diff --git a/addons/stock_dropshipping/views/sale_order_views.xml b/addons/stock_dropshipping/views/sale_order_views.xml
new file mode 100644
index 00000000000..8d684e365bf
--- /dev/null
+++ b/addons/stock_dropshipping/views/sale_order_views.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<odoo>
+ <data>
+ <!-- Do not forward-port in 12.0 and upper -->
+ <record id="view_order_form_inherit_sale_stock" model="ir.ui.view">
+ <field name="name">sale.order.form.sale.dropshipping</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page/field[@name='order_line']/form//field[@name='product_updatable']" position="after">
+ <field name="purchase_line_ids" invisible="1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/form//field[@name='product_id']" position="attributes">
+ <attribute name="attrs">{'readonly': ['|', ('product_updatable', '=', False), ('purchase_line_ids', '!=', [])]}</attribute>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/tree/field[@name='product_updatable']" position="after">
+ <field name="purchase_line_ids" invisible="1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
+ <attribute name="attrs">{'readonly': ['|', ('product_updatable', '=', False), ('purchase_line_ids', '!=', [])]}</attribute>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</odoo>