summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/wizard/base_module_update.py
diff options
context:
space:
mode:
authorVir (Open ERP) <vir@tinyerp.com>2010-10-05 10:04:57 +0530
committerVir (Open ERP) <vir@tinyerp.com>2010-10-05 10:04:57 +0530
commitaf76cb9af7b7bccf9cd975adaa3cb27ff1aa1d67 (patch)
tree656dfb76968fbe97ccbf28cfa2c3a49972efcab6 /bin/addons/base/module/wizard/base_module_update.py
parent53b35c7d6eb8a1a046fbac056acd4f08093441ff (diff)
parent863766e16afe32b046e5e5bf0f7e0a6384be025b (diff)
[Merge]
bzr revid: vir@tinyerp.com-20101005043457-bxgzubu7m9teawws
Diffstat (limited to 'bin/addons/base/module/wizard/base_module_update.py')
-rw-r--r--bin/addons/base/module/wizard/base_module_update.py80
1 files changed, 15 insertions, 65 deletions
diff --git a/bin/addons/base/module/wizard/base_module_update.py b/bin/addons/base/module/wizard/base_module_update.py
index 29e897b3a0c..a0d21840d90 100644
--- a/bin/addons/base/module/wizard/base_module_update.py
+++ b/bin/addons/base/module/wizard/base_module_update.py
@@ -18,8 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import netsvc
-import pooler
from osv import osv, fields
class base_module_update(osv.osv_memory):
@@ -27,85 +25,37 @@ class base_module_update(osv.osv_memory):
_name = "base.module.update"
_description = "Update Module"
+ _inherit = "ir.wizard.screen"
- def update_module(self, cr, uid, ids, context):
- """
- Update Module
-
- @param cr: the current row, from the database cursor.
- @param uid: the current user’s ID for security checks.
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
- """
- data_obj = self.pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_update_open')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
-
- return {
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'base.module.update.open',
- 'views': [(id2, 'form')],
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'target': 'new',
-
- }
-
-base_module_update()
-
-class base_module_update_open(osv.osv_memory):
- """ Update Module Open """
-
- _name = "base.module.update.open"
- _description = "Update Module Open"
+ _columns = {
+ 'update': fields.integer('Number of modules updated', readonly=True),
+ 'add': fields.integer('Number of modules added', readonly=True),
+ 'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
+ }
- def default_get(self, cr, uid, fields, context=None):
- """
- This function gets default values
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param fields: List of fields for default value
- @param context: A standard dictionary for contextual values
- @return : default values of fields.
- """
+ _defaults = {
+ 'state': 'init',
+ }
+ def update_module(self, cr, uid, ids, context=None):
module_obj = self.pool.get('ir.module.module')
update, add = module_obj.update_list(cr, uid,)
- return {'update': update, 'add': add}
-
- _columns = {
- 'update': fields.integer('Number of modules updated', readonly=True),
- 'add': fields.integer('Number of modules added', readonly=True),
- }
+ self.write(cr, uid, ids, {'update': update, 'add': add, 'state': 'done'}, context=context)
+ return False
def action_module_open(self, cr, uid, ids, context):
- """
- Update Module List Open
-
- @param cr: the current row, from the database cursor.
- @param uid: the current user’s ID for security checks.
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
- """
res = {
'domain': str([]),
- 'name': 'Module List',
+ 'name': 'Modules',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'ir.module.module',
'view_id': False,
'type': 'ir.actions.act_window',
}
- view_obj = self.pool.get('ir.ui.view')
- search_view_id = view_obj.search(cr, uid, [('name','=','ir.module.module.list.select')], context=context)
- if search_view_id:
- res.update({'search_view_id' : search_view_id[0]})
return res
-base_module_update_open()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+base_module_update()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file