mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] conftest: support for mapped(fn)
This commit is contained in:
parent
6a1b77b92c
commit
3a8b4684da
@ -1425,6 +1425,9 @@ class Model:
|
||||
)
|
||||
|
||||
def mapped(self, path):
|
||||
if callable(path):
|
||||
return [path(r) for r in self]
|
||||
|
||||
field, *rest = path.split('.', 1)
|
||||
descr = self._fields[field]
|
||||
if descr['type'] in ('many2one', 'one2many', 'many2many'):
|
||||
|
Loading…
Reference in New Issue
Block a user