[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:
Xavier Morel 2012-02-20 12:57:04 +01:00
parent 3f6524a6e2
commit 79a8b39369
1 changed files with 6 additions and 3 deletions

View File

@ -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