Skip to content

Commit

Permalink
[FIX] sale_promotion_discount_in_field: Fix view of fields "Free prod…
Browse files Browse the repository at this point in the history
…uct" and "apply discount" and "max discount amount"

This field are visible while they are not applicable to fixed price module
  • Loading branch information
solo4games committed Aug 30, 2023
1 parent 9dabd9d commit 48b18b4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions sale_promotion_discount_in_field/views/coupon_program_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<field name="arch" type="xml">
<field name="reward_product_id" position="attributes">
<attribute name="attrs">
{"invisible": [("reward_type", "in", ("discount", "free_shipping",
"discount_line"))], "required": [("reward_type", "=", "product")]}
{"invisible": [("reward_type", "!=", "product")], "required": [("reward_type", "=", "product")]}
</attribute>
</field>
<field name="discount_line_product_id" position="attributes">
Expand All @@ -19,14 +18,12 @@
</field>
<xpath expr="//field[@name='discount_type']/.." position="attributes">
<attribute name="attrs">
{"invisible": [("reward_type", "in", ("product", "free_shipping",
"discount_line"))]}
{"invisible": [("reward_type", "!=", "discount")]}
</attribute>
</xpath>
<xpath expr="//label[@for='discount_type']" position="attributes">
<attribute name="attrs">
{"invisible": [("reward_type", "in", ("product", "free_shipping",
"discount_line"))]}
{"invisible": [("reward_type", "!=", "discount")]}
</attribute>
</xpath>
<xpath expr="//label[@for='discount_type']" position="before">
Expand All @@ -49,15 +46,13 @@
</xpath>
<xpath expr="//label[@for='discount_max_amount']" position="attributes">
<attribute name="attrs">
{'invisible': ['|', ('reward_type', 'in', ('product',
'free_shipping', "discount_line")), ('discount_type', '!=',
{'invisible': ['|', ('reward_type', '!=', 'discount'), ('discount_type', '!=',
'percentage')]}
</attribute>
</xpath>
<xpath expr="//field[@name='discount_max_amount']/.." position="attributes">
<attribute name="attrs">
{'invisible': ['|', ('reward_type', 'in', ('product',
'free_shipping', "discount_line")), ('discount_type', '!=',
{'invisible': ['|', ('reward_type', '!=', 'discount'), ('discount_type', '!=',
'percentage')]}
</attribute>
</xpath>
Expand Down

0 comments on commit 48b18b4

Please sign in to comment.