On 2017-09-25 07:58, Maxime Richez wrote:
> Hi,
>
> I'm trying to sort a model list in proteus with sorted function... so
> i apply sort on each element of my model list and store them in a
> list, pop each record of my "unordered" model list, then try to append
> each record in my empty model list but get an error "assert
> record._parent is None"...
It is strange because .pop set the _parent attribute to None.
Are you sure you remove all the records?
Indeed I would write the code like this:
while request.quotation_lines:
request.quotation_lines.pop()
request.quotation_lines.extend(sorted_quotations)
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/20170926073314.GA3625%40kei.