From b1a08be57b8c983938f4133e4ebcca3cc91712bb Mon Sep 17 00:00:00 2001 From: hujiaying Date: Mon, 23 Sep 2024 12:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=20bfm=E5=8A=A0=E5=B7=A5=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=AD=97=E6=AE=B5=20=EF=BC=8C=E5=BE=85?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E6=98=8E=E7=BB=86=E4=B8=AD=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=8D=95=E6=97=A5=E6=9C=9F=E3=80=81=E5=8F=91=E8=B4=A7=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E9=A1=BA=E5=BA=8F=E6=94=B9=E5=8F=98=EF=BC=8C=E6=AC=A0?= =?UTF-8?q?=E5=8D=95=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA=E5=8F=91=E8=B4=A7=E6=97=B6?= =?UTF-8?q?=E9=97=B4=20=E3=80=81=E6=9B=B4=E6=94=B9=E9=80=BE=E6=9C=9F?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_stock/models/stock_picking.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sf_stock/models/stock_picking.py b/sf_stock/models/stock_picking.py index 3a64f78c..a429db36 100644 --- a/sf_stock/models/stock_picking.py +++ b/sf_stock/models/stock_picking.py @@ -74,6 +74,8 @@ class StockPicking(models.Model): def send_to_bfm(self): skip_backorder = self.env.context.get('skip_backorder') + cancel_backorder_ids = self.env.context.get('picking_ids_not_to_backorder') + # 下发发货到bfm config = self.env['res.config.settings'].get_values() move_ids, move_line_ids = self.deal_move_ids(self.move_ids, self.move_line_ids) @@ -92,13 +94,13 @@ class StockPicking(models.Model): 'state': self.state, 'backorder_id': self.deal_send_backorder_id(self.backorder_id), 'backorder_ids': self.deal_send_backorder_id(self.backorder_ids), - 'cancel_backorder_ids': skip_backorder, + 'cancel_backorder_ids': True if skip_backorder and cancel_backorder_ids else False, # 没有欠单判断 'move_type': self.move_type, }, } url1 = config['bfm_url_new'] + '/api/stock/deliver_goods' json_str = json.dumps(data) - print('json_str', json_str) + logging.info('json_str= %s', json_str) r = requests.post(url1, json=data, data=None) if r.status_code == 200: result = json.loads(r.json()['result'])