Accept Merge Request #2100: (feature/6694 -> develop)

Merge Request: 人工线下返工在不选择重新编程时复制加工图纸

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2100?initial=true
This commit is contained in:
胡尧
2025-05-08 21:22:21 +08:00
committed by Coding
4 changed files with 35 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="mrp_production_inherited_form_purchase_request" model="ir.ui.view">
<record id="stock_pikcing_inherited_form_jikimo_purchase_request" model="ir.ui.view">
<field name="name">stock.pikcing.inherited.form.jikimo.purchase.request</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>

View File

@@ -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(

View File

@@ -156,3 +156,31 @@ class QualityCheck(models.Model):
qty_test_failed = fields.Float('不合格数')
qty_to_test = fields.Float('应检', store=True)
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': '不合格数量不能超过已检数量'
}
}

View File

@@ -96,6 +96,7 @@
</xpath>
<xpath expr="//field[@name='qty_line']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="on_change">1</attribute>
</xpath>
<xpath expr="//label[@for='qty_to_test']" position="attributes">
<attribute name="attrs">{'invisible': ['|', '&amp;', ('move_line_id', '=', False), ('workorder_id', '=', False), '|', ('measure_on', '!=', 'move_line'), ('is_lot_tested_fractionally', '=', False)]}</attribute>
@@ -105,13 +106,14 @@
</xpath>
<xpath expr="//field[@name='qty_to_test']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="on_change">1</attribute>
</xpath>
<xpath expr="//div[@class='o_row'][.//field[@name='qty_tested']]" position="after">
<label for="qty_test_failed"
attrs="{'invisible': ['|', ('measure_on', '!=', 'move_line'), ('is_lot_tested_fractionally', '=', False)]}"/>
<div class="o_row"
attrs="{'invisible': ['|', ('measure_on', '!=', 'move_line'), ('is_lot_tested_fractionally', '=', False)]}">
<field name="qty_test_failed" attrs="{'readonly': [('quality_state', '!=', 'none')]}"/>
<field name="qty_test_failed" attrs="{'readonly': [('quality_state', '!=', 'none')], 'on_chnage': 1}"/>
<field name="uom_id"/>
</div>
</xpath>