From c41f7297d367db54399e7013733d7e64aa332732 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 6 Apr 2018 09:27:35 +0200 Subject: [PATCH 1/2] [FIX] report: create a new environment self is a rml_parse instance, not a BaseModel create new environment to call ORM methods prevent crash when calling formatLang on a RML report Closes #24068 --- odoo/report/report_sxw.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odoo/report/report_sxw.py b/odoo/report/report_sxw.py index e54ecad953e..6d0433db9fc 100644 --- a/odoo/report/report_sxw.py +++ b/odoo/report/report_sxw.py @@ -220,7 +220,8 @@ class rml_parse(object): date = datetime(*value.timetuple()[:6]) if date_time: # Convert datetime values to the expected client/context timezone - record = self.env['base'].with_context(self.localcontext) + env = odoo.api.Environment(self.cr, self.uid, {}) + record = env['base'].with_context(self.localcontext) date = fields.Datetime.context_timestamp(record, date) return date.strftime(date_format.encode('utf-8')) From ea42f6c176af57d085df25a18fb7e0654a95b2f4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 6 Apr 2018 08:20:48 +0200 Subject: [PATCH 2/2] [FIX] account: missing decorator --- addons/account/models/account_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 7939d463a3c..5531a188202 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1411,6 +1411,7 @@ class AccountInvoiceTax(models.Model): base = fields.Monetary(string='Base', compute='_compute_base_amount') # DO NOT FORWARD-PORT!!! ONLY FOR v10 + @api.model def create(self, vals): inv_tax = super(AccountInvoiceTax, self).create(vals) # Workaround to make sure the tax amount is rounded to the currency precision since the ORM