From 6dd2580e21b9e942877cea815a047d846bd50d57 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 1 Feb 2024 16:22:42 +0100 Subject: [PATCH] [FIX] runbot: fix various js issues for 17.0 --- runbot/static/src/js/fields/fields.js | 4 ++-- runbot/static/src/js/fields/tracking_value.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/runbot/static/src/js/fields/fields.js b/runbot/static/src/js/fields/fields.js index e6e16a02..169f082e 100644 --- a/runbot/static/src/js/fields/fields.js +++ b/runbot/static/src/js/fields/fields.js @@ -67,11 +67,11 @@ export class FrontendUrl extends Component {
`; - static components = { Many2OneField } + static components = { Many2OneField }; get route() { const model = this.props.relation || this.props.record.fields[this.props.name].relation; - const id = this.props.value[0]; + const id = this.props.record.data[this.props.name][0]; if (model.startsWith('runbot.') ) { return '/runbot/' + model.split('.')[1] + '/' + id; } else { diff --git a/runbot/static/src/js/fields/tracking_value.js b/runbot/static/src/js/fields/tracking_value.js index 47312046..58fff6a2 100644 --- a/runbot/static/src/js/fields/tracking_value.js +++ b/runbot/static/src/js/fields/tracking_value.js @@ -11,10 +11,9 @@ patch(Message.prototype, { console.log(trackingValue) const oldValue = trackingValue.oldValue.value; const newValue = trackingValue.newValue.value; - return ((oldValue && oldValue.includes('\n')) && (newValue && newValue.includes('\n'))) + return ((oldValue && typeof oldValue=== 'string' && oldValue.includes('\n')) && (newValue && typeof oldValue=== 'string' && newValue.includes('\n'))) }, formatTracking(trackingType, trackingValue) { - console.log('aaa') return super.formatTracking(trackingType, trackingValue) }, toggleKept() {