Odoo Help

1

0
1 回答
1
アバター

Mitul Shingala インド

--Mitul Shingala--
5344
| 6 4 9
Vadodara, Gujarat, インド
--Mitul Shingala--

Odoo Developer

Mitul Shingala インド
2019/04/02 1:41

hello

when you write into the many2many field, at that time you can use like 

product_id.write({'route_ids': [(6, 0, list_of_route_record_ids)]})

for write in field many2many type the process is same, just using widget it display data in different format.

so override the default_get method and in the return result of the method you have to update the value.

@api.model
def default_get(self, fieldslist):
    res = super(classname, self).default_get(fieldlist) 
    res.update({'route_ids': [(6, 0, record_ids)]}) # where record_ids = you have to search route ids and pass the list of record
    return res
1 コメント
Michel マダガスカル
2019/04/02 16:15

Hi Mitul Shingala,

thank you for your answer, I think it worked,

質問する
Writer
タグ
Keep Informed
1 フォロワー
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now