[IMP] only trigger change events when a field's value was actually changed, provide more information in change event

bzr revid: xmo@openerp.com-20110819101644-edovs858qrz1wb3y
This commit is contained in:
Xavier Morel 2011-08-19 12:16:44 +02:00
parent d69cd3cb15
commit 32e9a10a1e
1 changed files with 4 additions and 1 deletions

View File

@ -1204,9 +1204,12 @@ var Record = openerp.base.Class.extend(/** @lends Record# */{
* @returns {Record}
*/
set: function (key, value) {
if (this.attributes[key] === value) {
return this;
}
this.attributes[key] = value;
this.trigger('change:' + key, this, value);
this.trigger('change', this);
this.trigger('change', this, key, value);
return this;
},
/**