From b294fc15e3e663e66bf599cf6bec6614e168e571 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Thu, 22 Nov 2018 10:20:05 +0000 Subject: [PATCH] [FIX] sale: allow duplicate SO from other company - In some cases (record rules modified to allow access to multi company SO) the duplication of a quotation isn't possible if the quotation is set on a company than the user trying to duplicate it. This is due to a computed field that tries to access the order's company currency. closes odoo/odoo#28945 --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 1169b137e1c..eb17fa23830 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -179,7 +179,7 @@ class SaleOrder(models.Model): amount_by_group = fields.Binary(string="Tax amount by group", compute='_amount_by_group', help="type: [(name, amount, base, formated amount, formated base)]") amount_tax = fields.Monetary(string='Taxes', store=True, readonly=True, compute='_amount_all') amount_total = fields.Monetary(string='Total', store=True, readonly=True, compute='_amount_all', track_visibility='always', track_sequence=6) - currency_rate = fields.Float("Currency Rate", compute='_compute_currency_rate', store=True, digits=(12, 6), readonly=True, help='The rate of the currency to the currency of rate 1 applicable at the date of the order') + currency_rate = fields.Float("Currency Rate", compute='_compute_currency_rate', compute_sudo=True, store=True, digits=(12, 6), readonly=True, help='The rate of the currency to the currency of rate 1 applicable at the date of the order') payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term') fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position')