1.夹具物料,联装类型,功能夹具类型的Tree视图去掉删除方法和删除操作;同步的方法里新增active字段

2.品牌模型新增厂家型号字段
3.修复3D模型全屏展示及不显示模型Bug
This commit is contained in:
jinling.yang
2023-07-26 18:52:27 +08:00
parent 72b3e736c0
commit 7ee652d021
7 changed files with 20520 additions and 456 deletions

View File

@@ -524,15 +524,17 @@ class MachineBrand(models.Model):
brand.id = item['id'],
brand.name = item['name'],
brand.code = item['code'],
brand.image_brand = '' if not item['image_brand'] else base64.b64encode(item.image_brand),
brand.manufacturer_model_number = item['manufacturer_model_number'],
brand.active = item['active']
else:
self.env['sf.machine.brand'].create({
"id": item['id'],
"name": item['name'],
"code": item['code'],
# "image_brand": item['image_brand'],
"image_brand": '' if not item['image_brand'] else base64.b64encode(item.image_brand),
"manufacturer_model_number": item['manufacturer_model_number'],
"active": item['active'],
# "tag_ids": item['tag_ids']
})
else:
@@ -559,6 +561,7 @@ class MachineBrand(models.Model):
"id": item['id'],
"name": item['name'],
"code": item['code'],
"manufacturer_model_number": item['manufacturer_model_number'],
"image_brand": '' if not item['image_brand'] else base64.b64encode(item.image_brand),
"tag_ids": self.env['sf.machine.brand.tags'].search(
[("name", 'in', item['tag_ids'])]).ids
@@ -1439,12 +1442,16 @@ class SyncFixtureMaterial(models.Model):
self.env['sf.fixture.material'].create({
"name": item['name'],
"code": item['code'],
"category": item['category'],
"remark": item['remark'],
"active": item['active'],
})
else:
fixture_material.write({
"name": item['name'],
"category": item['category'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1471,12 +1478,16 @@ class SyncFixtureMaterial(models.Model):
self.env['sf.fixture.material'].create({
"name": item['name'],
"code": item['code'],
"category": item['category'],
"remark": item['remark'],
"active": item['active'],
})
else:
fixture_material.write({
"name": item['name'],
"category": item['category'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1488,7 +1499,7 @@ class SyncMulti_Mounting_Type(models.Model):
url = '/api/multi_mounting_type/list'
# 定时同步夹具物料列表
# 定时同步联装类型列表
def sync_multi_mounting_type(self):
sf_sync_config = self.env['res.config.settings'].get_values()
token = sf_sync_config['token']
@@ -1510,16 +1521,18 @@ class SyncMulti_Mounting_Type(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
multi_mounting_type.write({
"name": item['name'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
# 定时同步所有夹具物料列表
# 定时同步所有联装类型列表
def sync_all_multi_mounting_type(self):
sf_sync_config = self.env['res.config.settings'].get_values()
token = sf_sync_config['token']
@@ -1542,11 +1555,13 @@ class SyncMulti_Mounting_Type(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
multi_mounting_type.write({
"name": item['name'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1584,6 +1599,7 @@ class SyncFixtureModel(models.Model):
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
[('code', '=', item['multi_mounting_type_code'])]).id,
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
"manufacturer_model_number": item['manufacturer_model_number'],
"clamping_way": item['clamping_way'],
"port_type": item['port_type'],
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
@@ -1613,6 +1629,7 @@ class SyncFixtureModel(models.Model):
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
[('code', '=', item['multi_mounting_type_code'])]).id,
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
"manufacturer_model_number": item['manufacturer_model_number'],
"clamping_way": item['clamping_way'],
"port_type": item['port_type'],
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
@@ -1664,6 +1681,7 @@ class SyncFixtureModel(models.Model):
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
[('code', '=', item['multi_mounting_type_code'])]).id,
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
"manufacturer_model_number": item['manufacturer_model_number'],
"clamping_way": item['clamping_way'],
"port_type": item['port_type'],
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
@@ -1693,6 +1711,7 @@ class SyncFixtureModel(models.Model):
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
[('code', '=', item['multi_mounting_type_code'])]).id,
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
"manufacturer_model_number": item['manufacturer_model_number'],
"clamping_way": item['clamping_way'],
"port_type": item['port_type'],
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
@@ -1746,11 +1765,13 @@ class SyncFunctionalFixtureType(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
functional_fixture_type.write({
"name": item['name'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1777,11 +1798,14 @@ class SyncFunctionalFixtureType(models.Model):
self.env['sf.functional.fixture.type'].create({
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
functional_fixture_type.write({
"name": item['name'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")