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 create an account.move.line in OOOR #67

Open
emumanu opened this issue May 4, 2011 · 6 comments
Open

Can't create an account.move.line in OOOR #67

emumanu opened this issue May 4, 2011 · 6 comments

Comments

@emumanu
Copy link

emumanu commented May 4, 2011

I'm trying to create an account.move.line in OOOR but I got tthe following error:

NoMethodError: undefined method type!' for #<Ooor::OOORClient:0x265121> from (eval):1:incall2'
from org/jruby/RubyKernel.java:1087:in eval' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/ooor_client.rb:30:incall2'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/xmlrpc/client.rb:410:in call' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:135:inrpc_execute_with_all'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:245:in rpc_execute' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:314:increate'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:309:in save' from (irb):183:inevaluate'
from org/jruby/RubyKernel.java:1087:in eval' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:158:ineval_input'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:271:in signal_status' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:155:ineval_input'
from org/jruby/RubyKernel.java:1417:in loop' from org/jruby/RubyKernel.java:1190:incatch'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:154:in eval_input' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:71:instart'
from org/jruby/RubyKernel.java:1190:in catch' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:70:instart'
from <script>:74:in `(root)'

My code is:

titulo = "Test account.move.line"
account_dest = "4100017"
account_move_id = 7
credit = 123.45

move = AccountMove.find(:first, :params => {:id => account_move_id })

apunte = AccountMoveLine.new(:name => titulo,
:account_id => AccountAccount.find(:first, :params => {:code => account_dest }),
:move_id => move,
:period_id => move.period_id,
:journal_id => move.journal_id,
:credit => credit
)

apunte.save

I can confirm that the move and the account are retrieved properly but save or create fail with that message. If I try to do the same for a ProductCategory it works. Any ideas?

@rvalyi
Copy link
Member

rvalyi commented May 4, 2011

Double check the values OOOR is trying to send, probably there is some "nil" value which is not allowed in XML/RPC

@emumanu
Copy link
Author

emumanu commented May 5, 2011

rvalyi,

something really strange is happening. I'm using OOOR from terminatooor1.3.1 via:

java -jar jruby-ooor.jar

if after connecting succesfully to the OpenERP server I try this:

cli = ResPartner.new(:name => 'manu')

it works but after that, this:

cli.ref = "TEST" doesn't work:

D, [2011-05-05T12:15:41.244000 #6912] DEBUG -- : OOOR RPC: rpc_method: 'execute', db: disa, uid: 1, pass: #, obj: res.partner, method: read, *args: [[nil], ["ref"], "TEST", {}]
NoMethodError: undefined method allowed!' for #<Ooor::OOORClient:0x18f1327> from (eval):1:incall2'
from org/jruby/RubyKernel.java:1087:in eval' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/ooor_client.rb:30:incall2'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/xmlrpc/client.rb:410:in call' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:135:inrpc_execute_with_all'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:245:in rpc_execute' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:395:inmethod_missing'
from (irb):3:in evaluate' from org/jruby/RubyKernel.java:1087:ineval'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:158:in eval_input' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:271:insignal_status'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:155:in eval_input' from org/jruby/RubyKernel.java:1417:inloop'
from org/jruby/RubyKernel.java:1190:in catch' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:154:ineval_input'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:71:in start' from org/jruby/RubyKernel.java:1190:incatch'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:70:in start' from <script>:74:in(root)'irb(main):004:0> cli.fields
NoMethodError: undefined method fields' for #<ResPartner:0x76438d> from org/jruby/RubyKernel.java:238:inmethod_missing'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/activeresource-3.0.3/lib/active_resource/base.rb:1401:in method_missing' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/ooor-1.5.1/lib/app/models/open_object_resource.rb:410:inmethod_missing'
from (irb):4:in evaluate' from org/jruby/RubyKernel.java:1087:ineval'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:158:in eval_input' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:271:insignal_status'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:155:in eval_input' from org/jruby/RubyKernel.java:1417:inloop'
from org/jruby/RubyKernel.java:1190:in catch' from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:154:ineval_input'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:71:in start' from org/jruby/RubyKernel.java:1190:incatch'
from file:/home/manu/Desktop/terminatooor1.3.1/jruby-ooor.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:70:in start' from <script>:74:in(root)'

This works in terminatooor1.2.1 without problems. Isn't this supposed to work? Have you changed something?

BTW, the terminatooor2.0 file you uploaded a couple of days ago doesn't contain the jruby-ooor.jar file. why?

@chinta512
Copy link

Hello, was anyone able to find a solution to this?

@aleksclark
Copy link

having the same issue with account.voucher.line. Is there some kind of issue with 3-named objects and the automagic classes created for them?

@emumanu
Copy link
Author

emumanu commented Jul 27, 2012

I stumped upon the same problem again when creating a mrp.bom. This time I figured out the problem. Be sure that you assing the object.id to a one2many relations. If you by mistake assign the object and not the id you may get this error.

@emumanu
Copy link
Author

emumanu commented Jul 27, 2012

Sorry, Of course I wanted to say many2one relations, not one2many...

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

4 participants