[IMP] add previous field value to change events

bzr revid: xmo@openerp.com-20110819101723-p73bts37knut34c8
This commit is contained in:
Xavier Morel 2011-08-19 12:17:23 +02:00
parent 32e9a10a1e
commit ec9a40c8f5
1 changed files with 4 additions and 3 deletions

View File

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