I'm an OpenERP newbie, so please excuse me if my question has been covered 
somewhere in the documentation already, for my overview of the documentation is 
pretty weak still.

I'm creating three tables: Book, Order, and Client.

Each Book can be in several Orders. Each Order can contain several Books. And 
each Order belongs to a single Client.

I would like the many2many connection between Book and Order to be 
bidirectional, so both define a many2many relationship view an external table. 
But the problem is that in whichever order I seem to specify the creation of 
Book and Order in the code, it always complains about the other one not 
existing.

This is the relevant field from Book:

"in_orders"      :  
 fields.many2many("mysimple.order", "rel_books_to_orders", "book_id", 
"order_id", "Appears in orders"),

And this is the relevant field from Order:

"books"          :  
 fields.many2many("mysimple.book", "rel_books_to_orders", "order_id", 
"book_id", "Books in order"),

And this is the error I get when OpenERP crashes during database creation:

ProgrammingError: relation "mysimple_order" does not exist

And according to PostgreSQL logs, this is what happens on the server side:

CREATE TABLE "rel_books_to_orders" ("book_id" INTEGER NOT NULL REFERENCES 
"mysimple_book" ON DELETE CASCADE, "order_id" INTEGER NOT NULL REFERENCES 
"mysimple_order" ON DELETE CASCADE) WITH OIDS

Basically I've been trying to follow the many2many definition here:

http://doc.openerp.com/developer/2_5_Objects_Fields_Methods/field_type.html

Is this a limitation of OpenERP or am I doing something wrong here?




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=48035#48035

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to