İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
23245 Görünümler

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'

Avatar
Vazgeç
En İyi Yanıt

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:"

Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Oca 23
26719
4
Haz 21
39670
1
Ara 20
2820
1
Nis 18
7942
3
Eyl 15
9790