From b8a0bdf47adb259258dfdaf1946323365c920909 Mon Sep 17 00:00:00 2001 From: Stephane Le Cornec Date: Thu, 14 Jan 2016 11:02:27 -0500 Subject: [PATCH] 9.0 base - cleanup share module --- addons/share/__init__.py | 24 +++++++++ addons/share/__openerp__.py | 53 +++++++++++++++++++ .../migrations/9.0.1.3/post-migration.py | 39 ++++++++++++++ addons/share/wizard/__init__.py | 25 +++++++++ addons/share/wizard/share_wizard.py | 29 ++++++++++ 5 files changed, 170 insertions(+) create mode 100644 addons/share/__init__.py create mode 100644 addons/share/__openerp__.py create mode 100644 addons/share/migrations/9.0.1.3/post-migration.py create mode 100644 addons/share/wizard/__init__.py create mode 100644 addons/share/wizard/share_wizard.py diff --git a/addons/share/__init__.py b/addons/share/__init__.py new file mode 100644 index 000000000000..e994d524775d --- /dev/null +++ b/addons/share/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import wizard + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py new file mode 100644 index 000000000000..e9a204dbf984 --- /dev/null +++ b/addons/share/__openerp__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# Copyright (C) 2010-2011 OpenERP SA (). +# +# 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 . +# +############################################################################## + + +{ + 'name' : 'Share any Document', + 'version' : '2.0', + 'depends' : ['base', 'mail'], + 'author' : 'OpenERP SA', + 'category': 'Tools', + 'description': """ +This module adds generic sharing tools to your current OpenERP database. +======================================================================== + +It specifically adds a 'share' button that is available in the Web client to +share any kind of OpenERP data with colleagues, customers, friends. + +The system will work by creating new users and groups on the fly, and by +combining the appropriate access rights and ir.rules to ensure that the shared +users only have access to the data that has been shared with them. + +This is extremely useful for collaborative work, knowledge sharing, +synchronization with other companies. + """, + 'website': 'https://www.odoo.com', + 'demo': [], + 'data': [], + 'installable': True, + 'auto_install': True, + 'web': True, + 'qweb' : [], +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/migrations/9.0.1.3/post-migration.py b/addons/share/migrations/9.0.1.3/post-migration.py new file mode 100644 index 000000000000..f70aaf780650 --- /dev/null +++ b/addons/share/migrations/9.0.1.3/post-migration.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenUpgrade module for Odoo +# @copyright 2014-Today: Odoo Community Association +# @author: Sylvain LE GAL +# +# 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 . +# +############################################################################## + +from openupgradelib import openupgrade +from openerp.modules.registry import RegistryManager +from openerp import SUPERUSER_ID + + +def remove_share_module(cr): + pool = RegistryManager.get(cr.dbname) + ir_module_module = pool['ir.module.module'] + domain = [('name', '=', 'share'), + ('state', 'in', ('installed', 'to install', 'to upgrade'))] + ids = ir_module_module.search(cr, SUPERUSER_ID, domain) + ir_module_module.module_uninstall(cr, SUPERUSER_ID, ids) + + +@openupgrade.migrate() +def migrate(cr, version): + remove_share_module(cr) diff --git a/addons/share/wizard/__init__.py b/addons/share/wizard/__init__.py new file mode 100644 index 000000000000..1dae9e7a508b --- /dev/null +++ b/addons/share/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import share_wizard + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py new file mode 100644 index 000000000000..a17c01d695c8 --- /dev/null +++ b/addons/share/wizard/share_wizard.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# 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 . +# +############################################################################## +from openerp.osv import fields, osv + + +class share_wizard(osv.TransientModel): + _name = 'share.wizard' + + +class share_result_line(osv.osv_memory): + _name = 'share.wizard.result.line'