Skip to content

Commit

Permalink
[FIX][10.0] product_dimension: dont depend on stock
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb authored and OCA-git-bot committed Jul 15, 2019
1 parent 6db0ba3 commit 43c379f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
3 changes: 1 addition & 2 deletions product_dimension/__manifest__.py
Expand Up @@ -8,8 +8,7 @@
'category': 'Product',
'author': 'ADHOC SA, Camptocamp, Odoo Community Association (OCA)',
'license': 'AGPL-3',
'depends': ['product', 'stock'],
'depends': ['product'],
'data': ['views/product_view.xml'],
'installable': True,
'images': [],
}
42 changes: 17 additions & 25 deletions product_dimension/views/product_view.xml
@@ -1,32 +1,24 @@
<?xml version="1.0"?>
<odoo>

<record model="ir.ui.view" id="product_normal_form_view">
<field name="name">product_normal_form_view</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='volume']" position="before">
<field name="dimensional_uom_id"/>
<field name="length" attrs="{'readonly':[('type','=','service')]}"/>
<field name="height" attrs="{'readonly':[('type','=','service')]}"/>
<field name="width" attrs="{'readonly':[('type','=','service')]}"/>
</xpath>
</field>
</record>

<record model="ir.ui.view" id="product_template_only_form_view">
<field name="name">product.template with properties and dimensions</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<field name="tracking" position="after">
<field name="dimensional_uom_id" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="length" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="height" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="width" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<record model="ir.ui.view" id="product_template_form_view">
<field name="name">product.template with properties and dimensions</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Dimensions" name="dimensions">
<group>
<group>
<field name="length" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="width" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="height" attrs="{'readonly':[('type','=','service')],'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<field name="dimensional_uom_id" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
</group>
</group>
</page>
</xpath>
</field>
</field>
</record>

</odoo>

0 comments on commit 43c379f

Please sign in to comment.