diff --git a/quality_control/static/src/js/quality.check.measures.line.js b/quality_control/static/src/js/quality.check.measures.line.js index 3a19db67..5e8d2f14 100644 --- a/quality_control/static/src/js/quality.check.measures.line.js +++ b/quality_control/static/src/js/quality.check.measures.line.js @@ -31,6 +31,7 @@ patch(ListRenderer.prototype, 'custom_measure_line_tree_patch', { setTimeout(() => { const $dom = $(this.__owl__.bdom.el) const $thead = $dom.find('thead').find('th'); + if(!this.props.list.records || this.props.list.records.length == 0) return const $total_qty = this.props.list.records[0].data.column_nums; const hideKey = [] const width = $dom.find('[data-name=measure_value1]').width(); @@ -48,8 +49,8 @@ patch(ListRenderer.prototype, 'custom_measure_line_tree_patch', { return `[data-name="${_}"],[name="${_}"]` }) $dom.find(hideDom.join(',')).hide() - const $cloNum = $dom.find('.o_data_row').children('td:visible').length; - $dom.find('.o_data_row').siblings('tr').children('td').prop('colspan', $cloNum); + const $cloNum = $dom.find('.o_data_row').eq(0).children('td:visible').length; + $dom.find('.o_data_row').siblings('tr:not(.o_data_row)').children('td').prop('colspan', $cloNum); $dom.find('tfoot').hide() }, 50); })