From 508d257bcf83dfff0606f5a69cfc9f22e3447ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 30 Mar 2012 14:59:00 +0200 Subject: [PATCH 1/3] [IMP] Renamed ir.ui.menu fields, uses_needaction -> needaction_enabled; needaction_uid_ctr -> needaction_counter bzr revid: tde@openerp.com-20120330125900-0jtpztxk336ugae0 --- openerp/addons/base/ir/ir_ui_menu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index 205d44b0363..01d420d943d 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -265,8 +265,8 @@ class ir_ui_menu(osv.osv): menu_needaction_res = osv.osv.get_needaction_info(cr, uid, menu.action.res_model, uid, domain=menu.action.domain, context=context) else: menu_needaction_res = [False, 0] - res[menu.id]['uses_needaction'] = menu_needaction_res[0] - res[menu.id]['needaction_uid_ctr'] = menu_needaction_res[1] + res[menu.id]['needaction_enabled'] = menu_needaction_res[0] + res[menu.id]['needaction_counter'] = menu_needaction_res[1] return res _columns = { @@ -285,8 +285,8 @@ class ir_ui_menu(osv.osv): 'web_icon_hover':fields.char('Web Icon File (hover)', size=128), 'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', readonly=True, store=True, multi='icon'), 'web_icon_hover_data':fields.function(_get_image_icon, string='Web Icon Image (hover)', type='binary', readonly=True, store=True, multi='icon'), - 'uses_needaction': fields.function(_get_needaction, string='Related model uses the need action mechanism', type='boolean', help='If the menu entry is related to a act_window action, and this action is related to a model that uses the need_action mechanism, this field is set to true. Otherwise, it is false.', multi='_get_needaction'), - 'needaction_uid_ctr': fields.function(_get_needaction, string='Number of actions the user has to perform', type='integer', help='If the related model uses the need action mechanism, this field gives the number of actions the current user has to perform.', multi='_get_needaction'), + 'needaction_enabled': fields.function(_get_needaction, string='Related model uses the need action mechanism', type='boolean', help='If the menu entry is related to a act_window action, and this action is related to a model that uses the need_action mechanism, this field is set to true. Otherwise, it is false.', multi='_get_needaction'),+ + 'needaction_counter': fields.function(_get_needaction, string='Number of actions the user has to perform', type='integer', help='If the related model uses the need action mechanism, this field gives the number of actions the current user has to perform.', multi='_get_needaction'), 'action': fields.function(_action, fnct_inv=_action_inv, type='reference', string='Action', selection=[ From 519ebfdd499ec03e68702e9b048c7096eb4ef28c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 30 Mar 2012 15:02:32 +0200 Subject: [PATCH 2/3] [FIX] removed a '+' that probably came from outerspace bzr revid: tde@openerp.com-20120330130232-u61vt96fl23ss69z --- openerp/addons/base/ir/ir_ui_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index 01d420d943d..219fa7a8702 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -285,7 +285,7 @@ class ir_ui_menu(osv.osv): 'web_icon_hover':fields.char('Web Icon File (hover)', size=128), 'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', readonly=True, store=True, multi='icon'), 'web_icon_hover_data':fields.function(_get_image_icon, string='Web Icon Image (hover)', type='binary', readonly=True, store=True, multi='icon'), - 'needaction_enabled': fields.function(_get_needaction, string='Related model uses the need action mechanism', type='boolean', help='If the menu entry is related to a act_window action, and this action is related to a model that uses the need_action mechanism, this field is set to true. Otherwise, it is false.', multi='_get_needaction'),+ + 'needaction_enabled': fields.function(_get_needaction, string='Related model uses the need action mechanism', type='boolean', help='If the menu entry is related to a act_window action, and this action is related to a model that uses the need_action mechanism, this field is set to true. Otherwise, it is false.', multi='_get_needaction'), 'needaction_counter': fields.function(_get_needaction, string='Number of actions the user has to perform', type='integer', help='If the related model uses the need action mechanism, this field gives the number of actions the current user has to perform.', multi='_get_needaction'), 'action': fields.function(_action, fnct_inv=_action_inv, type='reference', string='Action', From 0f09c8eb917500c95f91ecc51401b6058590d922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 30 Mar 2012 15:24:52 +0200 Subject: [PATCH 3/3] [REF] Refactoring: moved from base to ir; renamed from base.needaction->ir.needaction; updated files accordingly bzr revid: tde@openerp.com-20120330132452-ww57gzp8ggx1pfj2 --- openerp/addons/base/__init__.py | 1 - openerp/addons/base/__openerp__.py | 1 - openerp/addons/base/base_needaction_view.xml | 29 ------------------- openerp/addons/base/ir/__init__.py | 1 + openerp/addons/base/ir/ir.xml | 24 +++++++++++++++ .../ir_needaction.py} | 28 +++++++++--------- .../addons/base/security/ir.model.access.csv | 2 +- 7 files changed, 40 insertions(+), 46 deletions(-) delete mode 100644 openerp/addons/base/base_needaction_view.xml rename openerp/addons/base/{base_needaction.py => ir/ir_needaction.py} (90%) diff --git a/openerp/addons/base/__init__.py b/openerp/addons/base/__init__.py index af551e60c1e..16a61521fb4 100644 --- a/openerp/addons/base/__init__.py +++ b/openerp/addons/base/__init__.py @@ -25,7 +25,6 @@ import res import publisher_warranty import report import test -import base_needaction # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py index 67920c7239a..802a0510e28 100644 --- a/openerp/addons/base/__openerp__.py +++ b/openerp/addons/base/__openerp__.py @@ -40,7 +40,6 @@ ], 'update_xml': [ 'base_update.xml', - 'base_needaction_view.xml', 'ir/wizard/wizard_menu_view.xml', 'ir/ir.xml', 'ir/ir_config_parameter_view.xml', diff --git a/openerp/addons/base/base_needaction_view.xml b/openerp/addons/base/base_needaction_view.xml deleted file mode 100644 index 84f7612cac9..00000000000 --- a/openerp/addons/base/base_needaction_view.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - base.needaction_users_rel.tree - base.needaction_users_rel - tree - 10 - - - - - - - - - - - Need action relationships - base.needaction_users_rel - form - tree,form - - - - - - diff --git a/openerp/addons/base/ir/__init__.py b/openerp/addons/base/ir/__init__.py index 4a6bd3c614c..a2a4b999ed8 100644 --- a/openerp/addons/base/ir/__init__.py +++ b/openerp/addons/base/ir/__init__.py @@ -21,6 +21,7 @@ import ir_model import ir_sequence +import ir_needaction import ir_ui_menu import ir_ui_view import ir_default diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml index 6a845b35602..26af4365f58 100644 --- a/openerp/addons/base/ir/ir.xml +++ b/openerp/addons/base/ir/ir.xml @@ -661,6 +661,30 @@ + + + ir.needaction_users_rel.tree + ir.needaction_users_rel + tree + 10 + + + + + + + + + + + Need action relationships + ir.needaction_users_rel + form + tree,form + + + +