From e67890b3b0a723b87a4c093f2d33b4ac3592d120 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 18 Apr 2010 22:07:32 +0200 Subject: [PATCH] [IMP] better view, no NULL value for int and float bzr revid: fp@tinyerp.com-20100418200732-l2vzf71xf8tpj34r --- bin/addons/base/__terp__.py | 2 +- bin/addons/base/base_menu.xml | 20 +++-- bin/addons/base/base_update.xml | 64 ++++++++-------- bin/addons/base/ir/ir.xml | 78 ++++++++++++-------- bin/addons/base/ir/ir_actions.py | 9 ++- bin/addons/base/ir/ir_sequence.py | 2 +- bin/addons/base/res/ir_property_view.xml | 45 ++++++----- bin/addons/base/res/partner/partner_view.xml | 5 +- bin/addons/base/res/res_config.py | 15 ++-- bin/osv/fields.py | 6 +- 10 files changed, 140 insertions(+), 106 deletions(-) diff --git a/bin/addons/base/__terp__.py b/bin/addons/base/__terp__.py index 533441816f8..3f50b319692 100644 --- a/bin/addons/base/__terp__.py +++ b/bin/addons/base/__terp__.py @@ -30,8 +30,8 @@ 'depends': [], 'init_xml': [ 'base_data.xml', - 'base_menu.xml', 'security/base_security.xml', + 'base_menu.xml', 'res/res_security.xml', 'res/res_config.xml', 'maintenance/maintenance_security.xml', diff --git a/bin/addons/base/base_menu.xml b/bin/addons/base/base_menu.xml index 0b85b6a49f8..fcbd9611498 100644 --- a/bin/addons/base/base_menu.xml +++ b/bin/addons/base/base_menu.xml @@ -2,17 +2,25 @@ - - + + - + - + - - + + diff --git a/bin/addons/base/base_update.xml b/bin/addons/base/base_update.xml index 2f20199a4d8..17952ea0146 100644 --- a/bin/addons/base/base_update.xml +++ b/bin/addons/base/base_update.xml @@ -76,20 +76,20 @@
- - - - - - - - - + + + + + + + + +
@@ -113,10 +113,14 @@ - - - - + + + + + + + + @@ -165,9 +169,11 @@ form
- - - + + + + + @@ -177,13 +183,10 @@ - - - - + - + @@ -307,17 +310,12 @@ new - - - - - - 10 + never + done - 1 diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml index 3888bebbebb..6f7b297ddc9 100644 --- a/bin/addons/base/ir/ir.xml +++ b/bin/addons/base/ir/ir.xml @@ -106,9 +106,9 @@ - + - + @@ -191,7 +191,9 @@ tree,form - + @@ -434,6 +436,7 @@ @@ -443,8 +446,10 @@ [('parent_id','=',False)] tree - - + Companies ir.actions.act_window @@ -534,7 +539,9 @@ tree - + Roles @@ -914,18 +921,35 @@ + + Translations + ir.translation + search + + + + + + + + + + + Translations ir.translation form - - - - - - + + + + + + @@ -945,20 +969,12 @@ - All terms + Translation Terms ir.translation form - - Untranslated terms - ir.translation - form - - ['|',('value', '=', False),('value','=','')] - - + + ir.property.search + ir.property + search + + + + + + + + + ir.property.form ir.property form -
+ - + - +
@@ -22,33 +39,21 @@ ir.property tree - + - + - - Default Properties - ir.actions.act_window - ir.property - form - [('res_id','=',False)] - - - - - - - All Properties + Configuration Parameters ir.actions.act_window ir.property form - - + +
diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index ccbd3bc79f7..90d3ef1a483 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -320,7 +320,7 @@ - + @@ -552,7 +552,7 @@
- + @@ -567,7 +567,6 @@ - diff --git a/bin/addons/base/res/res_config.py b/bin/addons/base/res/res_config.py index 2885a4059cf..68a5a383cbb 100644 --- a/bin/addons/base/res/res_config.py +++ b/bin/addons/base/res/res_config.py @@ -40,9 +40,7 @@ class res_config_configurable(osv.osv_memory): total = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [], context) open = self.pool.get('ir.actions.todo')\ - .search_count(cr, uid, [('active','=',True), - ('state','<>','open')], - context) + .search_count(cr, uid, [('state','<>','open')], context) if total: return round(open*100./total) return 100. @@ -58,8 +56,7 @@ class res_config_configurable(osv.osv_memory): todos = self.pool.get('ir.actions.todo') self.logger.notifyChannel('actions', netsvc.LOG_INFO, 'getting next %s' % todos) - active_todos = todos.search(cr, uid, [('state','=','open'), - ('active','=',True)], + active_todos = todos.search(cr, uid, [('state','=','open')], limit=1) if active_todos: return todos.browse(cr, uid, active_todos[0], context=None) @@ -111,6 +108,13 @@ class res_config_configurable(osv.osv_memory): return self.pool.get(current_user_menu.type)\ .read(cr, uid, current_user_menu.id) + def start(self, cr, uid, ids, context=None): + ids2 = self.pool.get('ir.actions.todo').search(cr, uid, [], context=context) + for todo in self.pool.get('ir.actions.todo').browse(cr, uid, ids2, context=context): + if (todo.restart=='always') or (todo.restart=='onskip' and (todo.state in ('skip','cancel'))): + todo.write({'state':'open'}) + return self.next(cr, uid, ids, context) + def next(self, cr, uid, ids, context=None): """ Returns the next todo action to execute (using the default sort order) @@ -183,6 +187,7 @@ class res_config_configurable(osv.osv_memory): next = self.cancel(cr, uid, ids, context=None) if next: return next return self.next(cr, uid, ids, context=context) + res_config_configurable() class res_config_installer(osv.osv_memory): diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 283d1c958b1..93b318efbcf 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -119,23 +119,23 @@ class boolean(_column): _symbol_f = lambda x: x and 'True' or 'False' _symbol_set = (_symbol_c, _symbol_f) - class integer_big(_column): _type = 'integer_big' _symbol_c = '%s' _symbol_f = lambda x: int(x or 0) _symbol_set = (_symbol_c, _symbol_f) + _symbol_get = lambda self,x: x or 0 class integer(_column): _type = 'integer' _symbol_c = '%s' _symbol_f = lambda x: int(x or 0) _symbol_set = (_symbol_c, _symbol_f) + _symbol_get = lambda self,x: x or 0 class reference(_column): _type = 'reference' - def __init__(self, string, selection, size, **args): _column.__init__(self, string=string, size=size, selection=selection, **args) @@ -173,6 +173,7 @@ class float(_column): _symbol_c = '%s' _symbol_f = lambda x: __builtin__.float(x or 0.0) _symbol_set = (_symbol_c, _symbol_f) + _symbol_get = lambda self,x: x or 0.0 def __init__(self, string='unknown', digits=None, digits_compute=None, **args): _column.__init__(self, string=string, **args) @@ -197,7 +198,6 @@ class datetime(_column): class time(_column): _type = 'time' - class binary(_column): _type = 'binary' _symbol_c = '%s'