[RMV] disable_quick_create: remove module
This commit is contained in:
parent
6751d41f3e
commit
1ab3246a92
|
|
@ -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)
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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,
|
|
||||||
}
|
|
||||||
|
|
@ -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 l’option Créer et modifier"
|
|
||||||
|
|
||||||
#. module: disable_quick_create
|
|
||||||
#: model:ir.model,name:disable_quick_create.model_ir_model
|
|
||||||
msgid "Models"
|
|
||||||
msgstr "Modèles"
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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')
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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>
|
|
||||||
Loading…
Reference in New Issue