This question has been flagged
2 Replies
4002 Views

Hello all,

I don't know why the bold new_id is between [ ] in the second sentence??? What does it mean? What do the two [ ] do there?


    new_id = super(sale_order, self).create(cr, uid, vals, context=ctx)

    self.message_post(cr, uid, [new_id], body=_("Quotation created"), context=ctx)


Thanks

Avatar
Discard

A question title that tells people to open your question before they know what it is may be read by less people than a question title with more detail than "What do the [] mean in this python line please".

Best Answer

Hello Pascal,

message_post method accepts either single ID or list of IDs and according to the type, method handles the passed ID(s).

You can see the source code of message_post() method.

Thanks.

Avatar
Discard