1.同步刀具标准库接口修改刀片形状,柄部类型,刀尖特征,压紧方式
This commit is contained in:
@@ -217,3 +217,16 @@ class MaintenanceStandardImage(models.Model):
|
||||
new_res.append([id, name, data_uri])
|
||||
# 返回新的结果列表
|
||||
return new_res
|
||||
|
||||
@api.model
|
||||
def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None):
|
||||
# 调用原生的search_read方法获取记录
|
||||
records = super(MaintenanceStandardImage, self).search_read(domain, fields, offset, limit, order)
|
||||
# 遍历每条记录,添加image数据
|
||||
for record in records:
|
||||
image_field = self.browse(record['id']).image
|
||||
if image_field:
|
||||
record['image'] = f"data:image/png;base64,{image_field.decode('utf-8')}"
|
||||
else:
|
||||
record['image'] = ""
|
||||
return records
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
</group>
|
||||
<group string="压紧方式"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}">
|
||||
<field name="compaction_way_ids" string="" widget="many2one_radio"/>
|
||||
<field name="compaction_way_id" string="" widget="many2one_radio"/>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀片'))]}">
|
||||
|
||||
Reference in New Issue
Block a user