-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
[14.0][IMP] account_asset_management: big code cleanup #1513
Conversation
Use fields.Monetary() instead of fields.Float() Use odoo's compare and round methods for floats Add check_company=True where relevant Stop using "Account" decimal precision... it doesn't exist any more! Replace compute() by _convert() for currency conversion
2bc622d
to
ccc5d0b
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.
LGTM
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.
Why not using currency_id
name for the field and avoid all the explicit currency_field
for cleaning a bit more?
@pedrobaeza yes, why not. But "company_currency_id" is more meaningful, because the developper immediately understands that the currency of the field is from the company, not from a specific field of the asset. |
But the asset is handled in such currency, so the company meaning doesn't matter. In fact, if in the future a multi-currency asset system is put, we will have |
@alexis-via do you see my explanation to simplify to |
/ocabot merge major |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at b53fa7e. Thanks a lot for contributing to OCA. ❤️ |
great job ! Thanks. |
@luc-demeyer Also good news: FYI, no need to migrate this to v16. |
Use fields.Monetary() instead of fields.Float()
Use odoo's compare and round methods for floats
Add check_company=True where relevant
Stop using "Account" decimal precision... it doesn't exist any more! Replace compute() by _convert() for currency conversion