Odoo Help

0

ValueError: invalid literal for int() with base 10

By
mehdi
on 5/26/15, 8:00 PM 2,459 views

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'

1

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

0
mehdi
On 5/27/15, 5:20 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/26/15, 8:00 PM
Seen: 2459 times
Last updated: 5/27/15, 5:20 AM