[FIX] correct actions
bzr revid: mat@openerp.com-20130416134847-celf4nbl7748vnj5
This commit is contained in:
parent
0b0c24a636
commit
b2bb03ba4a
|
@ -357,21 +357,9 @@ class gamification_goal(osv.Model):
|
|||
In case of a manual goal, should return a wizard to update the value
|
||||
:return: action description in a dictionnary
|
||||
"""
|
||||
print("get_action")
|
||||
goal = self.browse(cr, uid, goal_id, context=context)
|
||||
if goal.type_id.action_id:
|
||||
action_obj = goal.type_id.action_id
|
||||
action = {
|
||||
'name': action_obj.name,
|
||||
'view_type': action_obj.view_type,
|
||||
'view_mode': action_obj.view_mode,
|
||||
'res_model': action_obj.res_model,
|
||||
'domain': action_obj.domain,
|
||||
'context': action_obj.context,
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': action_obj.search_view_id.id,
|
||||
'views': [(v.view_id.id, v.view_mode) for v in action_obj.view_ids]
|
||||
}
|
||||
action = goal.type_id.action_id.read()[0]
|
||||
|
||||
if goal.type_id.res_id_field:
|
||||
current_user = self.pool.get('res.users').browse(cr, uid, uid, context)
|
||||
|
@ -381,9 +369,14 @@ class gamification_goal(osv.Model):
|
|||
for field_name in field_names[1:]:
|
||||
res = res.__getitem__(field_name)
|
||||
action['res_id'] = res
|
||||
action['view_mode'] = 'form' # if one element to display, should see it in form mode
|
||||
|
||||
# if one element to display, should see it in form mode if possible
|
||||
views = action['views']
|
||||
for (view_id, mode) in action['views']:
|
||||
if mode == "form":
|
||||
views = [(view_id, mode)]
|
||||
action['views'] = views
|
||||
action['target'] = 'new'
|
||||
print(action)
|
||||
return action
|
||||
|
||||
if goal.computation_mode == 'manually':
|
||||
|
|
|
@ -155,7 +155,7 @@ openerp.gamification = function(instance) {
|
|||
"#ff0000",
|
||||
"#f9c802",
|
||||
"#a9d70b"
|
||||
],
|
||||
]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -23,8 +23,6 @@ from openerp import addons
|
|||
import logging
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import tools
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class hr_employee_category(osv.osv):
|
||||
|
|
|
@ -40,9 +40,9 @@ class hr_config_settings(osv.osv_memory):
|
|||
help ="""This installs the module hr_recruitment."""),
|
||||
'module_hr_contract': fields.boolean('Record contracts per employee',
|
||||
help ="""This installs the module hr_contract."""),
|
||||
'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation and goals',
|
||||
'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation',
|
||||
help ="""This installs the module hr_evaluation."""),
|
||||
'module_hr_gamification': fields.boolean('Manage badges',
|
||||
'module_hr_gamification': fields.boolean('Drive engagement with challenges and badges',
|
||||
help ="""This installs the module hr_gamification."""),
|
||||
'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (the sale application will be installed)',
|
||||
help ="""This installs the module account_analytic_analysis, which will install sales management too."""),
|
||||
|
|
|
@ -34,6 +34,5 @@ Badge received are displayed on the user profile.
|
|||
'security/ir.model.access.csv',
|
||||
'gamification_view.xml',
|
||||
],
|
||||
'auto_install': True,
|
||||
'js': ['static/src/js/gamification.js'],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue