c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #19134
[Bug 733311] [NEW] one2many onchange parameters behaves differently in web and gtk client
Public bug reported:
I noticed that when there is an on_change function associated to a
one2many field, the web client and gtk client behaves differently. While
web client passes a list of ids, GTK passes a list of "one2many-action-
tuples" (don't know how you call something like (1, ID, {values}) or
(0,0,{values})). Of course this is a problem if I have to know how to
handle my parameters: should I make a read (or a browse) on passed ids,
or should I rely on values dictionary?
The problem is made evident when using account_voucher module with web
client, since in account.voucher.sale.form and
account.voucher.purchase.form views there is the onchange_price() method
associated to line_cr_ids field (which of course is a one2many field);
the method assumes that a list of tuples is passed, while the web client
is passing a list of integers. In this case, not only you don't get the
expected result, also an ugly traceback pops up in a new browser window.
Thanks
Marco
** Affects: openobject-client-web
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/733311
Title:
one2many onchange parameters behaves differently in web and gtk client
Status in OpenERP Web Client:
New
Bug description:
I noticed that when there is an on_change function associated to a
one2many field, the web client and gtk client behaves differently.
While web client passes a list of ids, GTK passes a list of "one2many-
action-tuples" (don't know how you call something like (1, ID,
{values}) or (0,0,{values})). Of course this is a problem if I have to
know how to handle my parameters: should I make a read (or a browse)
on passed ids, or should I rely on values dictionary?
The problem is made evident when using account_voucher module with web
client, since in account.voucher.sale.form and
account.voucher.purchase.form views there is the onchange_price()
method associated to line_cr_ids field (which of course is a one2many
field); the method assumes that a list of tuples is passed, while the
web client is passing a list of integers. In this case, not only you
don't get the expected result, also an ugly traceback pops up in a new
browser window.
Thanks
Marco
Follow ups
References