[FIX] avoid adding session_id and token fields in form if they are already there, reuse existing fields instead
lp bug: https://launchpad.net/bugs/936704 fixed bzr revid: xmo@openerp.com-20120220115704-zxo024voy3dxa7qe
This commit is contained in:
parent
3f6524a6e2
commit
79a8b39369
|
@ -884,9 +884,12 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
|
|||
_(_.extend({}, options.data || {},
|
||||
{session_id: this.session_id, token: token}))
|
||||
.each(function (value, key) {
|
||||
$('<input type="hidden" name="' + key + '">')
|
||||
.val(value)
|
||||
.appendTo($form_data);
|
||||
var $input = $form.find('[name=' + key +']');
|
||||
if (!$input.length) {
|
||||
$input = $('<input type="hidden" name="' + key + '">')
|
||||
.appendTo($form_data);
|
||||
}
|
||||
$input.val(value)
|
||||
});
|
||||
|
||||
$form
|
||||
|
|
Loading…
Reference in New Issue