diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-12-31 10:32:13 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-12-31 15:21:44 +0000 |
| commit | 254d40ffcc21f56a80a1814da7f6355d44e5670b (patch) | |
| tree | 26d1e2eb2057e34fc7117f15be03f331320c37a6 /addons | |
| parent | e4943afef0f66703bafd78780764ff6f0b039d3e (diff) | |
[FIX] website_theme_install: not copy fields for theme record templates
Themes define records which are used as templates for the creation of
base model records on theme installation on a website.
E.g. a "theme.ir.attachment" record's purpose is to be a template for an
"ir.attachment" record creation on theme installation on a website.
Those final records have extra fields to indicate from which theme
template they come from. If those records are ever to be duplicated,
they should not duplicate those links to the theme templates otherwise
it may cause issues when uninstalling/updating a theme (you want the
records linked to the theme to be deleted/updated but not the duplicated
ones, which do not act differently from user created ones).
Duplicate ones will be linked to the website anyway (just like "normal"
user created ones) and should only be automatically removed if that
website is deleted.
The issue is more visible from 14.0 where applying some modifications to
images via the editor (crop / filter / optimization / ...) will
duplicate the original image before modifying it.
closes odoo/odoo#63948
X-original-commit: 890935bbdf924b06b7dabd89802f6dd824159a4b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website/models/theme_models.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/website/models/theme_models.py b/addons/website/models/theme_models.py index 62e6f05a769..848d3c5725b 100644 --- a/addons/website/models/theme_models.py +++ b/addons/website/models/theme_models.py @@ -253,7 +253,7 @@ class Theme(models.AbstractModel): class IrUiView(models.Model): _inherit = 'ir.ui.view' - theme_template_id = fields.Many2one('theme.ir.ui.view') + theme_template_id = fields.Many2one('theme.ir.ui.view', copy=False) def write(self, vals): no_arch_updated_views = other_views = self.env['ir.ui.view'] @@ -273,17 +273,17 @@ class IrUiView(models.Model): class IrAttachment(models.Model): _inherit = 'ir.attachment' - key = fields.Char() - theme_template_id = fields.Many2one('theme.ir.attachment') + key = fields.Char(copy=False) + theme_template_id = fields.Many2one('theme.ir.attachment', copy=False) class WebsiteMenu(models.Model): _inherit = 'website.menu' - theme_template_id = fields.Many2one('theme.website.menu') + theme_template_id = fields.Many2one('theme.website.menu', copy=False) class WebsitePage(models.Model): _inherit = 'website.page' - theme_template_id = fields.Many2one('theme.website.page') + theme_template_id = fields.Many2one('theme.website.page', copy=False) |
