diff --git a/base_conditional_image/__init__.py b/base_conditional_image/__init__.py index a0fdc10fe..0650744f6 100644 --- a/base_conditional_image/__init__.py +++ b/base_conditional_image/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/base_conditional_image/__manifest__.py b/base_conditional_image/__manifest__.py index ac397861f..a1fc89cd7 100644 --- a/base_conditional_image/__manifest__.py +++ b/base_conditional_image/__manifest__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 Camptocamp SA +# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) { diff --git a/base_conditional_image/models/__init__.py b/base_conditional_image/models/__init__.py index d7e2ed1ef..8deef0ec7 100644 --- a/base_conditional_image/models/__init__.py +++ b/base_conditional_image/models/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import image from . import abstract_image diff --git a/base_conditional_image/models/abstract_image.py b/base_conditional_image/models/abstract_image.py index 89c1cba5a..0aa43c578 100644 --- a/base_conditional_image/models/abstract_image.py +++ b/base_conditional_image/models/abstract_image.py @@ -1,12 +1,11 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 Camptocamp SA +# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from openerp import fields, models -from openerp.tools.safe_eval import safe_eval +from odoo import fields, models +from odoo.tools.safe_eval import safe_eval -class AbstractImageStorage(models.AbstractModel): +class AbstractConditionalImage(models.AbstractModel): _name = 'abstract.conditional.image' image = fields.Binary( @@ -32,9 +31,10 @@ class AbstractImageStorage(models.AbstractModel): def _compute_selector_test_with_company(image_selector, record): if (image_selector.company_id == record.company_id or record.company_id and not image_selector.company_id): - return AbstractImageStorage._compute_selector_test_without_company( - image_selector, record - ) + return AbstractConditionalImage\ + ._compute_selector_test_without_company( + image_selector, record + ) return False def _compute_image(self): diff --git a/base_conditional_image/models/image.py b/base_conditional_image/models/image.py index 27ce1cc82..f361fef2b 100644 --- a/base_conditional_image/models/image.py +++ b/base_conditional_image/models/image.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- -# Copyright 2018 Camptocamp SA +# Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from openerp import api, fields, models, tools, _ -from openerp.exceptions import ValidationError +from odoo import api, fields, models, tools, _ +from odoo.exceptions import ValidationError class Image(models.Model): @@ -56,9 +55,9 @@ class Image(models.Model): @api.model def create(self, vals): self._process_images(vals, required=True) - return super(Image, self).create(vals) + return super().create(vals) @api.multi def write(self, vals): self._process_images(vals) - return super(Image, self).write(vals) + return super().write(vals)