Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3273 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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, 

Imagine profil
Abandonează
Autor

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 Răspunsuri Vizualizări Activitate
1
iun. 25
5120
1
dec. 22
3693
3
iul. 20
11791
4
oct. 24
5309
1
apr. 20
3130