提交 78a30a90 authored 作者: 贺阳's avatar 贺阳

优化提示

上级 d88786d2
...@@ -782,7 +782,8 @@ class CcBL(models.Model): ...@@ -782,7 +782,8 @@ class CcBL(models.Model):
if len(self) == 1: if len(self) == 1:
zip_name = f"{self.bl_no or self.id}.zip" zip_name = f"{self.bl_no or self.id}.zip"
att = self.env['ir.attachment'].sudo().create( att = self.env['ir.attachment'].sudo().create(
{'name': zip_name, 'datas': datas, 'res_model': 'cc.bl', 'res_id': (self.id if len(self) == 1 else self[0].id), {'name': zip_name, 'datas': datas, 'res_model': 'cc.bl',
'res_id': (self.id if len(self) == 1 else self[0].id),
'mimetype': 'application/zip'}) 'mimetype': 'application/zip'})
url = f"/web/content/ir.attachment/{att.id}/datas/{att.name}?download=true" url = f"/web/content/ir.attachment/{att.id}/datas/{att.name}?download=true"
return {'type': 'ir.actions.act_url', 'url': url, 'target': 'self'} return {'type': 'ir.actions.act_url', 'url': url, 'target': 'self'}
...@@ -1239,7 +1240,8 @@ class CcBL(models.Model): ...@@ -1239,7 +1240,8 @@ class CcBL(models.Model):
def action_batch_get_pod_info(self): def action_batch_get_pod_info(self):
"""批量获取尾程POD信息""" """批量获取尾程POD信息"""
if self.bl_type=='temu': is_temp = self.filtered(lambda x: x.bl_type == 'temu')
if is_temp:
raise ValidationError(_('TEMU提单不支持获取尾程POD信息,请点击批量创建提单!')) raise ValidationError(_('TEMU提单不支持获取尾程POD信息,请点击批量创建提单!'))
return { return {
'name': _('Batch Get POD Info'), 'name': _('Batch Get POD Info'),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论