0
當我嘗試選擇從記錄(例如)res.user這樣的:Odoo - 錯誤查詢外的http請求
with api.Environment.manage():
registry = RegistryManager.get(db_name)
with registry.cursor() as cursor:
environment = api.Environment(cursor, None, {})
environment['res.user'].search([])
我得到一個異常
Traceback (most recent call last):
...
File "/opt/odoo10/odoo/models.py", line 4200, in _generate_order_by
order_by_elements = self._generate_order_by_inner(self._table, order_spec, query)
File "/opt/odoo10/odoo/models.py", line 4167, in _generate_order_by_inner
raise ValueError(_("Sorting field %s not found on model %s") % (order_field, self._name))
ValueError: Sorting field model_id not found on model ir.rule
因此,它與任何情況楷模。但是,一切都很好,如果我做的控制器方法或模型的方法的請求