提交 c47d2b90 authored 作者: 贺阳's avatar 贺阳

已理货的状态 不修改

上级 4fd4bb31
......@@ -4,4 +4,5 @@ from . import cc_bill_loading
from . import cc_customs_declaration_order
from . import cc_node_exception_reason
from . import mail_thread
from . import common_common
# -*- coding: utf-8 -*-
import datetime
import re
from odoo import fields, models, exceptions, api, tools
import logging
__author__ = 'zd'
_logger = logging.getLogger(__name__)
class CommonCommon(models.Model):
_name = 'common.common'
_description = u'公用基础类'
def get_format_time(self, parse_time):
"""
把时间加上8小时
:return:
"""
dt = datetime.datetime.strptime(parse_time, "%Y-%m-%d %H:%M:%S")
d = dt + datetime.timedelta(hours=8)
nTime = d.strftime("%Y-%m-%d %H:%M:%S")
return nTime
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
batch_input_ship_package_status_wizard_group_user,batch_input_ship_package_status_wizard_group_user,ccs_base.model_batch_input_ship_package_status_wizard,base.group_user,1,1,1,1
export_bl_big_package_xlsx_wizard_group_user,export_bl_big_package_xlsx_wizard_group_user,ccs_base.model_export_bl_big_package_xlsx_wizard,base.group_user,1,1,1,1
access_group_user_common_common,access_group_user_common_common,model_common_common,base.group_user,1,1,1,1
access_cc_node_base.group_user,cc_node base.group_user,ccs_base.model_cc_node,base.group_user,1,0,0,0
......
......@@ -378,7 +378,8 @@ class TTApi(http.Controller):
img_file_code = kws.get('img_detail').get('img_file_code')
img_file_type = kws.get('img_detail').get('img_file_type')
img_file_vals = dict(name='%s.%s' % (kws.get('master_waybill_no'), img_file_type),
file_name = '%s.%s' % (kws.get('master_waybill_no'), img_file_type)
img_file_vals = dict(name=file_name,
res_model='cc.bl',
res_id=bl.id,
type='binary',
......@@ -386,8 +387,7 @@ class TTApi(http.Controller):
mimetype='image/%s' % img_file_type)
img_file = request.env['ir.attachment'].sudo().create(img_file_vals)
if img_file:
vals['bl_attachment_ids'] = [(4, img_file.id)]
vals['bl_attachment_ids'] = [(6, 0, img_file.ids)]
bl.write(vals)
else:
res['code'] = 1009
......
......@@ -7,3 +7,5 @@ from . import ao_tt_api_log
from . import cc_node
from . import cc_bill_loading
......@@ -269,19 +269,22 @@ class CcBigPackage(models.Model):
'tally_state': state_arr[self.tally_state] or '', # 理货状态
'tally_user_id': self.tally_user_id.id or '', # 理货人id
'tally_user_name': self.tally_user_id.name or '', # 理货人名称
'tally_time': self.tally_time or '', # 理货时间
'tally_time': self.tally_time or '',
# self.env['common.common'].sudo().get_format_time(str(self.tally_time)) if self.tally_time else '',
# 理货时间
'big_package_no': self.big_package_no or '' # 大包号
}
return vals
def update_big_package_info(self, **kwargs):
"""
修改信息
理货
"""
if kwargs.get('tally_state'):
state_arr = {'未理货': 'unprocessed_goods', '已理货': 'checked_goods'}
self.tally_state = state_arr[kwargs['tally_state']]
if kwargs.get('tally_user_id'):
self.tally_user_id = kwargs['tally_user_id']
if kwargs.get('tally_time'):
self.tally_time = kwargs['tally_time']
if self.tally_state == 'unprocessed_goods':
if kwargs.get('tally_state'):
state_arr = {'未理货': 'unprocessed_goods', '已理货': 'checked_goods'}
self.tally_state = state_arr[kwargs['tally_state']]
if kwargs.get('tally_user_id'):
self.tally_user_id = kwargs['tally_user_id']
if kwargs.get('tally_time'):
self.tally_time = kwargs['tally_time']
# -*- coding: utf-8 -*-
import re
from odoo import fields, models, exceptions, api, tools
import logging
__author__ = 'zd'
_logger = logging.getLogger(__name__)
class AoCommon(models.Model):
_inherit = 'ao.common'
_description = u'公用基础类'
def api_qy_wechat_notice(self, content, flight_id):
"""
接口调用出错发送企业微信通知
:return:
"""
user_ids = []
obj = self.env['ao.api.warning.user'].sudo().search(
[('air_line_ids', 'in', flight_id)], limit=1)
if obj:
for user in obj.user_ids:
user_ids.append(user.we_employee_id)
lost_agent_id = self.env['ir.config_parameter'].sudo().get_param('lost_agent_id')
wechat = self.env['we.config'].sudo().get_wechat(agent_id=lost_agent_id)
wechat.message.send_markdown(agent_id=lost_agent_id, user_ids=user_ids,
content=content)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论