提交 51a43c2b authored 作者: 贺阳's avatar 贺阳

更新转单号提示优化

上级 0c229c5e
......@@ -575,12 +575,13 @@ class CcBL(models.Model):
bl_no = self.env['common.common'].sudo().process_match_str(record.bl_no)
transfer_bl_no = self.env['common.common'].sudo().process_match_str(record.transfer_bl_no)
if bl_no and transfer_bl_no == bl_no:
raise ValidationError(_('Transfer B/L No. cannot be the same as B/L No.'))#转单号不能与提单号重复
raise ValidationError(_('Transfer B/L No. cannot be the same as B/L No.')) # 转单号不能与提单号重复
# 2. 不能与其他单据的提单号重复
other = self.env['cc.bl'].deal_bl_no_and_transfer_bl_no(transfer_bl_no,
domain=[('id', '!=', record.id)])
if other:
raise ValidationError(_('Transfer B/L No. cannot be the same as B/L No. or Transfer B/L No.'))#转单号不能与提单号或转单号重复
raise ValidationError(
_('Transfer B/L No. cannot be the same as B/L No. or Transfer B/L No.')) # 转单号不能与提单号或转单号重复
@api.depends('big_package_ids', 'big_package_ids.tally_state', 'big_package_ids.is_cancel')
def cal_tally_big_package_qty(self):
......
......@@ -108,12 +108,11 @@ class BatchUpdateTransferBlNoWizard(models.TransientModel):
else:
# Check if Transfer B/L No already exists in the system
bl_obj = self.env['cc.bl'].sudo().deal_bl_no_and_transfer_bl_no(transfer_bl_no)
if bl_obj and bl_obj.bl_no != bl_no:
cause_arr.append(_('This Transfer B/L No already exists')) # 该转单号已存在
if bl_obj and self.env['common.common'].sudo().process_match_str(bl_obj.bl_no) != bl_no:
cause_arr.append(_('Transfer B/L No. cannot be the same as B/L No. or Transfer B/L No.')) # 转单号不能与提单号或转单号重复
# Check if any B/L No equals any Transfer B/L No, or vice versa
if (bl_no and bl_no in all_transfer_bl_no) or (transfer_bl_no and transfer_bl_no in all_bl_no):
cause_arr.append(_('B/L No and Transfer B/L No are duplicated')) # 提单号和转单号有重复
logging.info('cause_arr:%s' % cause_arr)
if len(cause_arr) > 0:
is_error = True
order_item['error_remark'] = ','.join(cause_arr)
......@@ -146,7 +145,6 @@ class BatchUpdateTransferBlNoWizard(models.TransientModel):
ws.col(len(header) - col_index - 1).width = 256 * 20 # around 256 pixels
col_index += 1
index = 0
logging.info('error_msg:%s' % error_msg)
for item in error_msg:
ws.write(1 + index, 0, item['bl_no'])
ws.write(1 + index, 1, item['transfer_bl_no'])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论