准备前端开发用结构

This commit is contained in:
mgw
2025-03-12 09:08:41 +08:00
parent 78738ed8aa
commit de1bdbe18b
3 changed files with 21 additions and 14 deletions

View File

@@ -147,14 +147,22 @@ class QualityCheck(models.Model):
measure_line_ids = fields.One2many('quality.check.measure.line', 'check_id', string='测量明细')
def add_measure_line(self):
'''
"""
新增测量值,如果测量值有5列了则提示“最多只能有5列测量值”
'''
self.ensure_one()
self.env['quality.check.measure.line'].create({
'check_id': self.id,
'sequence': len(self.measure_line_ids) + 1,
})
"""
pass
# self.ensure_one()
# self.env['quality.check.measure.line'].create({
# 'check_id': self.id,
# 'sequence': len(self.measure_line_ids) + 1,
# })
def remove_measure_line(self):
"""
删除测量值
"""
pass
# self.ensure_one()
@depends('product_id')
def _compute_part_name_number(self):
@@ -606,5 +614,3 @@ class QualityCheckMeasureLine(models.Model):
def del_measure_value(self):
self.ensure_one()
self.sudo().unlink()

View File

@@ -14,7 +14,7 @@
<field name="measure_value5"/>
<field name="measure_result"/>
<field name="remark"/>
<button name="del_measure_value" type="object" string="删除测量值" class="btn-danger"/>
<!-- <button name="del_measure_value" type="object" string="删除测量值" class="btn-danger"/> -->
</tree>
</field>
</record>

View File

@@ -328,6 +328,7 @@
<page string="测量" name="measure" attrs="{'invisible': [('is_out_check', '=', False)]}">
<div class="o_row">
<button name="add_measure_line" type="object" class="btn-primary" string="添加测量值"/>
<button name="remove_measure_line" type="object" class="btn-primary" string="删除测量值"/>
<button name="%(quality_control.import_complex_model_wizard)d" string="上传"
type="action"
class="btn-primary"