diff --git a/addons/stock_dropshipping/__manifest__.py b/addons/stock_dropshipping/__manifest__.py index c00b3985a63bab3d5e03ebdae78d1776f2509f4e..5c917c2d67bca80538b85fa2ac50064e50f3deab 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 0000000000000000000000000000000000000000..8d684e365bf5191952e758d9e38076b59747944d --- /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>