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

-I have created a model (activity_group)

-I have created a many2one field in base.automation that will reference one of these (activity_group) objects.

-I want to create another field in mail.activity that will copy the value from the selection made in the base.automation form.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
Hi @HGR Media Development

In base.automain, you created activity_group_field, i.e.
activity_group_field = fields.Many2one('activity.group')

so, in mail.activity you need to add a many2one field with relation to base.automain and then activity_group_field many2one field that will be related.
base_automain_field = fields.Many2one('base.automain')
activity_group_field = fields.Many2one(related='base_automain_field.activity_group_field')

Let me know if this helps!
อวตาร
ละทิ้ง
ผู้เขียน

This confirms I have been trying to configure the relationship in the correct way. But i keep getting errors for my syntax? related="base_automation_id.x_users_many" what is the correct syntax?

ผู้เขียน

Also, I have tried this and it doesn't copy the value of the field.

@HGR Media Development
Can you share how you define the x_users_many and other lines yo define for this?

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
4661
1
มี.ค. 15
7363
1
มิ.ย. 22
4407
0
ม.ค. 17
3256
How to find the field type? แก้ไขแล้ว
1
มิ.ย. 25
5187