Merge pull request #5328 from expsa/kch_dev_odex25_base

[IMP] syn_disable_quick_create: Allow selective skip_disable_quick_cr…
This commit is contained in:
kchyounes19 2025-11-11 09:11:20 +01:00 committed by GitHub
commit 7fb618091e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -3,6 +3,9 @@ odoo.define('syn_disable_quick_create.disable_relational_create', function (requ
var relational_fields = require('web.relational_fields');
function shouldSkipField(nodeOptions) {
return nodeOptions && nodeOptions.skip_disable_quick_create === true;
}
/**
* Extend FieldMany2One to disable all create options
*/
@ -12,6 +15,9 @@ odoo.define('syn_disable_quick_create.disable_relational_create', function (requ
*/
init: function () {
this._super.apply(this, arguments);
if (shouldSkipField(this.nodeOptions)) {
return;
}
// Disable all create options for Many2One fields
this.can_create = false;
this.nodeOptions.no_create = true;
@ -29,6 +35,9 @@ odoo.define('syn_disable_quick_create.disable_relational_create', function (requ
*/
init: function () {
this._super.apply(this, arguments);
if (shouldSkipField(this.nodeOptions)) {
return;
}
// Disable all create options for Many2Many Tags fields
this.can_create = false;
this.nodeOptions.no_create = true;
@ -45,6 +54,9 @@ odoo.define('syn_disable_quick_create.disable_relational_create', function (requ
*/
init: function () {
this._super.apply(this, arguments);
if (shouldSkipField(this.nodeOptions)) {
return;
}
// Disable all create options for editable Many2Many Tags
this.can_create = false;
this.nodeOptions.no_create = true;
@ -62,6 +74,9 @@ odoo.define('syn_disable_quick_create.disable_relational_create', function (requ
*/
init: function () {
this._super.apply(this, arguments);
if (shouldSkipField(this.nodeOptions)) {
return;
}
// Disable all create options
this.can_create = false;
this.nodeOptions.no_create = true;