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 !
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/13/15, 4:18 AM|
|Seen: 830 times|
|Last updated: 3/16/15, 8:10 AM|