Skip to Content
Menu
This question has been flagged
1 Reply
2229 Views

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.

Avatar
Discard
Best Answer

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, 

Avatar
Discard
Author

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 Replies Views Activity
1
Dec 22
2400
3
Jul 20
10015
4
Oct 24
3682
1
Apr 20
2167
0
Nov 16
2750