← Back to team overview

openerp-expert-framework team mailing list archive

Re: O2M serialization rules (Was: 6.1 Web Client and Context evaluation)

 

On 06/02/2012 03:49 PM, Gustavo Adrian Marino wrote:
> Olivier:
> Let me add some comments:
> 
>   * There is a missing case: the on_change input and output situation.
>     On on_change input (like for example if you want to summarize totals for
>     the item lines in an invoice), currently you receive the full list of
>     commands stored on web client. as parameter of the onchange. Nevertheless,
>     if you like, as part of your onchange method, to change the items list, you
>     are now limited to IDs lists. I guess that the same serialization rules
>     should apply in this case.

Yup, that's the 5) cases I think Thibaut was referring to as well: the allowed
format for o2m values in the result of an on_change call. See my previous reply
to the thread.
BTW if we decide that [1,2,3] is a valid shortened form of [(4,1),(4,2),(4,3)],
then the proposed format for case 5) is backwards compatible with the current
results too.


>   * In v6.1, serialization only considers changed values, so in the lists for 1
>     command, only modified fields are included (nice to say if we use this post
>     as the "Official documentation" (certainly, there is no easy way to get a
>     doc for this topic)

Well the UPDATE(1) command takes a values dict in the same format as what you
pass to write(), so indeed only modified fields should be specified. I think
that's kind of obvious of an UPDATE.


>   * I guess that the original bug report is not intended to discuss the
>     serialization of on2many fields, but to the fact that v6.1 ignores context
>     parameters on one2many (no context is passed), and thus you can not pass
>     parameters from the 'one side' to the object creation on the 'many side'.
>     Nevertheless, I celebrate to have this topic explained in your comment!

His bug report was about the serialized o2m values not being available inside
the context in some cases, not about the context itself being ignored. And as I
explained, the reason for this behavior in 6.1 is the (un)specified
serialization rules for o2m.



PS: please try to avoid top-posting[1], especially in longish discussion
threads. I find that inline-replies with some trimming is the nicest way to
keep things readable. Thanks :-)

[1] http://en.wikipedia.org/wiki/Posting_style


References