Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
6655 มุมมอง

Hi all,
How can i store a Many2many field in res.config.settings in odoo 13.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Try refer following blog

https://www.cybrosys.com/blog/how-to-save-many2many-field-in-odoo-13-settings

Regards

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Frodo Baggins,

Suppose xyz named object is available and set M2M in res.config.settings object. 

class ResConfigSettings (models.TransientModel): 
_inherit = 'res.config.settings'

xyz_id = fields.Many2one ('xyz')
xyz_ids = fields.Many2many (
'xyz',
'xyz_res_config_settings_rel',
'xyz table's field ',
 'xyz_id')

note: Many2many field can't see in database.

Regards,




Email:   odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

res.config.settings is a transient model so we could not store anything in it.
you have to make m2m field either compute filed with inverse or related field.

https://github.com/odoo/odoo/blob/13.0/addons/crm/models/res_config_settings.py#L24

https://github.com/odoo/odoo/blob/13.0/addons/website/models/res_config_settings.py#L22


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ส.ค. 23
10353
1
ก.พ. 21
3675
2
ก.ย. 21
8688
0
มี.ค. 21
2290
1
ส.ค. 18
5226