1、工单解绑时添加二次校验是否解绑成功;2、销售订单创建接口添加详情信息‘备注’字段;

This commit is contained in:
yuxianghui
2024-07-16 10:40:18 +08:00
parent 77815c45a0
commit 37977be862
2 changed files with 11 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ from dateutil.relativedelta import relativedelta
# import subprocess
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.addons.sf_base.commons.common import Common
from odoo.exceptions import UserError
from odoo.exceptions import UserError,ValidationError
from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
@@ -1019,11 +1019,13 @@ class ResMrpWorkOrder(models.Model):
if workorder.state != 'done':
is_production_id = False
if record.routing_type == '解除装夹':
for workorder in record.production_id.workorder_ids:
if workorder.processing_panel == record.processing_panel:
for workorder in record.production_id.workorder_ids.filtered(
lambda a: a.processing_panel == record.processing_panel):
rfid_code = workorder.rfid_code
workorder.write({'rfid_code_old': rfid_code,
'rfid_code': False})
if workorder.rfid_code:
raise ValidationError(f'{workorder.name}】工单解绑失败,请重新点击完成按钮!!!')
workorder.rfid_code_old = rfid_code
workorder.rfid_code = False
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:

View File

@@ -113,6 +113,7 @@ class ReSaleOrder(models.Model):
'price_unit': product.list_price,
'product_uom_qty': item['number'],
'model_glb_file': base64.b64decode(item['model_file']),
'remark': item.get('remark')
}
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)