优化同步代码

This commit is contained in:
mgw
2024-05-18 21:32:24 +08:00
parent cc7963cb5a
commit 3afa76b79c

View File

@@ -2116,6 +2116,8 @@ 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:
_logger.info("item[standard_library_code] %s" % item.get('standard_library_code'))
if item.get('standard_library_code'):
self.create({ self.create({
'name': item['name'], 'name': item['name'],
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search( 'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(