Accept Merge Request #1034: (feature/制造代码优化 -> develop)
Merge Request: 优化同步代码 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1034?initial=true
This commit is contained in:
@@ -2116,19 +2116,21 @@ class CuttingSpeed(models.Model):
|
||||
for item in result['feed_per_tooth_all_list']:
|
||||
feed_per_tooth = self.search([("name", '=', item['name']), ('active', 'in', [True, False])])
|
||||
if not feed_per_tooth:
|
||||
self.create({
|
||||
'name': item['name'],
|
||||
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
||||
[('code', '=', item['standard_library_code'].replace("JKM", result[
|
||||
'factory_short_name']))]).id,
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_type_code'])]).id,
|
||||
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
|
||||
[('name', '=', item['cutting_width_depth'])]).id,
|
||||
'blade_diameter': item['blade_diameter'],
|
||||
'feed_per_tooth': item['feed_per_tooth'],
|
||||
'active': item['active'],
|
||||
})
|
||||
_logger.info("item[standard_library_code] %s" % item.get('standard_library_code'))
|
||||
if item.get('standard_library_code'):
|
||||
self.create({
|
||||
'name': item['name'],
|
||||
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
||||
[('code', '=', item['standard_library_code'].replace("JKM", result[
|
||||
'factory_short_name']))]).id,
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_type_code'])]).id,
|
||||
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
|
||||
[('name', '=', item['cutting_width_depth'])]).id,
|
||||
'blade_diameter': item['blade_diameter'],
|
||||
'feed_per_tooth': item['feed_per_tooth'],
|
||||
'active': item['active'],
|
||||
})
|
||||
else:
|
||||
feed_per_tooth.write({
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
|
||||
Reference in New Issue
Block a user