mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[REM] Remove former created module
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# This module copyright (C) 2016 Acsone SA (<http://acsone.eu>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
@@ -1,61 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# This module copyright (C) 2016 Acsone SA (<http://acsone.eu>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
"name": "Remove Duplicate Action",
|
||||
"version": "1.0",
|
||||
"author": "Acsone SA,Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"complexity": "normal",
|
||||
"description": """
|
||||
Introduction
|
||||
============
|
||||
|
||||
This addon provide a form option to allow to hide 'Duplicate' action
|
||||
on objects
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Simply depend on web_remove_duplicate and add the attribute 'remove_dependency'
|
||||
on the form view
|
||||
""",
|
||||
"category": "Dependency",
|
||||
"depends": [
|
||||
'web',
|
||||
],
|
||||
"data": [
|
||||
],
|
||||
"js": [
|
||||
'static/src/js/web_remove_duplicate.js'
|
||||
],
|
||||
"css": [
|
||||
],
|
||||
"qweb": [
|
||||
],
|
||||
"test": [
|
||||
],
|
||||
"auto_install": False,
|
||||
"installable": True,
|
||||
"application": False,
|
||||
"external_dependencies": {
|
||||
'python': [],
|
||||
},
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/* Web Remove Duplicate
|
||||
@author: Denis Roussel <denis.roussel@acsone.eu>
|
||||
Inspired by the module web_eradicate_duplicate of Alexis Delattre
|
||||
*/
|
||||
|
||||
openerp.web_remove_duplicate = function (instance) {
|
||||
var _t = instance.web._t;
|
||||
|
||||
instance.web.FormView.include({
|
||||
load_form: function(data) {
|
||||
this._super(data);
|
||||
// Remove More > Duplicate button except admin
|
||||
// if the form has the attribute 'remove_duplicate'
|
||||
if (
|
||||
this.sidebar &&
|
||||
this.sidebar.items &&
|
||||
this.sidebar.items.other &&
|
||||
this.session.uid != 1 &&
|
||||
this.fields_view.arch.attrs.remove_duplicate) {
|
||||
var new_items_other = _.reject(this.sidebar.items.other, function (item) {
|
||||
return item.label === _t('Duplicate');
|
||||
});
|
||||
this.sidebar.items.other = new_items_other;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
EXAMPLE : enable duplicate on account.move :
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="name">remove_duplicate.account_move_form</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form" position="attributes">
|
||||
<attribute name="remove_duplicate">True</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
*/
|
||||
Reference in New Issue
Block a user