Set view_id in the context when calling view_attributes
issue11091 review364531002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Set view_id in the context when calling view_attributes
|
||||
* Add ip_address and device_cookie login method options
|
||||
* Add support for Python 3.10
|
||||
* Remove support for Python 3.6
|
||||
|
||||
@@ -182,6 +182,11 @@ Class methods:
|
||||
encoded value. If the depends list is set its fields are added to the
|
||||
view if the xpath matches at least one element.
|
||||
|
||||
.. note::
|
||||
|
||||
The``view_id`` is set to the
|
||||
:attr:`~trytond.transaction.Transaction.context` when calling this method.
|
||||
|
||||
|
||||
.. classmethod:: ModelView.parse_view(tree, type[, field_children[, level[, view_depends]]])
|
||||
|
||||
|
||||
@@ -378,8 +378,9 @@ class ModelView(Model):
|
||||
# Update arch and compute fields from arch
|
||||
parser = etree.XMLParser(remove_blank_text=True)
|
||||
tree = etree.fromstring(result['arch'], parser)
|
||||
result['arch'], result['fields'] = cls.parse_view(
|
||||
tree, result['type'], result['field_childs'], level=level)
|
||||
with Transaction().set_context(view_id=view_id):
|
||||
result['arch'], result['fields'] = cls.parse_view(
|
||||
tree, result['type'], result['field_childs'], level=level)
|
||||
|
||||
cls._fields_view_get_cache.set(key, result)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user