调整适配零件图号为数字
This commit is contained in:
@@ -97,7 +97,7 @@ class ImportComplexModelWizard(models.TransientModel):
|
|||||||
"""导入Excel数据"""
|
"""导入Excel数据"""
|
||||||
if not self.file_data:
|
if not self.file_data:
|
||||||
raise UserError(_('请先上传Excel文件'))
|
raise UserError(_('请先上传Excel文件'))
|
||||||
|
|
||||||
if self.check_id.measure_line_ids:
|
if self.check_id.measure_line_ids:
|
||||||
self.sudo().check_id.measure_line_ids.unlink()
|
self.sudo().check_id.measure_line_ids.unlink()
|
||||||
|
|
||||||
@@ -169,7 +169,12 @@ class ImportComplexModelWizard(models.TransientModel):
|
|||||||
|
|
||||||
if row[2] == '':
|
if row[2] == '':
|
||||||
continue
|
continue
|
||||||
if row[1] != quality_check.part_number:
|
logging.info('================%s, %s==' % (row[1], type(row[1])))
|
||||||
|
|
||||||
|
compare_value = row[1]
|
||||||
|
if type(compare_value) == float:
|
||||||
|
compare_value = str(int(compare_value))
|
||||||
|
if compare_value != quality_check.part_number:
|
||||||
print(sheet.row_values(row_index))
|
print(sheet.row_values(row_index))
|
||||||
raise UserError(_('上传内容图号错误,请修改'))
|
raise UserError(_('上传内容图号错误,请修改'))
|
||||||
for row_index in range(1, sheet.nrows):
|
for row_index in range(1, sheet.nrows):
|
||||||
@@ -205,7 +210,7 @@ class ImportComplexModelWizard(models.TransientModel):
|
|||||||
|
|
||||||
self.env['quality.check.measure.line'].create(measure_line_vals)
|
self.env['quality.check.measure.line'].create(measure_line_vals)
|
||||||
valid_data_imported = True
|
valid_data_imported = True
|
||||||
|
|
||||||
quality_check.column_nums = max_columns
|
quality_check.column_nums = max_columns
|
||||||
|
|
||||||
# 检查是否有有效数据被导入
|
# 检查是否有有效数据被导入
|
||||||
@@ -435,7 +440,8 @@ class ImportComplexModelWizard(models.TransientModel):
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
def download_excel_template(self):
|
def download_excel_template(self):
|
||||||
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') + '/quality_control/static/src/binary/出厂检验报告上传模版.xlsx'
|
base_url = self.env['ir.config_parameter'].sudo().get_param(
|
||||||
|
'web.base.url') + '/quality_control/static/src/binary/出厂检验报告上传模版.xlsx'
|
||||||
|
|
||||||
# 只有当原始 URL 使用 http 时才替换为 https
|
# 只有当原始 URL 使用 http 时才替换为 https
|
||||||
if base_url.startswith("http://"):
|
if base_url.startswith("http://"):
|
||||||
|
|||||||
Reference in New Issue
Block a user