Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2832 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

thanks for help :)

Related Posts Odpovědi Zobrazení Aktivita
2
dub 23
3168
2
úno 25
41161
2
lis 22
3165
1
úno 22
8176
2
pro 21
4557