mirror of
https://github.com/bringout/oca-ocb-web.git
synced 2026-04-19 10:51:59 +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,27 @@
|
|||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
CONTEXT_KEYS = ['editable', 'edit_translations', 'translatable']
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
_inherit = "ir.http"
|
||||
|
||||
@classmethod
|
||||
def _get_editor_context(cls):
|
||||
""" Check for ?editable and stuff in the query-string """
|
||||
return {
|
||||
key: True
|
||||
for key in CONTEXT_KEYS
|
||||
if key in request.httprequest.args and key not in request.env.context
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def _pre_dispatch(cls, rule, args):
|
||||
super()._pre_dispatch(rule, args)
|
||||
ctx = cls._get_editor_context()
|
||||
request.update_context(**ctx)
|
||||
|
||||
@classmethod
|
||||
def _get_translation_frontend_modules_name(cls):
|
||||
return ["html_editor", *super()._get_translation_frontend_modules_name()]
|
||||
Loading…
Add table
Add a link
Reference in a new issue