Skip to content

Commit 694cea7

Browse files
committed
Merge remote-tracking branch 'odoo/14.0' into 14.0
2 parents 04f191b + 6de1cc1 commit 694cea7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

addons/website/models/website.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from werkzeug.exceptions import NotFound
1414

1515
from odoo import api, fields, models, tools, http
16+
from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
1617
from odoo.addons.http_routing.models.ir_http import slugify, _guess_mimetype, url_for
1718
from odoo.addons.website.models.ir_http import sitemap_qs2dom
1819
from odoo.addons.portal.controllers.portal import pager
@@ -238,9 +239,11 @@ def _handle_favicon(self, vals):
238239
vals['favicon'] = tools.image_process(vals['favicon'], size=(256, 256), crop='center', output_format='ICO')
239240

240241
def unlink(self):
241-
website = self.search([('id', 'not in', self.ids)], limit=1)
242-
if not website:
243-
raise UserError(_('You must keep at least one website.'))
242+
if not self.env.context.get(MODULE_UNINSTALL_FLAG, False):
243+
website = self.search([('id', 'not in', self.ids)], limit=1)
244+
if not website:
245+
raise UserError(_('You must keep at least one website.'))
246+
244247
# Do not delete invoices, delete what's strictly necessary
245248
attachments_to_unlink = self.env['ir.attachment'].search([
246249
('website_id', 'in', self.ids),

doc/cla/corporate/mainframemonkey.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ List of contributors:
1515
Yenthe Van Ginneken [email protected] https://github.com/Yenthe666
1616

1717
Ward Marissen [email protected] https://github.com/wardm95
18+
19+
Swapnesh Shah [email protected] https://github.com/sswapnesh

0 commit comments

Comments
 (0)