diff options
| author | Joren Van Onder <jov@odoo.com> | 2018-04-11 12:56:57 -0700 |
|---|---|---|
| committer | Joren Van Onder <jov@odoo.com> | 2018-04-11 14:30:08 -0700 |
| commit | eb84a309992cb6545180294ab51f51d7eefbafc3 (patch) | |
| tree | 5b76f6e49f1a1a7650e6847842da48c239e5a739 /addons/web/static/lib/bootstrap-datetimepicker/src/js | |
| parent | 30aa75329c7254daaf8b89b5e468629b74731e49 (diff) | |
[FIX] pos_mercury: don't lose credit card info
Due to historical reasons the amount on a statement line is used to
find it again so the credit card information can be added to it.
Doing a search directly on 'amount' will fail in rare cases when
the currency rounding doesn't result in a float with the same amount
of decimals as the rounding specifies. E.g.:
>>> currency = env['res.currency'].browse(3)
>>> currency.rounding
0.01
>>> currency.round(74.85000000000001)
74.85000000000001
When that happens the credit card information is not saved in the
backend. To avoid this we do the float comparison properly with
float_compare afterwards.
PS. Ideally the logic in add_payment should be moved to an override of
_prepare_bank_statement_line_payment_values. This way we wouldn't have
to do these awkward things to find the statement line. But this
approach is not suited for a stable release.
opw-1832156
Diffstat (limited to 'addons/web/static/lib/bootstrap-datetimepicker/src/js')
0 files changed, 0 insertions, 0 deletions
