diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py index c797d3cf47e..a26def920f4 100644 --- a/openerp/addons/base/__openerp__.py +++ b/openerp/addons/base/__openerp__.py @@ -79,7 +79,6 @@ The kernel of OpenERP, needed for all installation. 'res/res_bank_view.xml', 'res/res_country_view.xml', 'res/res_currency_view.xml', - 'res/wizard/change_password_wizard_view.xml', 'res/res_users_view.xml', 'res/res_partner_data.xml', 'res/ir_property_view.xml', diff --git a/openerp/addons/base/res/__init__.py b/openerp/addons/base/res/__init__.py index 59403545112..50807e20116 100644 --- a/openerp/addons/base/res/__init__.py +++ b/openerp/addons/base/res/__init__.py @@ -31,8 +31,5 @@ import res_request import res_lang import ir_property -import report -import wizard - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/res/config_pixmaps/1.png b/openerp/addons/base/res/config_pixmaps/1.png deleted file mode 100755 index 63bd4337369..00000000000 Binary files a/openerp/addons/base/res/config_pixmaps/1.png and /dev/null differ diff --git a/openerp/addons/base/res/config_pixmaps/2.png b/openerp/addons/base/res/config_pixmaps/2.png deleted file mode 100755 index 80d4e3602bb..00000000000 Binary files a/openerp/addons/base/res/config_pixmaps/2.png and /dev/null differ diff --git a/openerp/addons/base/res/config_pixmaps/3.png b/openerp/addons/base/res/config_pixmaps/3.png deleted file mode 100755 index 63acab34263..00000000000 Binary files a/openerp/addons/base/res/config_pixmaps/3.png and /dev/null differ diff --git a/openerp/addons/base/res/report/__init__.py b/openerp/addons/base/res/report/__init__.py deleted file mode 100644 index 0a7dcc8620f..00000000000 --- a/openerp/addons/base/res/report/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 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 report import report_sxw -#report_sxw.report_sxw('report.partner.list', 'res.partner', 'addons/base/res/partner/report/partner_list.rml') - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/openerp/addons/base/res/report/business_card.xml b/openerp/addons/base/res/report/business_card.xml deleted file mode 100644 index c4695ffa020..00000000000 --- a/openerp/addons/base/res/report/business_card.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -
- - - - - - Tiny sprl - Rue du Vieux Chateau, 21 - BE-1457 - Walhain - http://tiny.be -
-
diff --git a/openerp/addons/base/res/report/business_card.xsl b/openerp/addons/base/res/report/business_card.xsl deleted file mode 100644 index f274d9437f6..00000000000 --- a/openerp/addons/base/res/report/business_card.xsl +++ /dev/null @@ -1,80 +0,0 @@ - - - -20.5 -0.5 -5.5 -8.5 -5.5cm -8.5cm -3 -8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cm - - - - cm - - - - - - - - PACKINGLIST - - - - Logo - - - - - - - - - - - - - - - - - - diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index abfe8df7268..c59f56d9fa6 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -131,6 +131,7 @@ class res_config_configurable(osv.osv_memory): """ raise NotImplementedError( 'Configuration items need to implement execute') + def cancel(self, cr, uid, ids, context=None): """ Method called when the user click on the ``Skip`` button. @@ -184,8 +185,6 @@ class res_config_configurable(osv.osv_memory): if next: return next return self.next(cr, uid, ids, context=context) -res_config_configurable() - class res_config_installer(osv.osv_memory, res_config_module_installation_mixin): """ New-style configuration base specialized for addons selection and installation. @@ -314,7 +313,6 @@ class res_config_installer(osv.osv_memory, res_config_module_installation_mixin) context=context), context=context) - def modules_to_install(self, cr, uid, ids, context=None): """ selects all modules to install: @@ -397,45 +395,6 @@ class res_config_installer(osv.osv_memory, res_config_module_installation_mixin) return self._install_modules(cr, uid, modules, context=context) -res_config_installer() - -DEPRECATION_MESSAGE = 'You are using an addon using old-style configuration '\ - 'wizards (ir.actions.configuration.wizard). Old-style configuration '\ - 'wizards have been deprecated.\n'\ - 'The addon should be migrated to res.config objects.' -class ir_actions_configuration_wizard(osv.osv_memory): - ''' Compatibility configuration wizard - - The old configuration wizard has been replaced by res.config, but in order - not to break existing but not-yet-migrated addons, the old wizard was - reintegrated and gutted. - ''' - _name='ir.actions.configuration.wizard' - _inherit = 'res.config' - - def _next_action_note(self, cr, uid, ids, context=None): - next = self._next_action(cr, uid) - if next: - # if the next one is also an old-style extension, you never know... - if next.note: - return next.note - return _("Click 'Continue' to configure the next addon...") - return _("Your database is now fully configured.\n\n"\ - "Click 'Continue' and enjoy your OpenERP experience...") - - _columns = { - 'note': fields.text('Next Wizard', readonly=True), - } - _defaults = { - 'note': _next_action_note, - } - - def execute(self, cr, uid, ids, context=None): - _logger.warning(DEPRECATION_MESSAGE) - -ir_actions_configuration_wizard() - - class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): """ Base configuration wizard for application settings. It provides support for setting default values, assigning groups to employee users, and installing modules. @@ -694,4 +653,5 @@ class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): if (action_id): return exceptions.RedirectWarning(msg % values, action_id, _('Go to the configuration panel')) return exceptions.Warning(msg % values) + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/res/res_config.xml b/openerp/addons/base/res/res_config.xml index 342aeaa6e0f..066f9435434 100644 --- a/openerp/addons/base/res/res_config.xml +++ b/openerp/addons/base/res/res_config.xml @@ -17,23 +17,6 @@ - - Compabitiliby configuration wizard - ir.actions.configuration.wizard - -
- - - -
-
-
-
-
- Inheritable view for installer objects res.config.installer diff --git a/openerp/addons/base/res/res_partner_report.xml b/openerp/addons/base/res/res_partner_report.xml index 80ab161e62c..00b8a84608e 100644 --- a/openerp/addons/base/res/res_partner_report.xml +++ b/openerp/addons/base/res/res_partner_report.xml @@ -1,9 +1,13 @@ - - + diff --git a/openerp/addons/base/res/report/partner_address.xml b/openerp/addons/base/res/res_partner_report_address.xml similarity index 100% rename from openerp/addons/base/res/report/partner_address.xml rename to openerp/addons/base/res/res_partner_report_address.xml diff --git a/openerp/addons/base/res/report/partner_address.xsl b/openerp/addons/base/res/res_partner_report_address.xsl similarity index 100% rename from openerp/addons/base/res/report/partner_address.xsl rename to openerp/addons/base/res/res_partner_report_address.xsl diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py index ba709a48175..30a63d6a3e8 100644 --- a/openerp/addons/base/res/res_users.py +++ b/openerp/addons/base/res/res_users.py @@ -34,7 +34,11 @@ from openerp.tools.translate import _ _logger = logging.getLogger(__name__) -class groups(osv.osv): +#---------------------------------------------------------- +# Basic res.groups and res.users +#---------------------------------------------------------- + +class res_groups(osv.osv): _name = "res.groups" _description = "Access Groups" _rec_name = 'full_name' @@ -102,8 +106,6 @@ class groups(osv.osv): self.pool['ir.model.access'].call_cache_clearing_methods(cr) return res -groups() - class res_users(osv.osv): """ User class. A res.users record models an OpenERP user and is different from an employee. @@ -516,12 +518,13 @@ class res_users(osv.osv): (uid, module, ext_id)) return bool(cr.fetchone()) - -# -# Extension of res.groups and res.users with a relation for "implied" or -# "inherited" groups. Once a user belongs to a group, it automatically belongs -# to the implied groups (transitively). +#---------------------------------------------------------- +# Implied groups # +# Extension of res.groups and res.users with a relation for "implied" +# or "inherited" groups. Once a user belongs to a group, it +# automatically belongs to the implied groups (transitively). +#---------------------------------------------------------- class cset(object): """ A cset (constrained set) is a set of elements that may be constrained to @@ -551,7 +554,6 @@ def concat(ls): return res - class groups_implied(osv.osv): _inherit = 'res.groups' @@ -618,6 +620,8 @@ class users_implied(osv.osv): super(users_implied, self).write(cr, uid, [user.id], vals, context) return res +#---------------------------------------------------------- +# Vitrual checkbox and selection for res.user form view # # Extension of res.groups and res.users for the special groups view in the users # form. This extension presents groups with selection and boolean widgets: @@ -638,6 +642,7 @@ class users_implied(osv.osv): # any of ID1, ..., IDk is in 'groups_id' # - selection field 'sel_groups_ID1_..._IDk' is ID iff # ID is in 'groups_id' and ID is maximal in the set {ID1, ..., IDk} +#---------------------------------------------------------- def name_boolean_group(id): return 'in_group_' + str(id) def name_boolean_groups(ids): return 'in_groups_' + '_'.join(map(str, ids)) @@ -661,7 +666,6 @@ def partition(f, xs): return yes, nos - class groups_view(osv.osv): _inherit = 'res.groups' @@ -869,4 +873,67 @@ class users_view(osv.osv): } return res +#---------------------------------------------------------- +# change password wizard +#---------------------------------------------------------- + +class change_password_wizard(osv.TransientModel): + """ + A wizard to manage the change of users' passwords + """ + + _name = "change.password.wizard" + _description = "Change Password Wizard" + _columns = { + 'user_ids': fields.one2many('change.password.user', 'wizard_id', string='Users'), + } + + def default_get(self, cr, uid, fields, context=None): + if context == None: + context = {} + user_ids = context.get('active_ids', []) + wiz_id = context.get('active_id', None) + res = [] + users = self.pool.get('res.users').browse(cr, uid, user_ids, context=context) + for user in users: + res.append((0, 0, { + 'wizard_id': wiz_id, + 'user_id': user.id, + 'user_login': user.login, + })) + return {'user_ids': res} + + + def change_password_button(self, cr, uid, id, context=None): + wizard = self.browse(cr, uid, id, context=context)[0] + user_ids = [] + for user in wizard.user_ids: + user_ids.append(user.id) + self.pool.get('change.password.user').change_password_button(cr, uid, user_ids, context=context) + return { + 'type': 'ir.actions.act_window_close', + } + +class change_password_user(osv.TransientModel): + """ + A model to configure users in the change password wizard + """ + + _name = 'change.password.user' + _description = 'Change Password Wizard User' + _columns = { + 'wizard_id': fields.many2one('change.password.wizard', string='Wizard', required=True), + 'user_id': fields.many2one('res.users', string='User', required=True), + 'user_login': fields.char('User Login', readonly=True), + 'new_passwd': fields.char('New Password'), + } + _defaults = { + 'new_passwd': '', + } + + def change_password_button(self, cr, uid, ids, context=None): + for user in self.browse(cr, uid, ids, context=context): + self.pool.get('res.users').write(cr, uid, user.user_id.id, {'password': user.new_passwd}) + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/res/res_users_view.xml b/openerp/addons/base/res/res_users_view.xml index 770cb45149b..f741a7925bc 100644 --- a/openerp/addons/base/res/res_users_view.xml +++ b/openerp/addons/base/res/res_users_view.xml @@ -277,5 +277,43 @@ + + + + + + Change Password + change.password.wizard + +
+ +
+
+ +
+
+ + + + Change Password Users + change.password.user + + + + + + + + + diff --git a/openerp/addons/base/res/wizard/__init__.py b/openerp/addons/base/res/wizard/__init__.py deleted file mode 100644 index f572814a2cf..00000000000 --- a/openerp/addons/base/res/wizard/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2011 OpenERP S.A (). -# -# 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 change_password_wizard \ No newline at end of file diff --git a/openerp/addons/base/res/wizard/change_password_wizard.py b/openerp/addons/base/res/wizard/change_password_wizard.py deleted file mode 100644 index 4d1bfe67fce..00000000000 --- a/openerp/addons/base/res/wizard/change_password_wizard.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2011 OpenERP S.A (). -# -# 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 change_password_wizard(osv.TransientModel): - """ - A wizard to manage the change of users' passwords - """ - - _name = "change.password.wizard" - _description = "Change Password Wizard" - _columns = { - 'user_ids': fields.one2many('change.password.user', 'wizard_id', string='Users'), - } - - def default_get(self, cr, uid, fields, context=None): - if context == None: - context = {} - user_ids = context.get('active_ids', []) - wiz_id = context.get('active_id', None) - res = [] - users = self.pool.get('res.users').browse(cr, uid, user_ids, context=context) - for user in users: - res.append((0, 0, { - 'wizard_id': wiz_id, - 'user_id': user.id, - 'user_login': user.login, - })) - return {'user_ids': res} - - - def change_password_button(self, cr, uid, id, context=None): - wizard = self.browse(cr, uid, id, context=context)[0] - user_ids = [] - for user in wizard.user_ids: - user_ids.append(user.id) - self.pool.get('change.password.user').change_password_button(cr, uid, user_ids, context=context) - return { - 'type': 'ir.actions.act_window_close', - } - -class change_password_user(osv.TransientModel): - """ - A model to configure users in the change password wizard - """ - - _name = 'change.password.user' - _description = 'Change Password Wizard User' - _columns = { - 'wizard_id': fields.many2one('change.password.wizard', string='Wizard', required=True), - 'user_id': fields.many2one('res.users', string='User', required=True), - 'user_login': fields.char('User Login', readonly=True), - 'new_passwd': fields.char('New Password'), - } - _defaults = { - 'new_passwd': '', - } - - def change_password_button(self, cr, uid, ids, context=None): - for user in self.browse(cr, uid, ids, context=context): - self.pool.get('res.users').write(cr, uid, user.user_id.id, {'password': user.new_passwd}) - diff --git a/openerp/addons/base/res/wizard/change_password_wizard_view.xml b/openerp/addons/base/res/wizard/change_password_wizard_view.xml deleted file mode 100644 index cc190c1525a..00000000000 --- a/openerp/addons/base/res/wizard/change_password_wizard_view.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - Change Password - change.password.wizard - -
- -
-
- -
-
- - - - Change Password Users - change.password.user - - - - - - - - - -
-