This commit is contained in:
jinling.yang
2024-07-01 14:03:23 +08:00

View File

@@ -161,7 +161,9 @@ class JdEclp(models.Model):
url2 = config['bfm_url'] + '/api/get/jd/no'
response = requests.post(url2, json=json2, data=None)
# _logger.info('调用成功2', response.json()['result']['wbNo'])
self.carrier_tracking_ref = response.json()['result']['wbNo']
self.carrier_tracking_ref = response.json()['result'].get('wbNo')
if not self.carrier_tracking_ref:
raise ValidationError('物流下单未成功,请联系管理员')
self.is_bill = True
self.logistics_status = '1'
@@ -173,8 +175,10 @@ class JdEclp(models.Model):
'type': 'success',
'message': '物流下单成功',
'sticky': False,
'next': {'type': 'ir.actions.client', 'tag': 'soft_reload'}
}
}
return notification
def get_bill(self):