diff options
| author | Nguyen Tan Phuc <phucngta@users.noreply.github.com> | 2018-01-31 17:45:31 +0700 |
|---|---|---|
| committer | Martin Trigaux <564822+mart-e@users.noreply.github.com> | 2018-01-31 11:45:31 +0100 |
| commit | 00a10fdd001d264a7f5df191b2b9d17c490bfa1c (patch) | |
| tree | 3fd93634f32ee4173818ab25103703403909eff5 /addons | |
| parent | c07f78db17579ab7523e724b51a8e3d7d8ad4248 (diff) | |
[FIX] point_of_sale : wrong currency decimals
To have the same behavior as `_compute_decimal_places` in python
When setting rounding of currency > 10, POS will get negative decimals
instead value 0 and crash
Closes #22199
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 7b32e286172..2ede35f8e69 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -330,7 +330,7 @@ exports.PosModel = Backbone.Model.extend({ ids: function(self){ return [self.config.currency_id[0]]; }, loaded: function(self, currencies){ self.currency = currencies[0]; - if (self.currency.rounding > 0) { + if (self.currency.rounding > 0 && self.currency.rounding < 1) { self.currency.decimals = Math.ceil(Math.log(1.0 / self.currency.rounding) / Math.log(10)); } else { self.currency.decimals = 0; |
