diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2020-09-23 12:45:14 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2020-10-14 15:58:05 +0000 |
| commit | db79bd9b5102c3f68a4812a92bb15327783eb197 (patch) | |
| tree | dcdebdd7545300168f0460f490b56b3b0fb0ca85 /addons | |
| parent | becf051f38fcf08d4a0aea758cb2758ad0f25bc3 (diff) | |
[FIX] point_of_sale,pos_sale: currency_rate more digits
In 857c4851754 currency_rate precision was changed to keep more digits
for the currency rate.
This commit reflects that in the point of sale.
Also this change fixes an update issue that could recreate sale.report
uncomplete because:
=> point_of_sale and pos_sale had different definition of
pos.order().currency_rate field
=> this caused the field to be recreated (to change from double precison
to numeric) on a given module update (pos_hr)
=> this caused the sale.report view to be dropped
=> this caused the sale.report view to be recreated before modules (that
added fields to sale.report) were fully loaded
opw-2306523
closes odoo/odoo#60027
X-original-commit: a73030b3d71d835145b01b81515a21e23187687c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/models/pos_order.py | 2 | ||||
| -rw-r--r-- | addons/pos_sale/models/pos_order.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index dc2e1ee0668..a169178efb3 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -229,7 +229,7 @@ class PosOrder(models.Model): readonly=True) config_id = fields.Many2one('pos.config', related='session_id.config_id', string="Point of Sale", readonly=False) currency_id = fields.Many2one('res.currency', related='config_id.currency_id', string="Currency") - currency_rate = fields.Float("Currency Rate", compute='_compute_currency_rate', compute_sudo=True, store=True, readonly=True, + currency_rate = fields.Float("Currency Rate", compute='_compute_currency_rate', compute_sudo=True, store=True, digits=0, readonly=True, help='The rate of the currency to the currency of rate applicable at the date of the order') invoice_group = fields.Boolean(related="config_id.module_account", readonly=False) diff --git a/addons/pos_sale/models/pos_order.py b/addons/pos_sale/models/pos_order.py index 85feef93630..4e65541d597 100644 --- a/addons/pos_sale/models/pos_order.py +++ b/addons/pos_sale/models/pos_order.py @@ -7,7 +7,7 @@ from odoo import api, fields, models class PosOrder(models.Model): _inherit = 'pos.order' - currency_rate = fields.Float(compute='_compute_currency_rate', store=True, digits=(12, 6), readonly=True) + currency_rate = fields.Float(compute='_compute_currency_rate', store=True, digits=0, readonly=True) crm_team_id = fields.Many2one('crm.team', string="Sales Team") @api.model |
