Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2844 Weergaven

hi all,

models: 1) items  2) subcat

event: onchange

I had a model items, contains a Many2one field for category, when user select a value (subcat) i want to get another field value ( parentcat, it is Char type ) from same model - subcat - 

how i can achieve this, please help.

regards


Avatar
Annuleer
Beste antwoord

Hello,

You would want to look at related fields. You would have the field subcat_parentcat on the items model like this:

subcat_parentcat = fields.Char(related="category_id.parentcat")

This would get the parentcat char field of whatever is selected in the Many2one category_id.

I hope this helps,

Thanks, 



Avatar
Annuleer
Auteur

thanks for help :)

Gerelateerde posts Antwoorden Weergaven Activiteit
2
apr. 23
3206
2
feb. 25
41216
2
nov. 22
3208
1
feb. 22
8195
2
dec. 21
4581