I'm experiencing some weird results with this code in a model:
customer = fields.Many2one('res.partner')
customer_email = fields.Char(related='customer.email')
customer_phone = fields.Char(related='customer.phone')
contact = fields.Many2one('res.partner')
contact_email = fields.Char(related='contact.email')
contact_phone = fields.Char(related='contact.phone')
The weirdness is that when I create a record from the view these seems to be mixed up. Meaning if I fill inn all fields, some don't get recorded when saving (typically if I write an customer_email and contact_email, only one of them get saved).
Any idea why this should happen?
ps. I found a "fix" by adding store=True on all the related fields, but I don't understand why this should fix the problem
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
4418
أدوات العرض
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
Many2one related field
تم الحل
|
|
3
سبتمبر 21
|
9384 | |
|
4
يناير 20
|
3191 | ||
|
0
أبريل 17
|
3629 | ||
|
1
يناير 25
|
1857 | ||
|
3
أكتوبر 22
|
5886 |