[ADD] action to create new users

bzr revid: mat@openerp.com-20130422142811-yle27izd3zhre2c0
This commit is contained in:
Martin Trigaux
2013-04-22 16:28:11 +02:00
parent c76b9fb8e8
commit 021c8de63f
3 changed files with 14 additions and 1 deletions
+1
View File
@@ -385,6 +385,7 @@ class gamification_goal(osv.Model):
for (view_id, mode) in action['views']:
if mode == "form":
views = [(view_id, mode)]
break
action['views'] = views
action['target'] = 'new'
return action
+13
View File
@@ -46,6 +46,18 @@
<field name="res_id_field">company_id.id</field>
</record>
<record id="action_new_simplified_res_users" model="ir.actions.act_window">
<field name="name">New User</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="view_type">form</field>
<field name="target">new</field>
<field name="view_id" ref="base.view_users_simple_form"/>
<field name="context">{'default_groups_ref': ['base.group_user']}</field>
<field name="help">Create and manage users that will connect to the system. Users can be deactivated should there be a period of time during which they will/should not connect to the system. You can assign them groups in order to give them specific access to the applications they need to use in the system.</field>
</record>
<record model="gamification.goal.type" id="type_base_invite">
<field name="name">Invite new Users</field>
<field name="description">Create at least another user</field>
@@ -53,6 +65,7 @@
<field name="computation_mode">count</field>
<field name="model_id" eval="ref('base.model_res_users')" />
<field name="domain">[('id', '!=', user_id)]</field>
<field name="action_id" eval="ref('action_new_simplified_res_users')" />
</record>
@@ -50,7 +50,6 @@ openerp.gamification = function(instance) {
$.when(plan_action).done(function() {
var action_manager = new instance.web.ActionManager(this);
action_manager.do_action(plan_action.action).done(function () {
console.log(plan_action.action);
self.get_goal_todo_info();
});
});