From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- .../hr_gamification/static/src/js/gamification.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 addons/hr_gamification/static/src/js/gamification.js (limited to 'addons/hr_gamification/static/src') diff --git a/addons/hr_gamification/static/src/js/gamification.js b/addons/hr_gamification/static/src/js/gamification.js new file mode 100644 index 00000000..32c0fdba --- /dev/null +++ b/addons/hr_gamification/static/src/js/gamification.js @@ -0,0 +1,31 @@ +odoo.define('hr_gamification.hr_gamification', function(require) { +"use strict"; + +var KanbanRecord = require('web.KanbanRecord'); + +KanbanRecord.include({ + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * @override + * @private + */ + _openRecord: function () { + if (this.modelName === 'gamification.badge.user') { + var action = { + type: 'ir.actions.act_window', + res_model: 'gamification.badge', + view_mode: 'form', + views: [[false, 'form']], + res_id: this.record.badge_id.raw_value + }; + this.do_action(action); + } else { + this._super.apply(this, arguments); + } + } +}); + +}); -- cgit v1.2.3