Skip to content

Commit

Permalink
[IMP] sale_promotion_discount_in_field: fix view of some fields that …
Browse files Browse the repository at this point in the history
…are visible while they are not applicable to fixed price module
  • Loading branch information
solo4games committed Aug 28, 2023
1 parent 89f8a62 commit e4a0257
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 e4a0257

Please sign in to comment.