diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 99841241994..6be234335b5 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1418,6 +1418,7 @@ class AccountInvoiceTax(models.Model): base = fields.Monetary(string='Base', compute='_compute_base_amount', store=True) # 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 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'))