历史销售订单价格问题

This commit is contained in:
liaodanlong
2024-09-14 17:40:45 +08:00
parent 01c57a8691
commit 7ce2f6c797
6 changed files with 64 additions and 4 deletions

View File

@@ -184,7 +184,10 @@ class ResConfigSettings(models.TransientModel):
new_price = res_order_lines_map.get(str(index))
if order_line:
# 修改单价
order_line.write({'remark': new_price})
order_line.write({'remark': new_price*order_line.product_uom_qty})
order_price = self.env['order.price'].sudo().search([('sale_order_id', '=',need_change_sale_order.id )])
if not order_price:
self.env['order.price'].sudo().create({'sale_order_id':need_change_sale_order.id})
else:
logging.error('同步销售订单价格失败 {}'.format(response.text))
raise UserError('同步销售订单价格失败')