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

I am trying to add a custom field "Customer Name" to the model mrp.bom . this "Customer Name" field should also be visible in mrp.production. Is there  a way in odoo to connect those 2 fields .


For clarification let's say I have a product test1 with Customer Name "Amer" set in the BOM  When I choose to manufacture test1 Amer should appear in the Customer Name field of the mrp.production form view.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Aamer,

I think what you are after is a related field, your field would be placed on the BOM as a standard Char:

customer_name_on_bom = fields.Char(string="Customer Name")

On the mrp.production model you would have another Char field but put a "related" parameter as: 

customer_name_on_mrp = fields.Char(string="Customer Name", related="bom_id.customer_name_on_bom")

I hope this helps,

Thanks, 

อวตาร
ละทิ้ง
ผู้เขียน

Thank you so much , This is exactly what I needed.

Thank Jack, In ODDO 15 i am trying to do the same directly in the form. If I have a field in one model (f:i x_AAAA), how to create the related custom field in othe model
Thanks in advance

Related Posts ตอบกลับ มุมมอง กิจกรรม
How to find the field type? แก้ไขแล้ว
1
มิ.ย. 25
5128
1
ธ.ค. 22
3708
3
ก.ค. 20
11830
4
ต.ค. 24
5327
1
เม.ย. 20
3139