Skip to content

Commit

Permalink
[IMP] sale_loyalty_exclude: Avoid to select excluded products in rule…
Browse files Browse the repository at this point in the history
…s and rewards

The excluded products can be selected at loyalty rules and reward. This is
pointless and only makes confussion because the rules and rewards would
be ignored.
  • Loading branch information
miguelcb2003 committed Sep 11, 2024
1 parent b54e258 commit 30da78c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions sale_loyalty_exclude/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import loyalty_reward
from . import product_template
from . import sale_order
9 changes: 9 additions & 0 deletions sale_loyalty_exclude/models/loyalty_reward.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import fields, models


class LoyaltyReward(models.Model):
_inherit = "loyalty.reward"

reward_product_id = fields.Many2one(
"product.product", string="Product", domain=[("loyalty_exclude", "=", False)]
)
2 changes: 1 addition & 1 deletion sale_loyalty_exclude/views/product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<odoo>
<record id="product_template_form_view" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="inside">
<group>
Expand Down

0 comments on commit 30da78c

Please sign in to comment.