Mohammed Shekha(Open ERP) has proposed merging
lp:~openerp-dev/openobject-client-web/6.0-opw-18382-msh into
lp:openobject-client-web/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-18382-msh/+merge/80189
Hello,
Issue: When there is onchange which changes the data of many2many field then
old data remains as it is.
Demo: Accounting -> Customer Invoices -> Invoice Line -> Add Account tax in
many2many field -> now change the account_id so many2many will change due to
onChange -> Now again Add Account Tax in many2many field, you will find the
older tax what we have selected first time also come in many2many field.
Expected: When user selects change account_id and adds Account tax then old
tax_line should not come there.
Problem: When onChange fires the many2many field is replaced with new view
with this code "jQuery(old_m2m).replaceWith(obj.m2m_view);" but here hidden
terp_ids are not removed when onChange fired, so due to that old data remains
as it is, and when user selects many2many at that time old _terp_ids are also
sended to server.
Demo 2 : Sale order -> Sale Order Line -> change product which changes
many2many Account Tax field.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-18382-msh/+merge/80189
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-client-web/6.0-opw-18382-msh.
=== modified file 'addons/openerp/static/javascript/form.js'
--- addons/openerp/static/javascript/form.js 2011-10-13 06:51:17 +0000
+++ addons/openerp/static/javascript/form.js 2011-10-24 09:57:27 +0000
@@ -618,6 +618,8 @@
}
var fld_name = jQuery(fld).attr('name');
var old_m2m = jQuery(idSelector(fld_name)).closest('.list-a');
+ jQuery(idSelector(fld_name+'/_terp_id')).val('');
+ jQuery(idSelector(fld_name+'/_terp_ids')).val('[]');
jQuery.ajax({
url: '/openerp/listgrid/get_m2m',
data: {
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp