Sao URLs can contain explicit view IDs. A browser bookmark may therefore keep referring to a view that no longer matches the requested model.
When opening such a URL, fields_view_get loads the supplied view and fails while parsing a field that does not exist on the requested model. For example, requesting a sales view with the ID of a purchase form produces this traceback on Tryton 8.0:
File "trytond/protocols/dispatcher.py", line 237, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "trytond/model/modelview.py", line 349, in fields_view_get
result['arch'], result['fields'] = cls.parse_view(
File "trytond/model/modelview.py", line 511, in parse_view
fields_def = cls.__parse_fields(
File "trytond/model/modelview.py", line 730, in __parse_fields
fields_attrs = cls.__parse_fields(
File "trytond/model/modelview.py", line 730, in __parse_fields
fields_attrs = cls.__parse_fields(
File "trytond/model/modelview.py", line 730, in __parse_fields
fields_attrs = cls.__parse_fields(
File "trytond/model/modelview.py", line 627, in __parse_fields
field = cls._fields[fname]
KeyError: 'purchase_date'
Would it make sense to check whether the supplied view is applicable to the requested model and show a clearer error? Or should the client recover by opening the default view?
What would be the expected behaviour for outdated bookmarks?
I preferred to start a discussion before opening an issue, but please let me know if this should be reported as one.