Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi there !
I try to make a v7 module working in v8. The only issue I have for now is the default values.
In model A, I have a one2many field, with a default value set to a function call. The function create records of the linked object B, then return their ids. I checked with psql, the records of B are indeed created, but the id of A is not passed to them. In consequence, when I try to create a record of A, B are created, but I cant see them, nor edit them in the "one2many_list" of A's form view.
And this is weird, since it worked back in v7. I tried the new-style approach, passing the function name to a "default" argument of the one2many field definition, and removing the "_defaults" part, but no luck with that. Not working neither.
Any help ?
By the way, what is the proper syntax of a new-style default function ? What decorator should I put ? What should it return ? A list of ids ? A list of tuples (id, name) ? Thanks !
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/13/15, 4:18 AM|
|Seen: 1030 times|
|Last updated: 3/16/15, 8:10 AM|