ooor icon indicating copy to clipboard operation
ooor copied to clipboard

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

Open emumanu opened this issue 14 years ago • 6 comments

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

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?

emumanu avatar May 04 '11 14:05 emumanu

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

rvalyi avatar May 04 '11 15:05 rvalyi

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?

emumanu avatar May 05 '11 10:05 emumanu

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

chinta512 avatar Jul 09 '11 04:07 chinta512

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?

aleksclark avatar Mar 29 '12 12:03 aleksclark

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 avatar Jul 27 '12 18:07 emumanu

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

emumanu avatar Jul 27 '12 18:07 emumanu