-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[IMP] pos: Negative payment (refund) on touchscreen #31054
Conversation
a2410b1
to
40526ef
Compare
40526ef
to
3ab96fa
Compare
3ab96fa
to
c672c07
Compare
c672c07
to
6420aea
Compare
6420aea
to
a8a8d4e
Compare
a8a8d4e
to
0dd64de
Compare
0dd64de
to
a51cf94
Compare
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.
looks good, only some small changes.
@@ -1553,7 +1553,7 @@ | |||
</tr> | |||
</t> | |||
<tr> | |||
<t t-if="order.get_total_discount() > 0"> | |||
<t t-if="order.get_total_discount()"> |
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.
I agree this look better, but this is totally out of scope for this task, could you remove this out of the commit?
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.
hello, @switch87
if we remove this then not need to use Math.abs() and Math.sign() in models.js a51cf94#diff-1c14accbe350f7a177b3e81e5846861bR2506
I have added to show returned product price with a previously applied discount minus.
only thing is left now is, replace "Clear" to "+/-" is it ok?
Thanks
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.
@mgh-odoo can you record an example pre- and post-commit on runbot of this? The task was indeed as simple as replacing this key apparently. But if this extra work is indeed an issue that should be fixed, you can split the commit into one [IMP] and one [FIX] and your work would not be for nothing :)
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.
hello, @switch87
I changed commit based on your suggestion and
also recorded a video about pre-commit and post-commit
if it's out of scope, let me know I'll remove that one :)
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.
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.
@switch87 done. 👍
@@ -2501,8 +2501,9 @@ exports.Order = Backbone.Model.extend({ | |||
}, | |||
get_total_discount: function() { | |||
return round_pr(this.orderlines.reduce((function(sum, orderLine) { | |||
sum += (orderLine.get_unit_price() * (orderLine.get_discount()/100) * orderLine.get_quantity()); | |||
sum += ((orderLine.get_lst_price() - orderLine.get_unit_price()) * orderLine.get_quantity()); | |||
var unit_price = orderLine.get_unit_price(); |
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.
get_quantity and Math.abs(unit_price) could also be set in a separate variable.
a51cf94
to
afd60be
Compare
currently, if a user wants to return fund to the customer. we don't have a button to bill negatively. that will fixed. Task-ID: 1929650 Closes: odoo#31054
afd60be
to
d71ff10
Compare
d71ff10
to
ad4a479
Compare
@qle-odoo r+ please |
@robodoo r+ |
currently, if a user wants to return fund to the customer. we don't have a button to bill negatively. that will fixed. Task-ID: 1929650 Closes: #31054 Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Merged, thanks! |
currently, if a user wants to return fund to the customer.
we don't have a button to bill negatively. that will fixed.
Task-ID: 1929650
Closes: #31054
Task:https://www.odoo.com/web#id=1929650&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720
Pad:https://pad.odoo.com/p/r.5745606edc51c9662beff81d277af3e3
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr