mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: manage falsy value for frontend_url
This commit is contained in:
parent
e27a1b8f71
commit
903ee7d983
@ -512,7 +512,7 @@ class Runbot(Controller):
|
||||
('slot_ids.batch_id.bundle_id', '=', bundle_id),
|
||||
('params_id.trigger_id', '=', trigger.id),
|
||||
]
|
||||
builds = request.env['runbot.build']
|
||||
builds = request.env['runbot.build'].with_context(active_test=False)
|
||||
if center_build_id:
|
||||
builds = builds.search(
|
||||
expression.AND([builds_domain, [('id', '>=', center_build_id)]]),
|
||||
|
@ -42,13 +42,21 @@ var FrontendUrl = relational_fields.FieldMany2One.extend({
|
||||
events: _.extend({'click .external_link': '_stopPropagation'}, relational_fields.FieldMany2One.prototype.events),
|
||||
init() {
|
||||
this._super.apply(this, arguments);
|
||||
const model = this.value.model.split('.').slice(1).join('_')
|
||||
const res_id = this.value.res_id
|
||||
this.route = '/runbot/' + model+ '/' + res_id
|
||||
if (this.value) {
|
||||
const model = this.value.model.split('.').slice(1).join('_');
|
||||
const res_id = this.value.res_id;
|
||||
this.route = '/runbot/' + model+ '/' + res_id;
|
||||
} else {
|
||||
this.route = false;
|
||||
}
|
||||
},
|
||||
_renderReadonly: function () {
|
||||
this._super.apply(this, arguments);
|
||||
this.$el.html('<span>' + this.$el.html() + ' <a href="'+this.route+'" ><i class="external_link fa fa-fw o_button_icon fa-external-link "/></a><span>')
|
||||
var link = ''
|
||||
if (this.route) {
|
||||
link = ' <a href="'+this.route+'" ><i class="external_link fa fa-fw o_button_icon fa-external-link "/></a>'
|
||||
}
|
||||
this.$el.html('<span>' + this.$el.html() + link + '<span>')
|
||||
},
|
||||
_stopPropagation: function(event) {
|
||||
event.stopPropagation()
|
||||
|
Loading…
Reference in New Issue
Block a user