diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index 3296b127..8f5ffae7 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -119,12 +119,10 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { this.listherHeaderBodyNum() }) const treeModifiers = this.getFieldModifiers(this.props.archInfo.__rawArch); - // console.log('treeModifiers', treeModifiers); if(treeModifiers) { this.props.merge_key = treeModifiers.merge_key; this.props.merge_fields = treeModifiers.merge_fields.split(','); const data = this.setColumns(this.props.merge_key); - console.log('data', data); owl.onMounted(() => { this.mergeColumns(this.props.merge_fields, data) }) @@ -176,19 +174,28 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { } }, setColumns( merge_key) { + merge_key = merge_key.split(',') const data = this.props.list.records let sourceIndex = 0; - let sourceValue = '' + let sourceValue = merge_key.reduce((acc, key) => { + acc[key] = ''; + return acc; + }, {}); + data.forEach((item, index) => { if(!item.colspan) { item.colspan = 1; } - if(item.data[merge_key] === sourceValue) { + const itemValue = merge_key.reduce((acc, key) => { + acc[key] = item.data[key]; + return acc; + }, {}); + if(JSON.stringify(itemValue) == JSON.stringify(sourceValue)) { data[sourceIndex].colspan ++ ; item.colspan = 0; } else { sourceIndex = index; - sourceValue = item.data[merge_key]; + sourceValue = itemValue; } }) return data @@ -211,14 +218,25 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { const dom = this.tableRef.el const thead = $(dom).children('thead') const tbody = $(dom).children('tbody') + let row_no = 0 tbody.children('tr.o_data_row').each(function () { const tr = $(this) const td = tr.children('td') const index = $(this).index() + const col = data[index].colspan + row_no ++ + if(col == 0) { + row_no -- + } + td.eq(0).text(row_no).attr('rowspan', col) + + if(col == 0) { + td.eq(0).remove() + } td.each(function () { if(merge_fields.indexOf($(this).attr('name')) >= 0) { - $(this).attr('rowspan', data[index].colspan) - if(data[index].colspan == 0) { + $(this).attr('rowspan', col) + if(col == 0) { $(this).remove() } } diff --git a/quality_control/models/quality.py b/quality_control/models/quality.py index e7e8b196..8670005d 100644 --- a/quality_control/models/quality.py +++ b/quality_control/models/quality.py @@ -151,7 +151,8 @@ class QualityCheck(models.Model): if record.picking_id: total_qty = 0 for move in record.picking_id.move_ids_without_package: - total_qty += int(move.product_uom_qty) + if move.product_id == record.product_id: + total_qty = int(move.product_uom_qty) record.total_qty = total_qty if total_qty > 0 else '' else: record.total_qty = '' diff --git a/quality_control/static/src/scss/quality_dashboard.scss b/quality_control/static/src/scss/quality_dashboard.scss index 3668bce7..3a3dea62 100644 --- a/quality_control/static/src/scss/quality_dashboard.scss +++ b/quality_control/static/src/scss/quality_dashboard.scss @@ -4,3 +4,11 @@ min-height: 250px; } } + +.measureTableSequence { + width: 58px; +} + +.measureTable .o_list_table_ungrouped { + min-width: auto; +} \ No newline at end of file diff --git a/quality_control/views/quality.check.measures.line.xml b/quality_control/views/quality.check.measures.line.xml index 68cc4249..7134e86e 100644 --- a/quality_control/views/quality.check.measures.line.xml +++ b/quality_control/views/quality.check.measures.line.xml @@ -4,8 +4,8 @@ quality.check.measure.line.tree quality.check.measure.line - - + + diff --git a/sf_manufacturing/wizard/sale_order_cancel.py b/sf_manufacturing/wizard/sale_order_cancel.py index eda8a0b8..3834bd8e 100644 --- a/sf_manufacturing/wizard/sale_order_cancel.py +++ b/sf_manufacturing/wizard/sale_order_cancel.py @@ -208,6 +208,16 @@ class SFSaleOrderCancelLine(models.TransientModel): 'processing': '加工中', 'finished': '已完成', 'cancel': '已取消'} + + purchase_request_map_dict = { + 'draft': '草稿', + 'to_approve': '待批准', + 'approved': '已批准', + 'done': '已完成', + 'cancel': '已取消', + 'rejected': '已驳回', + 'in_progress': '处理中' + } module_name_dict = { 'purchase': '采购', @@ -471,12 +481,12 @@ class SFSaleOrderCancelLine(models.TransientModel): 'wizard_id': wizard_id, 'sequence': sequence, 'category': module_name_dict[purchase_request_line._original_module], - 'doc_name': purchase_request_line._description, + 'doc_name': purchase_request_line.request_id._description, 'doc_number': purchase_request_line.request_id.name, 'line_number': prl_count, 'product_name': f'[{purchase_request_line.product_id.default_code}] {purchase_request_line.product_id.name}', 'quantity': purchase_request_line.product_qty, - 'doc_state': map_dict.get(purchase_request_line.request_state, purchase_request_line.request_state), + 'doc_state': purchase_request_map_dict.get(purchase_request_line.request_state, purchase_request_line.request_state), 'cancel_reason': '已有异动' if purchase_request_line.request_state not in ['draft', 'cancel'] else '' } lines.append(self.create(vals)) diff --git a/sf_manufacturing/wizard/sale_order_cancel_views.xml b/sf_manufacturing/wizard/sale_order_cancel_views.xml index 6848faf6..034c0de2 100644 --- a/sf_manufacturing/wizard/sale_order_cancel_views.xml +++ b/sf_manufacturing/wizard/sale_order_cancel_views.xml @@ -13,7 +13,7 @@ - +