物流相关增量开发,修改一些原生按钮,修改一些翻译
This commit is contained in:
@@ -42,6 +42,14 @@ class JdEclp(models.Model):
|
||||
# bill_show = fields.Binary(string='物流面单展示', readonly=True, related='self.bill.datas')
|
||||
bill_show = fields.Binary(string='物流面单展示', readonly=True)
|
||||
check_out = fields.Char(string='查询是否为出库单', compute='_check_is_out')
|
||||
# 是否下了快递单
|
||||
is_bill = fields.Boolean(string='是否下了快递单', default=False)
|
||||
# 物流状态
|
||||
logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
|
||||
string='物流状态', default='0')
|
||||
|
||||
logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
|
||||
|
||||
|
||||
@api.depends('name')
|
||||
def _check_is_out(self):
|
||||
@@ -68,6 +76,7 @@ class JdEclp(models.Model):
|
||||
# if self.receiverName and self.receiverMobile and self.receiverProvinceName and self.receiverCityName and
|
||||
# self.receiverCountyName and self.receiverTownName:
|
||||
sale_order_id = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||
self.logistics_way = sale_order_id.logistics_way
|
||||
# stock_picking_type_id = self.enc['stock.picking.type'].search([('picking_type_id', '=', '')])
|
||||
# if sale_order_id.address_of_delivery != False:
|
||||
# if not sale_order_id:
|
||||
@@ -141,6 +150,8 @@ class JdEclp(models.Model):
|
||||
response = requests.post(url2, json=json2, data=None)
|
||||
# _logger.info('调用成功2', response.json()['result']['wbNo'])
|
||||
self.carrier_tracking_ref = response.json()['result']['wbNo']
|
||||
self.is_bill = True
|
||||
self.logistics_status = '1'
|
||||
|
||||
# else:
|
||||
# raise UserError("选择京东物流才能下单呦")
|
||||
@@ -180,3 +191,4 @@ class JdEclp(models.Model):
|
||||
# 'model_name': 'stock.picking',
|
||||
})
|
||||
_logger.info(attachment)
|
||||
self.logistics_status = '2'
|
||||
|
||||
Reference in New Issue
Block a user