Skip to content

Commit

Permalink
[IMP] Do not allow the Can Be Rental field to be activated when the p…
Browse files Browse the repository at this point in the history
…roduct is not storable
  • Loading branch information
edescalona committed Jan 17, 2025
1 parent edfc7f3 commit 666aef0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rental_pricelist/views/product_template_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
<!--Priority greater than 100-->
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<xpath expr="//field[@name='rental']" position="attributes">
<attribute name="attrs">
{'invisible': [('type', '!=', 'product')]}
</attribute>
</xpath>
<xpath expr="//label[@for='rental']" position="attributes">
<attribute name="attrs">
{'invisible': [('type', '!=', 'product')]}
</attribute>
</xpath>
<xpath expr="//notebook" position="inside">
<page
name="rental_price"
Expand Down
10 changes: 10 additions & 0 deletions rental_pricelist/views/product_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
<!--Priority greater than 100-->
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<xpath expr="//field[@name='rental']" position="attributes">
<attribute name="attrs">
{'invisible': [('type', '!=', 'product')]}
</attribute>
</xpath>
<xpath expr="//label[@for='rental']" position="attributes">
<attribute name="attrs">
{'invisible': [('type', '!=', 'product')]}
</attribute>
</xpath>
<xpath expr="//notebook" position="inside">
<page
name="rental_price"
Expand Down

0 comments on commit 666aef0

Please sign in to comment.