تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
6676 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
أغسطس 23
10373
1
فبراير 21
3683
2
سبتمبر 21
8705
0
مارس 21
2296
1
أغسطس 18
5234