Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2838 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

thanks for help :)

Post Terkait Replies Tampilan Aktivitas
2
Apr 23
3172
2
Feb 25
41166
2
Nov 22
3174
1
Feb 22
8177
2
Des 21
4560