コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3257 ビュー

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

関連投稿 返信 ビュー 活動
1
6月 25
5111
1
12月 22
3669
3
7月 20
11761
4
10月 24
5301
1
4月 20
3126