From bd3869bd3aaf93fc1b5ce659474f5b8769a935a2 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 19 Jan 2018 13:41:40 +0100 Subject: [PATCH] [FIX] core,google_drive: python3 compatibility --- addons/google_drive/models/google_drive.py | 3 ++- odoo/tools/yaml_import.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py index 784b60ebf57..cf5e8c55345 100644 --- a/addons/google_drive/models/google_drive.py +++ b/addons/google_drive/models/google_drive.py @@ -9,6 +9,7 @@ import werkzeug.urls from odoo import api, fields, models from odoo.exceptions import RedirectWarning, UserError +from odoo.tools import pycompat from odoo.tools.safe_eval import safe_eval from odoo.tools.translate import _ @@ -154,7 +155,7 @@ class GoogleDrive(models.Model): :return: the config id and config name ''' # TO DO in master: fix my signature and my model - if isinstance(res_model, basestring): + if isinstance(res_model, pycompat.string_types): res_model = self.env['ir.model'].search([('model', '=', res_model)]).id if not res_id: raise UserError(_("Creating google drive may only be done by one at a time.")) diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py index 674047cd22a..7afffab2a0d 100644 --- a/odoo/tools/yaml_import.py +++ b/odoo/tools/yaml_import.py @@ -726,7 +726,7 @@ class YamlInterpreter(object): if node.target: values['target'] = node.target - if node.src_model and isinstance(node.src_model, basestring): + if node.src_model and isinstance(node.src_model, pycompat.string_types): values['binding_model_id'] = self.env['ir.model']._get(node.src_model).id id = self.sudo_env['ir.model.data']._update('ir.actions.act_window', self.module, values, node.id, mode=self.mode)