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

Hi all, 

I am using Odoo 10. I have a Many2one field, 

store_id = fields.Many2one('model.stores', 'Store ID', required=True, select=True)

It should store the store_id, but instead it stores the index of the store_id.

How do you store the value of the store_id?


Need your help. Thanks! :)

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

Use new field index in model.stores that stores the index.
use store_id.index to get index.


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

Dear  Apollo,

when you make Many2one field that will store the id only, because you have more than one field on another model. Easily way to get another data by add related field.


I hope I helped you...

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
فبراير 25
6012
1
ديسمبر 24
1534
1
نوفمبر 22
16090
3
أغسطس 22
13176
2
أغسطس 22
4592