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']:
|
for item in result['feed_per_tooth_all_list']:
|
||||||
feed_per_tooth = self.search([("name", '=', item['name']), ('active', 'in', [True, False])])
|
feed_per_tooth = self.search([("name", '=', item['name']), ('active', 'in', [True, False])])
|
||||||
if not feed_per_tooth:
|
if not feed_per_tooth:
|
||||||
self.create({
|
_logger.info("item[standard_library_code] %s" % item.get('standard_library_code'))
|
||||||
'name': item['name'],
|
if item.get('standard_library_code'):
|
||||||
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
self.create({
|
||||||
[('code', '=', item['standard_library_code'].replace("JKM", result[
|
'name': item['name'],
|
||||||
'factory_short_name']))]).id,
|
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
||||||
'materials_type_id': self.env['sf.materials.model'].search(
|
[('code', '=', item['standard_library_code'].replace("JKM", result[
|
||||||
[('materials_no', '=', item['materials_type_code'])]).id,
|
'factory_short_name']))]).id,
|
||||||
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
|
'materials_type_id': self.env['sf.materials.model'].search(
|
||||||
[('name', '=', item['cutting_width_depth'])]).id,
|
[('materials_no', '=', item['materials_type_code'])]).id,
|
||||||
'blade_diameter': item['blade_diameter'],
|
'cutting_width_depth_id': self.env['sf.cutting.width.depth'].search(
|
||||||
'feed_per_tooth': item['feed_per_tooth'],
|
[('name', '=', item['cutting_width_depth'])]).id,
|
||||||
'active': item['active'],
|
'blade_diameter': item['blade_diameter'],
|
||||||
})
|
'feed_per_tooth': item['feed_per_tooth'],
|
||||||
|
'active': item['active'],
|
||||||
|
})
|
||||||
else:
|
else:
|
||||||
feed_per_tooth.write({
|
feed_per_tooth.write({
|
||||||
'materials_type_id': self.env['sf.materials.model'].search(
|
'materials_type_id': self.env['sf.materials.model'].search(
|
||||||
|
|||||||
Reference in New Issue
Block a user