[IMP] iap: Link to the IAP Portal from each service setting

Purpose of this task is, the current link to the IAP portal is very
well hidden in the general settings, so we are confident most users
won't find it.

So in this commit, we added 'View my Services' link below the
'Buy credits' in various IAP settings like: crm, account
and settings.

closes odoo/odoo#57063

Taskid: 2157984
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Nisha patel
2020-09-11 10:47:13 +00:00
committed by Barad Mahendra
parent 423f0c7148
commit e51c341aa0
2 changed files with 15 additions and 1 deletions
@@ -31,6 +31,7 @@ var IAPBuyMoreCreditsWidget = Widget.extend({
this.$buyLink = this.$widget.find('.buy_credits');
this.$widget.appendTo(this.$el);
this.$buyLink.click(this._getLink.bind(this));
this.el.querySelector('.o_iap_view_my_services').addEventListener('click', this._getMyServices.bind(this));
},
//--------------------------------------------------------------------------
@@ -51,6 +52,18 @@ var IAPBuyMoreCreditsWidget = Widget.extend({
});
});
},
/**
* @private
*/
_getMyServices() {
return this._rpc({
model: 'iap.account',
method: 'get_account_url',
}).then(url => {
this.do_action({type: 'ir.actions.act_url', url: url});
});
},
});
widgetRegistry.add('iap_buy_more_credits', IAPBuyMoreCreditsWidget);
+2 -1
View File
@@ -24,7 +24,8 @@
<div t-name="iap.buy_more_credits" class="mt-2 row">
<div class="col-sm">
<button class="btn btn-link buy_credits"><i class="fa fa-arrow-right"/> Buy credits</button>
<button class="btn btn-link buy_credits px-0"><i class="fa fa-arrow-right"/> Buy credits</button><br/>
<button class="btn btn-link o_iap_view_my_services px-0"><i class="fa fa-arrow-right mr-1"/>View My Services</button>
</div>
</div>
</template>