diff --git a/eradicate_quick_create/__init__.py b/eradicate_quick_create/__init__.py index 0ebd70b..bad9dcd 100644 --- a/eradicate_quick_create/__init__.py +++ b/eradicate_quick_create/__init__.py @@ -1,23 +1,3 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Eradicate Quick Create module for Odoo/OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- from . import model diff --git a/eradicate_quick_create/__manifest__.py b/eradicate_quick_create/__manifest__.py index c16b87e..f8ffcb8 100644 --- a/eradicate_quick_create/__manifest__.py +++ b/eradicate_quick_create/__manifest__.py @@ -1,29 +1,10 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Eradicate Quick Create module for OpenERP/Odoo -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre { 'name': 'Eradicate Quick Create', - 'version': '0.1', + 'version': '10.0.1.0.0', 'category': 'Tools', 'license': 'AGPL-3', 'summary': 'Disable quick create on all objects', @@ -33,10 +14,10 @@ Eradicate Quick Create Disable quick create on all objects of Odoo. -Please contact Alexis de Lattre from Akretion for any help or question about this module. +This module has been written by Alexis de Lattre from Akretion . """, 'author': 'Akretion', 'website': 'http://www.akretion.com', 'depends': ['base_optional_quick_create'], - 'data': [], + 'installable': True, } diff --git a/eradicate_quick_create/model.py b/eradicate_quick_create/model.py index 63430da..26f0a07 100644 --- a/eradicate_quick_create/model.py +++ b/eradicate_quick_create/model.py @@ -1,38 +1,19 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Eradicate Quick Create module for Odoo/OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.osv import orm +from odoo import models, fields -class ir_model(orm.Model): +class IrModel(models.Model): _inherit = 'ir.model' - def init(self, cr): + def init(self): '''Activate 'avoid_quick_create' on all existing models''' - cr.execute( + self._cr.execute( "UPDATE ir_model SET avoid_quick_create=true " "WHERE avoid_quick_create is not true") return True - _defaults = { - 'avoid_quick_create': True, - } + avoid_quick_create = fields.Boolean(default=True)