-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
[ADD] sale_loyalty_discount_attribute #97
Conversation
874df77
to
c8ff0e6
Compare
c8ff0e6
to
3dc2b2d
Compare
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
def _get_reward_values_discount(self, reward, coupon, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diogocsc Can you please add a test case for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added unit tests in later commit
discount.update({"price_unit": price_unit}) | ||
return_res.append(discount) | ||
|
||
return return_res |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My feeling is that it should return res
and the return_Res
variable is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced in latest commit, using an index to update res.
… limit_discounted_attributes is False
"price_unit": 10.0, | ||
} | ||
|
||
def setUp(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diogocsc Could you change this to setUpClass ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @diogocsc
@diogocsc CI is red, can you check please? |
Seems like an odd pre-commit install error. Maybe with your new push the build gets green. |
attributes_wise_price_unit = 0.0 | ||
for so_lines in self.order_line.filtered( | ||
lambda l: not l.reward_id | ||
and l.product_id.id in reward.discount_product_ids.ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nikul-OSI We can also pick a product Category. Would this work in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dreispt No, This for only product which is selected on rewards.
d7e9e7b
to
7e87530
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.