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

I have a problem when i use domain to compare two integer fields ?


_name = 'y'
'field1': fields.integer('Field1'),
'field2': fields.integer('Field2'),


_name = 'x'

'y_id': fields.many2one('y', 'Y', domain="[('field1','>','field2')]"),


=> ValueError: invalid literal for int() with base 10: 'field2'

아바타
취소
베스트 답변

Hi,

In domain filter you have to give the value in right side of the operator. In domain we have to follow the syntax like : [('field_of_model','operator','any_value_according_to_field_and_operator')]

In your domain 'field2' is text and system is going to convert it into "int" thats why system is giving an error message "like invalid literal for int() with base 10:"

아바타
취소
작성자 베스트 답변

ok but now how i compare field1 and field2 in domaine ?

아바타
취소
관련 게시물 답글 화면 활동
2
1월 23
26725
4
6월 21
39676
1
12월 20
2821
1
4월 18
7945
3
9월 15
9793