Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4444 มุมมอง
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
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Many2one related field แก้ไขแล้ว
3
ก.ย. 21
9398
Representation of Many2one in view แก้ไขแล้ว
4
ม.ค. 20
3209
0
เม.ย. 17
3668
1
ม.ค. 25
1906
3
ต.ค. 22
5920