Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access reconcile_id many2one relation #9

Closed
nbessi opened this issue Dec 3, 2009 · 1 comment
Closed

Can't access reconcile_id many2one relation #9

nbessi opened this issue Dec 3, 2009 · 1 comment

Comments

@nbessi
Copy link

nbessi commented Dec 3, 2009

Hello,
I try to fix this one but I break my tooth on it :

l = AccountMoveLine.find(:first)
l.reconcile_id
NoMethodError: undefined method []' for nil:NilClass from /Library/Ruby/Gems/1.8/gems/ooor-1.0.9/lib/app/models/open_object_resource.rb:298:inrelationnal_result'
from /Library/Ruby/Gems/1.8/gems/ooor-1.0.9/lib/app/models/open_object_resource.rb:311:in `method_missing'
from (irb):10

Maybe it's due to the fact the field is readonly.

I'm perplex on this one.

Regards

Nicolas

@rvalyi
Copy link
Member

rvalyi commented Dec 16, 2009

Hello,

this was because like the original ActiveResource I was loading the fields only using values, thus not dealing properly with empty relations. But since in OOR we introspect the OpenERP relational model, I now use it to load the relation properly. It's all fixed in OOOR v1.1.0, that has been published on Gemcutter. Wasn't an easy fix, but was very important, thank you for the report, OOOR is in pretty good shape now!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants