diff options
| author | Robot Odoo <xmo+roboto@odoo.com> | 2019-07-17 14:17:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-17 14:17:57 +0200 |
| commit | cc62447a44c2cf4e2edaf8a1f6d94520e799ddd9 (patch) | |
| tree | a45f0984af5db1723fec83741b285ea92ab63598 /addons/website_theme_install | |
| parent | f6fdde96bddfedf8764cd8a73089e44340d476ae (diff) | |
| parent | a8767716cfd14abc7f87204d4d180811f663b648 (diff) | |
[MERGE] api.py: remove calls to @api.multi and deprecate its explicit usage
depends on https://github.com/odoo/odoo/pull/34556
closes odoo/odoo#34775
Signed-off-by: Adrian Torres <Elkasitu@users.noreply.github.com>
Diffstat (limited to 'addons/website_theme_install')
| -rw-r--r-- | addons/website_theme_install/models/ir_module_module.py | 13 | ||||
| -rw-r--r-- | addons/website_theme_install/models/theme_models.py | 4 |
2 files changed, 0 insertions, 17 deletions
diff --git a/addons/website_theme_install/models/ir_module_module.py b/addons/website_theme_install/models/ir_module_module.py index e7e31e176f2..532be6e52c6 100644 --- a/addons/website_theme_install/models/ir_module_module.py +++ b/addons/website_theme_install/models/ir_module_module.py @@ -36,7 +36,6 @@ class IrModuleModule(models.Model): # for kanban view is_installed_on_current_website = fields.Boolean(compute='_compute_is_installed_on_current_website') - @api.multi def _compute_is_installed_on_current_website(self): """ Compute for every theme in ``self`` if the current website is using it or not. @@ -48,7 +47,6 @@ class IrModuleModule(models.Model): for module in self: module.is_installed_on_current_website = module == self.env['website'].get_current_website().theme_id - @api.multi def write(self, vals): """ Override to correctly upgrade themes after upgrade/installation of modules. @@ -93,7 +91,6 @@ class IrModuleModule(models.Model): return super(IrModuleModule, self).write(vals) - @api.multi def _get_module_data(self, model_name): """ Return every theme template model of type ``model_name`` for every theme in ``self``. @@ -180,7 +177,6 @@ class IrModuleModule(models.Model): self._theme_cleanup(model_name, website) - @api.multi def _post_copy(self, old_rec, new_rec): self.ensure_one() translated_fields = self._theme_translated_fields.get(old_rec._name, []) @@ -194,7 +190,6 @@ class IrModuleModule(models.Model): (dst_field, new_rec.id, src_field, old_rec.id)) - @api.multi def _theme_load(self, website): """ For every type of model in ``self._theme_model_names``, and for every theme in ``self``: @@ -213,7 +208,6 @@ class IrModuleModule(models.Model): self = self.env()[self._name].browse(self.id) self.env['theme.utils']._post_copy(module, website) - @api.multi def _theme_unload(self, website): """ For every type of model in ``self._theme_model_names``, and for every theme in ``self``: @@ -231,7 +225,6 @@ class IrModuleModule(models.Model): models.unlink() self._theme_cleanup(model_name, website) - @api.multi def _theme_cleanup(self, model_name, website): """ Remove orphan models of type ``model_name`` from the current theme and @@ -265,7 +258,6 @@ class IrModuleModule(models.Model): ]) orphans.unlink() - @api.multi def _theme_get_upstream(self): """ Return installed upstream themes. @@ -275,7 +267,6 @@ class IrModuleModule(models.Model): self.ensure_one() return self.upstream_dependencies(exclude_states=('',)).filtered(lambda x: x.name.startswith('theme_')) - @api.multi def _theme_get_downstream(self): """ Return installed downstream themes that starts with the same name. @@ -288,7 +279,6 @@ class IrModuleModule(models.Model): self.ensure_one() return self.downstream_dependencies().filtered(lambda x: x.name.startswith(self.name)) - @api.multi def _theme_get_stream_themes(self): """ Returns all the themes in the stream of the current theme. @@ -305,7 +295,6 @@ class IrModuleModule(models.Model): all_mods = up_mod | all_mods return all_mods - @api.multi def _theme_get_stream_website_ids(self): """ Websites for which this theme (self) is in the stream (up or down) of their theme. @@ -319,7 +308,6 @@ class IrModuleModule(models.Model): websites |= website return websites - @api.multi def _theme_upgrade_upstream(self): """ Upgrade the upstream dependencies of a theme. @@ -351,7 +339,6 @@ class IrModuleModule(models.Model): theme._theme_unload(website) website.theme_id = False - @api.multi def button_choose_theme(self): """ Remove any existing theme on the current website and install the theme ``self`` instead. diff --git a/addons/website_theme_install/models/theme_models.py b/addons/website_theme_install/models/theme_models.py index b9b2f006c94..20a30c9713a 100644 --- a/addons/website_theme_install/models/theme_models.py +++ b/addons/website_theme_install/models/theme_models.py @@ -31,7 +31,6 @@ class ThemeView(models.Model): # TODO master add missing field: customize_show - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() inherit = self.inherit_id @@ -70,7 +69,6 @@ class ThemeAttachment(models.Model): copy_ids = fields.One2many('ir.attachment', 'theme_template_id', 'Attachment using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() new_attach = { @@ -98,7 +96,6 @@ class ThemeMenu(models.Model): parent_id = fields.Many2one('theme.website.menu', index=True, ondelete="cascade") copy_ids = fields.One2many('website.menu', 'theme_template_id', 'Menu using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() page_id = self.page_id.copy_ids.filtered(lambda x: x.website_id == website) @@ -124,7 +121,6 @@ class ThemePage(models.Model): website_indexed = fields.Boolean('Page Indexed', default=True) copy_ids = fields.One2many('website.page', 'theme_template_id', 'Page using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() view_id = self.view_id.copy_ids.filtered(lambda x: x.website_id == website) |
