neo4jrb / neo4apis-activerecord

An ruby gem to import SQL data to neo4j using activerecord
MIT License
28 stars 15 forks source link

No UUID specified for label #11

Open alexander-arce opened 8 years ago

alexander-arce commented 8 years ago

Hi, I try to import data from OpenErp/Odoo. Models are generated using Rmre. In my test, i want import data only from pos_order model, but process fail with message
No UUID specified for label AccountJournal Anyone trying to import data from OpenErp/Odoo?

cheerfulstoic commented 8 years ago

What command did you try running, or was it via Ruby code? That error makes me think that it's trying to import all tables

alexander-arce commented 8 years ago

Hi @cheerfulstoic I try running _neo4apis activerecord models posorder --neo4j-url "http://xxxx:xx@localhost:7474" --identify-model --import-all-associations --debug Debug message is:

Importing tables: pos_order include_list [:account_invoice, :account_journal, :account_move, :pos_order_lines, :pos_order_line_commissions, >:account_bank_statement_lines, :pos_session, :product_pricelist, :res_company, :res_partner, >:res_user, :sale_shop, :stock_picking]

Error message:

/home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-0.8.2/lib/neo4apis/base.rb:35:in add_node': No UUID specified for labelAccountJournal(ArgumentError) from /home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/activerecord.rb:63:inadd_model_node' from /home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/activerecord.rb:51:in add_model_relationship' from /home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/activerecord.rb:35:inblock (2 levels) in model_importer' from /home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/activerecord.rb:30:in each' from /home/aletz/.rvm/gems/ruby-2.2.0/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/activerecord.rb:30:inblock in model_importer' Thanks

cheerfulstoic commented 8 years ago

Ah, got it, I think it's because it's trying to load associations. In this case the PosJournal model (I think) has an association to the AccountJournal.

Is account_journal a many-to-many table, maybe? Does it have a primary key?

alexander-arce commented 8 years ago

Yes PosOrder has an association to the AccountJournal. AccountJournal has a primary key. I'm attaching files for model definition according to debug message. pos_order.txt account_bank_statement_line.txt account_invoice.txt account_journal.txt account_move.txt pos_order_line.txt pos_order_line_commission.txt pos_session.txt product_pricelist.txt res_company.txt res_partner.txt res_user.txt sale_shop.txt stock_picking.txt

Sql definition for AccountJournal: account_journal.sql.txt

alexander-arce commented 8 years ago

I attach images of relations for pos_order

Foreign keys pos_order_foreign_keys Dependencies pos_order_dependencies