diff --git a/jikimo_purchase_request/views/stock_picking_views.xml b/jikimo_purchase_request/views/stock_picking_views.xml index 25c11a1b..b96aea0c 100644 --- a/jikimo_purchase_request/views/stock_picking_views.xml +++ b/jikimo_purchase_request/views/stock_picking_views.xml @@ -1,6 +1,6 @@ - + stock.pikcing.inherited.form.jikimo.purchase.request stock.picking diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py index b6b657c1..cc3f5fb2 100644 --- a/sf_manufacturing/wizard/rework_wizard.py +++ b/sf_manufacturing/wizard/rework_wizard.py @@ -268,6 +268,8 @@ class ReworkWizard(models.TransientModel): 'cmm_ids': new_cnc_workorder.cmm_ids.sudo()._json_cmm_program( cnc_work.processing_panel, ret), 'cnc_worksheet': old_cnc_rework.cnc_worksheet}) + # 复制装夹图纸 + new_cnc_workorder.processing_drawing = old_cnc_rework.processing_drawing # ========== 处理装夹预调 【装夹图纸】 数据 ================ for new_pre_work in new_pre_workorder_ids: pre_rework = max(self.production_id.workorder_ids.filtered( diff --git a/sf_quality/models/quality.py b/sf_quality/models/quality.py index 8ef2e3a9..d05d2eaa 100644 --- a/sf_quality/models/quality.py +++ b/sf_quality/models/quality.py @@ -155,4 +155,32 @@ class QualityCheck(models.Model): qty_line = fields.Float('数量', store=True) qty_test_failed = fields.Float('不合格数') qty_to_test = fields.Float('应检', store=True) - qty_tested = fields.Float('已检') \ No newline at end of file + qty_tested = fields.Float('已检') + + @api.onchange('qty_line', 'qty_test_failed', 'qty_to_test', 'qty_tested') + def _onchage_qty(self): + for record in self: + if record.qty_line and record.qty_to_test and record.qty_to_test > record.qty_line: + record.qty_to_test = record.qty_line + return { + 'warning': { + 'title': '警告', + 'message': '待检数量不能超过总数量' + } + } + if record.qty_to_test and record.qty_tested and record.qty_tested > record.qty_to_test: + record.qty_tested = record.qty_to_test + return { + 'warning': { + 'title': '警告', + 'message': '已检数量不能超过待检数量' + } + } + if record.qty_tested and record.qty_test_failed and record.qty_test_failed > record.qty_tested: + record.qty_test_failed = record.qty_tested + return { + 'warning': { + 'title': '警告', + 'message': '不合格数量不能超过已检数量' + } + } \ No newline at end of file diff --git a/sf_quality/views/quality_check_view.xml b/sf_quality/views/quality_check_view.xml index 6deb8eb9..655cc498 100644 --- a/sf_quality/views/quality_check_view.xml +++ b/sf_quality/views/quality_check_view.xml @@ -96,6 +96,7 @@ 0 + 1 {'invisible': ['|', '&', ('move_line_id', '=', False), ('workorder_id', '=', False), '|', ('measure_on', '!=', 'move_line'), ('is_lot_tested_fractionally', '=', False)]} @@ -105,13 +106,14 @@ 0 + 1