[MERGE]
[odoo/odoo.git] / addons / profile_association / profile_association.py
index 61ff028..0130522 100644 (file)
@@ -1,22 +1,21 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
 ##############################################################################
-#
-#    OpenERP, Open Source Management Solution  
-#    Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-#    $Id$
+#    
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
 #
 #    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    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 General Public License for more details.
+#    GNU Affero General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#    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/>.     
 #
 ##############################################################################
 
@@ -26,6 +25,8 @@ import pooler
 
 class profile_association_config_install_modules_wizard(osv.osv_memory):
     _name='profile.association.config.install_modules_wizard'
+    _inherit = 'res.config'
+
     _columns = {
         'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
         'project':fields.boolean('Project Management'),
@@ -37,29 +38,15 @@ class profile_association_config_install_modules_wizard(osv.osv_memory):
         'wiki': fields.boolean('Wiki', 
             help="An integrated wiki content management system. This is really usefull to manage FAQ, quality manuals, etc.")
     }
-    def action_cancel(self,cr,uid,ids,conect=None):
-        return {
-                'view_type': 'form',
-                "view_mode": 'form',
-                'res_model': 'ir.actions.configuration.wizard',
-                'type': 'ir.actions.act_window',
-                'target':'new',
-         }
-    def action_install(self, cr, uid, ids, context=None):
-        result=self.read(cr,uid,ids)
+    def execute(self, cr, uid, ids, context=None):
+        result = self.read(cr,uid,ids)
         mod_obj = self.pool.get('ir.module.module')
         for res in result:
             for r in res:
-                if r<>'id' and res[r]:
+                if r != 'id' and res[r]:
                     ids = mod_obj.search(cr, uid, [('name', '=', r)])
-                    mod_obj.action_install(cr, uid, ids, context=context)
+                    mod_obj.button_install(cr, uid, ids, context=context)
         cr.commit()
         db, pool = pooler.restart_pool(cr.dbname, update_module=True)
-        return {
-                'view_type': 'form',
-                "view_mode": 'form',
-                'res_model': 'ir.actions.configuration.wizard',
-                'type': 'ir.actions.act_window',
-                'target':'new',
-            }
 profile_association_config_install_modules_wizard()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: