Odoo Ruby JSON client. Emulates ActiveRecord enough (as much as Mongoid; Implements ActiveModel) to make Rails development with an Odoo datastore straightforward
MIT License
199
stars
59
forks
source link
One2Many field relation don't work properly on 1.0.0.7 #8
res=ResPartner.find(:all,:domain=>[ ['supplier','=',true] ])
res.should be_true
res.each do |part|
if (part.address.length >0) :
@partner = part
break
end
end
You get an error which was not present into the 1.0.6 :
*** OpenERP Server ERROR:
Traceback (most recent call last):
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/netsvc.py", line 244, in dispatch
result = LocalService(service_name)(method, _params)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/netsvc.py", line 73, in call
return getattr(self, method)(_params)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/service/web_services.py", line 583, in execute
res = service.execute(db, uid, object, method, _args)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 61, in wrapper
return f(self, dbname, args, _kwargs)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 120, in execute
res = pool.execute_cr(cr, uid, obj, method, _args, _kw)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 112, in execute_cr
return getattr(object, method)(cr, uid, _args, _kw)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/orm.py", line 2143, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/orm.py", line 2183, in _read_flat
or (f in self._columns and getattr(self._columns[f], '_classic_write'))
TypeError: list objects are unhashable
***********
The part.address don't work :( You cannot write something like part.address[0].name.
Hi !
Trying this:
res=ResPartner.find(:all,:domain=>[ ['supplier','=',true] ]) res.should be_true res.each do |part| if (part.address.length >0) : @partner = part break end end
You get an error which was not present into the 1.0.6 :
*** OpenERP Server ERROR: Traceback (most recent call last): File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/netsvc.py", line 244, in dispatch result = LocalService(service_name)(method, _params) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/netsvc.py", line 73, in call return getattr(self, method)(_params) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/service/web_services.py", line 583, in execute res = service.execute(db, uid, object, method, _args) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 61, in wrapper return f(self, dbname, args, _kwargs) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 120, in execute res = pool.execute_cr(cr, uid, obj, method, _args, _kw) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/osv.py", line 112, in execute_cr return getattr(object, method)(cr, uid, _args, _kw) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/orm.py", line 2143, in read result = self._read_flat(cr, user, select, fields, context, load) File "/Users/jgrandguillaume/c2c/Code/Customers-dev/openerp_vogel/server/bin/osv/orm.py", line 2183, in _read_flat or (f in self._columns and getattr(self._columns[f], '_classic_write')) TypeError: list objects are unhashable
The part.address don't work :( You cannot write something like part.address[0].name.
Regards,
Joël