1、工单解绑时添加二次校验是否解绑成功;2、销售订单创建接口添加详情信息‘备注’字段;
This commit is contained in:
@@ -13,7 +13,7 @@ from dateutil.relativedelta import relativedelta
|
|||||||
# import subprocess
|
# import subprocess
|
||||||
from odoo import api, fields, models, SUPERUSER_ID, _
|
from odoo import api, fields, models, SUPERUSER_ID, _
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
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
|
from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
|
||||||
|
|
||||||
|
|
||||||
@@ -1019,13 +1019,15 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if workorder.state != 'done':
|
if workorder.state != 'done':
|
||||||
is_production_id = False
|
is_production_id = False
|
||||||
if record.routing_type == '解除装夹':
|
if record.routing_type == '解除装夹':
|
||||||
for workorder in record.production_id.workorder_ids:
|
for workorder in record.production_id.workorder_ids.filtered(
|
||||||
if workorder.processing_panel == record.processing_panel:
|
lambda a: a.processing_panel == record.processing_panel):
|
||||||
rfid_code = workorder.rfid_code
|
rfid_code = workorder.rfid_code
|
||||||
workorder.write({'rfid_code_old': rfid_code,
|
workorder.write({'rfid_code_old': rfid_code,
|
||||||
'rfid_code': False})
|
'rfid_code': False})
|
||||||
workorder.rfid_code_old = rfid_code
|
if workorder.rfid_code:
|
||||||
workorder.rfid_code = False
|
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 ['解除装夹', '表面工艺']:
|
if is_production_id is True and record.routing_type in ['解除装夹', '表面工艺']:
|
||||||
logging.info('product_qty:%s' % record.production_id.product_qty)
|
logging.info('product_qty:%s' % record.production_id.product_qty)
|
||||||
for move_raw_id in record.production_id.move_raw_ids:
|
for move_raw_id in record.production_id.move_raw_ids:
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ class ReSaleOrder(models.Model):
|
|||||||
'price_unit': product.list_price,
|
'price_unit': product.list_price,
|
||||||
'product_uom_qty': item['number'],
|
'product_uom_qty': item['number'],
|
||||||
'model_glb_file': base64.b64decode(item['model_file']),
|
'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)
|
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user