Skip to content

Commit

Permalink
[CHG] add readonly bypass management into the popup too
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Nemry (ACSONE) committed Jul 26, 2016
1 parent 15aa39c commit 60c9266
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions readonly_bypass/static/src/js/readonly_bypass.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,42 @@ openerp.readonly_bypass = function(instance) {

});

instance.web.ProxyDataSet.include({

init : function() {
this._super.apply(this, arguments);
},
/**
* Creates Overriding
*
* @param {Object} data field values to set on the new record
* @param {Object} options Dictionary that can contain the following keys:
* - readonly_fields: Values from readonly fields that were updated by
* on_changes. Only used by the BufferedDataSet to make the o2m work correctly.
* @returns super {$.Deferred}
*/
create : function(data, options) {
var self = this;
ignore_readonly(data, options, true, self.context);
return self._super(data,options);
},
/**
* Creates Overriding
*
* @param {Object} data field values to set on the new record
* @param {Object} options Dictionary that can contain the following keys:
* - readonly_fields: Values from readonly fields that were updated by
* on_changes. Only used by the BufferedDataSet to make the o2m work correctly.
* @returns super {$.Deferred}
*/
write : function(id, data, options) {
var self = this;
ignore_readonly(data, options, false, self.context);
return self._super(id,data,options);
},

});

instance.web.DataSet.include({
/*
BufferedDataSet: case of 'add an item' into a form view
Expand Down

0 comments on commit 60c9266

Please sign in to comment.