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

Hi, I wanna know if there is any tested and working way to achieve this. I have a selection field which is then converted to radio button in the xml code by adding the "widget='radio' " to the field. Now I wanna get the value of this selection-radio button.

This field is on a different file inside the same model and to access the value I'm doing:

button_id = fields.Many2one('hr_overtime_rule', 'buttons')

then im trying to check the value doing this:

value = button_id
if value == 'per_day':
    do_this()

but I don't know if this is the right way of accessing it. Thanks!
Avatar
Annuleer

Try,
self.button_id.name == 'per_day'

Auteur

@KiranK, `.name` gave me an error. I removed it and they weren't filtered

Gerelateerde posts Antwoorden Weergaven Activiteit
3
mrt. 24
6394
1
mei 22
2558
3
nov. 23
16685
3
nov. 24
23779
1
apr. 23
5638