mirror of
https://github.com/bringout/oca-ocb-web.git
synced 2026-04-19 07:52:00 +02:00
replace stale web_editor with html_editor and html_builder for 19.0
web_editor was removed in Odoo 19.0 and replaced by html_editor
and html_builder. The old web_editor was incorrectly included in
the 19.0 vanilla import.
🤖 assisted by claude
This commit is contained in:
parent
4b94f0abc5
commit
f866779561
1513 changed files with 396049 additions and 358525 deletions
|
|
@ -0,0 +1,39 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import re
|
||||
|
||||
from odoo import models
|
||||
from odoo.exceptions import AccessDenied
|
||||
|
||||
|
||||
class IrWebsocket(models.AbstractModel):
|
||||
_inherit = 'ir.websocket'
|
||||
|
||||
def _build_bus_channel_list(self, channels):
|
||||
if self.env.uid:
|
||||
# Do not alter original list.
|
||||
channels = list(channels)
|
||||
for channel in channels:
|
||||
if isinstance(channel, str):
|
||||
match = re.match(r'editor_collaboration:(\w+(?:\.\w+)*):(\w+):(\d+)', channel)
|
||||
if match:
|
||||
model_name = match[1]
|
||||
field_name = match[2]
|
||||
res_id = int(match[3])
|
||||
|
||||
# Verify access to the edition channel.
|
||||
if self.env.user._is_public():
|
||||
raise AccessDenied()
|
||||
|
||||
document = self.env[model_name].browse([res_id])
|
||||
if not document.exists():
|
||||
continue
|
||||
|
||||
document.check_access('read')
|
||||
document.check_access('write')
|
||||
if field := document._fields.get(field_name):
|
||||
document._check_field_access(field, 'read')
|
||||
document._check_field_access(field, 'write')
|
||||
|
||||
channels.append((self.env.registry.db_name, 'editor_collaboration', model_name, field_name, res_id))
|
||||
return super()._build_bus_channel_list(channels)
|
||||
Loading…
Add table
Add a link
Reference in a new issue