Example code for many2one - problem
Hi all.
I'm trying to build a module for my needs and I'm experimenting some sample codes.
In this example, I need to build a very simple City-State relationship, but I'm getting a error from the server:
Follow the code:
class city(osv.osv):
_name = 'city'
_columns = {
'cityName': fields.char('City', size=32),
'State': fields.
}
city()
class state(osv.osv):
_name = 'state'
_columns = {
'name': fields.char('State name',size=32),
}
state()
The error in the server is:
ERROR:db.
LINE 1: ...te".id FROM "state" WHERE (state.name in (1,2,3)...
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
, in query SELECT "state".id FROM "state" WHERE (state.name in (%s,%s,%s)) ORDER BY id
I believe my code is wrong, but I could not find easy examples on the net to fix it.
Can you help me?
Thanks in advance
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Serpent Consulting Services
- Solved:
- Last query:
- Last reply: