mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX+MIG] web_readonly_bypass: fix one2many popup
This commit is contained in:
committed by
Simone Orsi
parent
32aad6b60c
commit
aad46d9f76
@@ -63,7 +63,8 @@ Contributors
|
||||
* Jonathan Nemry <jonathan.nemry@acsone.eu>
|
||||
* Laetitia Gangloff <laetitia.gangloff@acsone.eu>
|
||||
* Pierre Verkest <pverkest@anybox.fr>
|
||||
* Kalpana Hemnani <???>
|
||||
* Kalpana Hemnani <hemnani.kalpana@gmail.com>
|
||||
* Agathe Mollé <agathe.molle@savoirfairelinux.com>
|
||||
* Simone Orsi <simone.orsi@camptocamp.com>
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
{
|
||||
'name': 'Read Only ByPass',
|
||||
'version': '10.0.1.0.0',
|
||||
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
|
||||
'version': '10.0.1.0.1',
|
||||
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
|
||||
"website": "http://www.acsone.eu",
|
||||
"license": "LGPL-3",
|
||||
'category': 'Technical Settings',
|
||||
|
||||
@@ -136,6 +136,45 @@ odoo.define('web_readonly_bypass', function(require) {
|
||||
|
||||
});
|
||||
|
||||
return readonly_bypass;
|
||||
data.ProxyDataSet.include({
|
||||
/*
|
||||
ProxyDataSet: case of 'pop-up'
|
||||
*/
|
||||
init : function() {
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
/**
|
||||
* Create 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;
|
||||
var context = pyeval.eval('contexts', self.context.get_eval_context());
|
||||
readonly_bypass.ignore_readonly(data, options, true, context);
|
||||
return self._super(data,options);
|
||||
},
|
||||
/**
|
||||
* Write 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;
|
||||
var context = pyeval.eval('contexts', self.context.get_eval_context());
|
||||
readonly_bypass.ignore_readonly(data, options, false, context);
|
||||
return self._super(id,data,options);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
return readonly_bypass;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user