Accept Merge Request #327: (feature/修改机床参数bug -> develop)

Merge Request: 品牌备注增加

Created By: @龚启豪
Accepted By: @龚启豪
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/327?initial=true
This commit is contained in:
龚启豪
2023-08-18 14:39:39 +08:00
committed by Coding
3 changed files with 28 additions and 28 deletions

View File

@@ -27,9 +27,9 @@
<field name="arch" type="xml">
<tree string="品牌" create="0" edit="0" delete="0">
<field name="code"/>
<field name="name" string="名称"/>
<field name="name"/>
<field name="tag_ids" widget="many2many_tags" optional="hide"/>
<field name="image_brand"/>
<field name="remark"/>
</tree>
</field>
</record>

View File

@@ -45,13 +45,13 @@ class ResConfigSettings(models.TransientModel):
self.env['sf.cutting.tool.material'].sync_all_cutting_tool_material()
_logger.info("同步所有刀具物料完成")
_logger.info("同步所有刀具类型...")
self.env['sf.cutting.tool.type'].sync_all_tool_type()
_logger.info("同步所有刀具类型完成")
# self.env['sf.cutting.tool.type'].sync_all_tool_type()
# _logger.info("同步所有刀具类型完成")
_logger.info("定时同步所有功能刀具类型列表...")
self.env['sf.functional.cutting.tool.model'].sync_all_functional_cutting_tool_model()
_logger.info("同步所有功能刀具类型完成")
_logger.info("同步所有刀具型号...")
self.env['sf.cutting.tool.model'].sync_all_tool_model()
# self.env['sf.cutting.tool.model'].sync_all_tool_model()
_logger.info("同步所有刀具型号完成")
_logger.info("同步所有功能刀具列表...")
self.env['sf.functional.cutting.tool'].sync_all_functional_cutting_tool()

View File

@@ -528,14 +528,18 @@ class MachineBrand(models.Model):
brand.name = item['name'],
brand.code = item['code'],
brand.image_brand = '' if not item['image_brand'] else base64.b64encode(item.image_brand),
brand.active = item['active']
brand.manufacturer_model_number = item['manufacturer_model_number'],
brand.active = item['active'],
brand.remark = item['remark'],
else:
self.env['sf.machine.brand'].create({
"id": item['id'],
"name": item['name'],
"code": item['code'],
"image_brand": '' if not item['image_brand'] else base64.b64encode(item.image_brand),
"manufacturer_model_number": item['manufacturer_model_number'],
"active": item['active'],
"remark": item['remark'],
})
else:
@@ -562,6 +566,8 @@ class MachineBrand(models.Model):
"id": item['id'],
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"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
@@ -570,6 +576,7 @@ class MachineBrand(models.Model):
raise ValidationError("认证未通过")
class MachineToolType(models.Model):
_inherit = 'sf.machine_tool.type'
_description = '机床型号'
@@ -928,22 +935,19 @@ class MachineToolCategory(models.Model):
result = json.loads(r['result'])
if result['status'] == 1:
for item in result['machine_tool_category_yesterday_list']:
machine_tool_category = self.env['sf.machine_tool.category'].search(
brand = self.env['sf.machine_tool.category'].search(
[("code", '=', item['code'])])
if machine_tool_category:
machine_tool_category.name = item['name'],
machine_tool_category.code = item['code'],
machine_tool_category.category = item['category'],
machine_tool_category.remark = item['remark']
machine_tool_category.active = item['active']
if brand:
brand.name = item['name'],
brand.code = item['code'],
brand.category = item['category'],
brand.remark = item['remark']
else:
self.env['sf.machine_tool.category'].create({
"name": item['name'],
"code": item['code'],
"category": item['category'],
"remark": item['remark'],
"active": item['active'],
})
brand.name = item['name'],
brand.code = item['code'],
brand.category = item['category'],
brand.remark = item['remark']
else:
raise ValidationError("认证未通过")
@@ -1004,14 +1008,12 @@ class sfSyncCutting_tool_Material(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
brand.write({
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1039,14 +1041,12 @@ class sfSyncCutting_tool_Material(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
else:
brand.write({
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
"active": item['active'],
})
@@ -1266,7 +1266,6 @@ class SyncFunctionalCuttingToolModel(models.Model):
"name": item['name'],
"code": item['code'],
"remark": item['remark'],
})
else:
brand.write({
@@ -1496,6 +1495,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']),
@@ -1516,7 +1516,6 @@ class SyncFixtureModel(models.Model):
[('code', '=', item['apply_machine_tool_type_code'])]).id,
"through_hole_size": item['through_hole_size'],
"screw_size": item['screw_size'],
"active": item['active'],
})
else:
fixture_model.write({
@@ -1526,6 +1525,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']),
@@ -1546,7 +1546,6 @@ class SyncFixtureModel(models.Model):
[('code', '=', item['apply_machine_tool_type_code'])]).id,
"through_hole_size": item['through_hole_size'],
"screw_size": item['screw_size'],
"active": item['active'],
})
else:
raise ValidationError("认证未通过")
@@ -1578,6 +1577,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']),
@@ -1598,7 +1598,6 @@ class SyncFixtureModel(models.Model):
[('code', '=', item['apply_machine_tool_type_code'])]).id,
"through_hole_size": item['through_hole_size'],
"screw_size": item['screw_size'],
"active": item['active'],
})
else:
fixture_model.write({
@@ -1608,6 +1607,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']),