Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
3180 Zobrazení

please help

Avatar
Zrušit
Nejlepší odpověď

Using mapped function

self.env[].search([]).mapped('field_name')

Avatar
Zrušit
Nejlepší odpověď

Hello, Othmane Lafjer

I hope you are doing well.

- You can use the .mapped() function to get many fields's value (here, site_id) in list.

Example,
You can use .mapped() like this:

sites = self.env[model].search([]).mapped(field)

FYI:
model = Model that field is present in.
field = Which field's value you want to get in list.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Zrušit
Nejlepší odpověď

why dont you use the search_read instead?

Avatar
Zrušit