details: https://code.tryton.org/tryton/commit/4221d74d44d7
branch: 7.0
user: Cédric Krier <[email protected]>
date: Tue Jun 30 09:48:33 2026 +0200
description:
Enforce access right on the email template record
Closes #14907
(grafted from d9aa2de5dabe7e39892c41808d56103ea83bf95f)
diffstat:
trytond/CHANGELOG | 1 +
trytond/trytond/ir/email_.py | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r b2efec2dd15d -r 4221d74d44d7 trytond/CHANGELOG
--- a/trytond/CHANGELOG Tue Jun 30 23:05:09 2026 +0200
+++ b/trytond/CHANGELOG Tue Jun 30 09:48:33 2026 +0200
@@ -1,3 +1,4 @@
+* Enforce access right on the email template record (issue14907)
* Add ModelAccessProxy (issue14907)
* Restrict Genshi evaluation (issue14869, issue5160)
diff -r b2efec2dd15d -r 4221d74d44d7 trytond/trytond/ir/email_.py
--- a/trytond/trytond/ir/email_.py Tue Jun 30 23:05:09 2026 +0200
+++ b/trytond/trytond/ir/email_.py Tue Jun 30 09:48:33 2026 +0200
@@ -19,7 +19,8 @@
from trytond.config import config
from trytond.i18n import gettext
-from trytond.model import EvalEnvironment, ModelSQL, ModelView, fields
+from trytond.model import (
+ EvalEnvironment, ModelAccessProxy, ModelSQL, ModelView, fields)
from trytond.model.exceptions import AccessError, ValidationError
from trytond.pool import Pool
from trytond.pyson import Bool, Eval, PYSONDecoder
@@ -418,7 +419,7 @@
def get(self, record):
pool = Pool()
Model = pool.get(self.model.model)
- record = Model(int(record))
+ record = ModelAccessProxy(Model(int(record)))
values = {}
for attr, key in [