跳至內容
選單
此問題已被標幟
3 回覆
3175 瀏覽次數

please help

頭像
捨棄
最佳答案

Using mapped function

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

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

why dont you use the search_read instead?

頭像
捨棄