Merge pull request #5264 from expsa/kk_dev_odex25_base

[RMV] disable_quick_create: remove module
This commit is contained in:
kchyounes19 2025-11-06 13:14:38 +01:00 committed by GitHub
commit c74d160053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 0 additions and 161 deletions

View File

@ -1,15 +0,0 @@
========================
Project Archive Improved
========================
This module disables the « Quick Create » option on relational fields all over the application. It also allows to disable the « Create and Edit » option on a per model basis.
In order to disable the « Create and Edit » for a specific model :
* Go to « Settings → Technical → Database Structure → Models
* Select your model
* Check the box « Disable Create and Edit »
Contributors
------------
* Yasmine El Mrini (yasmine.elmrini@savoirfairelinux.com)
* David Dufresne (david.dufresne@savoirfairelinux.com)

View File

@ -1,5 +0,0 @@
# -*- coding: utf-8 -*-
# © 2017-2018 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL).
from . import models

View File

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
# © 2017-2018 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL).
{
'name': 'Disable Quick Create',
'version': '14.0.1.0.0',
'author': 'Savoir-faire Linux',
'maintainer': 'Savoir-faire Linux',
'website': 'https://www.savoirfairelinux.com',
'license': 'LGPL-3',
"category": "Odex25-base",
'summary': 'Disable "quick create" for all and "create and edit" '
'for specific models',
'depends': [
'web',
],
'data': [
'views/disable_quick_create.xml',
'views/ir_model.xml',
],
'installable': True,
'application': False,
}

View File

@ -1,26 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * disable_quick_create
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-10 00:06+0000\n"
"PO-Revision-Date: 2017-12-10 00:06+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: disable_quick_create
#: model:ir.model.fields,field_description:disable_quick_create.field_ir_model_disable_create_edit
msgid "Disabling the Create and Edit option"
msgstr "Désactivation de loption Créer et modifier"
#. module: disable_quick_create
#: model:ir.model,name:disable_quick_create.model_ir_model
msgid "Models"
msgstr "Modèles"

View File

@ -1,5 +0,0 @@
# -*- coding: utf-8 -*-
# © 2017-2018 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import ir_model

View File

@ -1,12 +0,0 @@
# -*- coding: utf-8 -*-
# © 2017-2018 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import fields, models
class IrModel(models.Model):
_inherit = 'ir.model'
disable_create_edit = fields.Boolean(
string='Disabling the Create and Edit option')

View File

@ -1,40 +0,0 @@
/*
© 2017-2018 Savoir-faire Linux <https://savoirfairelinux.com>
License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL.html).
*/
odoo.define('disable_quick_create', function(require) {
"use strict";
var relational_fields = require('web.relational_fields');
var rpc = require('web.rpc');
var model_deferred = $.Deferred();
var models = [];
rpc.query({
model: "ir.model",
method: "search_read",
args:[
[['disable_create_edit','=', true]],
['model'],
],
}).then(function(result) {
result.forEach(function(el){
models.push(el.model);
})
model_deferred.resolve();
});
relational_fields.FieldMany2One.include({
init: function() {
this._super.apply(this, arguments);
this.nodeOptions.no_quick_create = true;
if (models.includes(this.field.relation)){
this.nodeOptions.no_create_edit = true;
this.nodeOptions.no_create = true;
}
},
});
});

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="disable_quick_create_assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/disable_quick_create/static/src/js/disable_quick_create.js"></script>
</xpath>
</template>
</odoo>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_model_form_inherited" model="ir.ui.view">
<field name="model">ir.model</field>
<field name="inherit_id" ref="base.view_model_form"/>
<field name="arch" type="xml">
<field name="transient" position="after">
<field name="disable_create_edit"/>
</field>
</field>
</record>
<record id="view_model_tree_inherited" model="ir.ui.view">
<field name="model">ir.model</field>
<field name="inherit_id" ref="base.view_model_tree"/>
<field name="arch" type="xml">
<field name="transient" position="after">
<field name="disable_create_edit"/>
</field>
</field>
</record>
</odoo>