Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2236 Visualizzazioni

Hi all,

i have boolean field (x_visible_in_woo) defined in product.template and would like to show it inside stock.move.line

I created XML in which I called


As expected I get error "Field "x_visible_in_woo" does not exist in model "stock.move.line"

I'm aware i need to somehow connect this two fields in .py file but i'm not able to find any help - please if someone can guide me I would be very thankful. 

Avatar
Abbandona
Risposta migliore

Hi,

You have to add a related field in stock move line model also.

Inherit the stock.move.line model and then define the related field.

x_visible_in_woo = fields.Char(related='product_id.x_visible_in_woo')


Thanks

Avatar
Abbandona
Autore

Niyas, one more time you saved me - i knew that it needs to be inherited but couldn't figure out how to do it - thank you so much!

The only thing is that it's boolean field so it's fields.Boolean(related='product_id.x_visible_in_woo')

Post correlati Risposte Visualizzazioni Attività
0
dic 24
1474
1
mar 24
2529
1
giu 23
12551
0
gen 23
3195
0
dic 21
2053