diff --git a/openerp/addons/base/__init__.py b/openerp/addons/base/__init__.py index d666a6abbf7..a5bc4c59484 100644 --- a/openerp/addons/base/__init__.py +++ b/openerp/addons/base/__init__.py @@ -20,6 +20,7 @@ ############################################################################## import ir +import workflow import module import res import report diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py index c797d3cf47e..808dd18d3e5 100644 --- a/openerp/addons/base/__openerp__.py +++ b/openerp/addons/base/__openerp__.py @@ -42,7 +42,6 @@ The kernel of OpenERP, needed for all installation. 'res/res_security.xml', 'res/res_config.xml', 'res/res.country.state.csv', - 'ir/wizard/wizard_menu_view.xml', 'ir/ir_actions.xml', 'ir/ir_config_parameter_view.xml', 'ir/ir_cron_view.xml', @@ -57,8 +56,8 @@ The kernel of OpenERP, needed for all installation. 'ir/ir_ui_view_view.xml', 'ir/ir_values_view.xml', 'ir/osv_memory_autovacuum.xml', - 'ir/report/ir_report.xml', - 'ir/workflow/workflow_view.xml', + 'ir/ir_model_report.xml', + 'workflow/workflow_view.xml', 'module/module_view.xml', 'module/module_data.xml', 'module/module_report.xml', @@ -79,7 +78,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/ir/__init__.py b/openerp/addons/base/ir/__init__.py index c6034e0f7ee..35184f7a565 100644 --- a/openerp/addons/base/ir/__init__.py +++ b/openerp/addons/base/ir/__init__.py @@ -32,9 +32,7 @@ import ir_filters import ir_values import ir_translation import ir_exports -import workflow import ir_rule -import wizard import ir_config_parameter import osv_memory_autovacuum import ir_mail_server diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index 6630251d2fb..396de27903e 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -1136,4 +1136,32 @@ class ir_model_data(osv.osv): _logger.info('Deleting %s@%s', res_id, model) self.pool[model].unlink(cr, uid, [res_id]) +class wizard_model_menu(osv.osv_memory): + _name = 'wizard.ir.model.menu.create' + _columns = { + 'menu_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True), + 'name': fields.char('Menu Name', size=64, required=True), + } + + def menu_create(self, cr, uid, ids, context=None): + if not context: + context = {} + model_pool = self.pool.get('ir.model') + for menu in self.browse(cr, uid, ids, context): + model = model_pool.browse(cr, uid, context.get('model_id'), context=context) + val = { + 'name': menu.name, + 'res_model': model.model, + 'view_type': 'form', + 'view_mode': 'tree,form' + } + action_id = self.pool.get('ir.actions.act_window').create(cr, uid, val) + self.pool.get('ir.ui.menu').create(cr, uid, { + 'name': menu.name, + 'parent_id': menu.menu_id.id, + 'action': 'ir.actions.act_window,%d' % (action_id,), + 'icon': 'STOCK_INDENT' + }, context) + return {'type':'ir.actions.act_window_close'} + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/ir/report/modeloverview.sxw b/openerp/addons/base/ir/ir_model_report.sxw similarity index 100% rename from openerp/addons/base/ir/report/modeloverview.sxw rename to openerp/addons/base/ir/ir_model_report.sxw diff --git a/openerp/addons/base/ir/report/ir_report.xml b/openerp/addons/base/ir/ir_model_report.xml similarity index 84% rename from openerp/addons/base/ir/report/ir_report.xml rename to openerp/addons/base/ir/ir_model_report.xml index 3d077f453c8..9fcf97b6c49 100644 --- a/openerp/addons/base/ir/report/ir_report.xml +++ b/openerp/addons/base/ir/ir_model_report.xml @@ -7,7 +7,7 @@ model="ir.model" name="ir.model.overview" report_type="sxw" - file="base/ir/report/modeloverview.sxw" + file="base/ir/ir_model_report.sxw" header="False" /> diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml index 537c046f95d..fb68df9b5ff 100644 --- a/openerp/addons/base/ir/ir_model_view.xml +++ b/openerp/addons/base/ir/ir_model_view.xml @@ -1,6 +1,27 @@ + + + + Create Menu + wizard.ir.model.menu.create + +
+ + + + +
+
+
+
+
+ + ir.model diff --git a/openerp/addons/base/ir/wizard/__init__.py b/openerp/addons/base/ir/wizard/__init__.py deleted file mode 100644 index 23cc77e8c15..00000000000 --- a/openerp/addons/base/ir/wizard/__init__.py +++ /dev/null @@ -1,23 +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 . -# -############################################################################## -import wizard_menu -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/openerp/addons/base/ir/wizard/wizard_menu.py b/openerp/addons/base/ir/wizard/wizard_menu.py deleted file mode 100644 index a374b3dad2d..00000000000 --- a/openerp/addons/base/ir/wizard/wizard_menu.py +++ /dev/null @@ -1,54 +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 openerp.osv import fields, osv - -class wizard_model_menu(osv.osv_memory): - _name = 'wizard.ir.model.menu.create' - _columns = { - 'menu_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True), - 'name': fields.char('Menu Name', size=64, required=True), - } - - def menu_create(self, cr, uid, ids, context=None): - if not context: - context = {} - model_pool = self.pool.get('ir.model') - for menu in self.browse(cr, uid, ids, context): - model = model_pool.browse(cr, uid, context.get('model_id'), context=context) - val = { - 'name': menu.name, - 'res_model': model.model, - 'view_type': 'form', - 'view_mode': 'tree,form' - } - action_id = self.pool.get('ir.actions.act_window').create(cr, uid, val) - self.pool.get('ir.ui.menu').create(cr, uid, { - 'name': menu.name, - 'parent_id': menu.menu_id.id, - 'action': 'ir.actions.act_window,%d' % (action_id,), - 'icon': 'STOCK_INDENT' - }, context) - return {'type':'ir.actions.act_window_close'} - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/openerp/addons/base/ir/wizard/wizard_menu_view.xml b/openerp/addons/base/ir/wizard/wizard_menu_view.xml deleted file mode 100644 index 7fd32b256e2..00000000000 --- a/openerp/addons/base/ir/wizard/wizard_menu_view.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Create Menu - wizard.ir.model.menu.create - -
- - - - -
-
-
-
-
- -
-
diff --git a/openerp/addons/base/ir/workflow/__init__.py b/openerp/addons/base/ir/workflow/__init__.py deleted file mode 100644 index daa5bb1d29a..00000000000 --- a/openerp/addons/base/ir/workflow/__init__.py +++ /dev/null @@ -1,25 +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 . -# -############################################################################## -import workflow -import print_instance - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - 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..beb0018dc8d 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' @@ -81,29 +85,27 @@ class groups(osv.osv): def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): # add explicit ordering if search is sorted on full_name if order and order.startswith('full_name'): - ids = super(groups, self).search(cr, uid, args, context=context) + ids = super(res_groups, self).search(cr, uid, args, context=context) gs = self.browse(cr, uid, ids, context) gs.sort(key=lambda g: g.full_name, reverse=order.endswith('DESC')) gs = gs[offset:offset+limit] if limit else gs[offset:] return map(int, gs) - return super(groups, self).search(cr, uid, args, offset, limit, order, context, count) + return super(res_groups, self).search(cr, uid, args, offset, limit, order, context, count) def copy(self, cr, uid, id, default=None, context=None): group_name = self.read(cr, uid, [id], ['name'])[0]['name'] default.update({'name': _('%s (copy)')%group_name}) - return super(groups, self).copy(cr, uid, id, default, context) + return super(res_groups, self).copy(cr, uid, id, default, context) def write(self, cr, uid, ids, vals, context=None): if 'name' in vals: if vals['name'].startswith('-'): raise osv.except_osv(_('Error'), _('The name of the group can not start with "-"')) - res = super(groups, self).write(cr, uid, ids, vals, context=context) + res = super(res_groups, self).write(cr, uid, ids, vals, context=context) 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..628cfc4f858 100644 --- a/openerp/addons/base/res/res_users_view.xml +++ b/openerp/addons/base/res/res_users_view.xml @@ -1,6 +1,41 @@ + + + + Change Password + change.password.wizard + +
+ +
+
+ +
+
+ + Change Password Users + change.password.user + + + + + + + + + + res.groups.search @@ -277,5 +312,6 @@ +
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 - - - - - - - - - -
-
diff --git a/openerp/addons/base/workflow/__init__.py b/openerp/addons/base/workflow/__init__.py new file mode 100644 index 00000000000..45a9f36fa36 --- /dev/null +++ b/openerp/addons/base/workflow/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- + +import workflow +import workflow_report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/openerp/addons/base/ir/workflow/workflow.py b/openerp/addons/base/workflow/workflow.py similarity index 100% rename from openerp/addons/base/ir/workflow/workflow.py rename to openerp/addons/base/workflow/workflow.py diff --git a/openerp/addons/base/ir/workflow/print_instance.py b/openerp/addons/base/workflow/workflow_report.py similarity index 100% rename from openerp/addons/base/ir/workflow/print_instance.py rename to openerp/addons/base/workflow/workflow_report.py diff --git a/openerp/addons/base/ir/workflow/workflow_view.xml b/openerp/addons/base/workflow/workflow_view.xml similarity index 100% rename from openerp/addons/base/ir/workflow/workflow_view.xml rename to openerp/addons/base/workflow/workflow_view.xml