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

[FIX] do not generate payment if amount=0 #245

Merged
merged 3 commits into from
Mar 31, 2016

Conversation

damdam-s
Copy link
Member

@damdam-s damdam-s commented Dec 4, 2015

No description provided.

@damdam-s damdam-s changed the title [FIX] do not generate payment if amount=0 [WIP][FIX] do not generate payment if amount=0 Dec 4, 2015
@gurneyalex
Copy link
Member

👍

@pedrobaeza
Copy link
Member

It's a WIP? Anyway, it seems 👍

@gurneyalex gurneyalex added this to the 8.0 milestone Dec 7, 2015
@gurneyalex gurneyalex changed the title [WIP][FIX] do not generate payment if amount=0 [FIX] do not generate payment if amount=0 Dec 7, 2015
@lepistone
Copy link
Member

👍 in principle, thanks. Still I am unsure: should we consider a near-zero amount because of float or rounding problems?

@lepistone
Copy link
Member

closed by mistake, I reopen

@lepistone lepistone reopened this Dec 15, 2015
@mdietrichc2c
Copy link
Contributor

I agree with @lepistone : I think we should consider using float_is_zero, especially since the test was added to only call the method when the amount is not 0.

@mdietrichc2c
Copy link
Contributor

👍

@mdietrichc2c
Copy link
Contributor

Actually, 👎 : I didn't notice that the condition was if float_is_zero, meaning the call is only made when the amount is equal to 0.
@damdam-s : can you add the not in front of float_is_zero ?

@damdam-s damdam-s force-pushed the 8.0-sale_payment_method-amount_zero branch from 852a6d3 to 26796f0 Compare December 21, 2015 06:58
@damdam-s
Copy link
Member Author

@mdietrichc2c ouch ... :( sorry. fix done

@@ -103,8 +104,10 @@ def automatic_payment(self, amount=None):
amounts = [(date, amount)]

# reversed is cosmetic, compute returns terms in the 'wrong' order
precision = self.env['decimal.precision'].precision_get('Account')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this up 1 line, otherwise the comment does not make sense.

@lepistone
Copy link
Member

A minor remark, otherwise 👍 thanks!

@damdam-s
Copy link
Member Author

@lepistone done

@mdietrichc2c
Copy link
Contributor

👍

1 similar comment
@StefanRijnhart
Copy link
Member

👍

@StefanRijnhart StefanRijnhart merged commit d2d8c96 into OCA:8.0 Mar 31, 2016
BT-dherreros pushed a commit to BT-dherreros/sale-workflow that referenced this pull request Apr 29, 2019
Syncing from upstream OCA/sale-workflow (12.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants