Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] loyalty_criteria_multi_product: Avoiding cross-data in multi-product promotion criteria #229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions loyalty_criteria_multi_product/models/loyalty_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
def _onchange_loyalty_criteria(self):
"""Clear domain so we clear some other fields from the view"""
if self.loyalty_criteria == "multi_product":
self.minimum_amount = 0.00

Check warning on line 27 in loyalty_criteria_multi_product/models/loyalty_rule.py

View check run for this annotation

Codecov / codecov/patch

loyalty_criteria_multi_product/models/loyalty_rule.py#L27

Added line #L27 was not covered by tests
self.product_domain = False
self.product_ids = False
self.product_category_id = False
self.product_tag_id = False
else:
self.loyalty_criteria_ids = False

Check warning on line 33 in loyalty_criteria_multi_product/models/loyalty_rule.py

View check run for this annotation

Codecov / codecov/patch

loyalty_criteria_multi_product/models/loyalty_rule.py#L33

Added line #L33 was not covered by tests
15 changes: 15 additions & 0 deletions loyalty_criteria_multi_product/views/loyalty_rule_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
name="attrs"
>{'invisible': [('loyalty_criteria', '!=', 'domain')]}</attribute>
</field>
<field name="minimum_amount" position="attributes">
<attribute
name="attrs"
>{'invisible': [('loyalty_criteria', '!=', 'domain')]}</attribute>
</field>
<label for="minimum_amount" position="attributes">
<attribute
name="attrs"
>{'invisible': [('loyalty_criteria', '!=', 'domain')]}</attribute>
</label>
<div class="d-flex flex-row" position="attributes">
<attribute
name="attrs"
>{'invisible': [('loyalty_criteria', '!=', 'domain')]}</attribute>
</div>
<field name="product_domain" position="attributes">
<attribute
name="attrs"
Expand Down
Loading