콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4174 화면

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!
아바타
취소

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

작성자

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

관련 게시물 답글 화면 활동
3
3월 24
7165
1
5월 22
3013
3
11월 23
17563
3
11월 24
25246
1
4월 23
6241