mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 03:12:10 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
16
odoo-bringout-oca-ocb-mail/mail/models/ir_qweb.py
Normal file
16
odoo-bringout-oca-ocb-mail/mail/models/ir_qweb.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from odoo import models
|
||||
|
||||
class IrQweb(models.AbstractModel):
|
||||
""" Add ``raise_on_code`` option for qweb. When this option is activated
|
||||
then all directives are prohibited.
|
||||
"""
|
||||
_inherit = 'ir.qweb'
|
||||
|
||||
def _get_template_cache_keys(self):
|
||||
return super()._get_template_cache_keys() + ['raise_on_code']
|
||||
|
||||
def _compile_directives(self, el, compile_context, indent):
|
||||
if compile_context.get('raise_on_code'):
|
||||
raise PermissionError("This rendering mode prohibits the use of directives.")
|
||||
return super()._compile_directives(el, compile_context, indent)
|
||||
Loading…
Add table
Add a link
Reference in a new issue