From 8ec746858c97e68979b0cfa8fee3068000e6e372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Tue, 25 Mar 2025 16:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A2=E4=BB=B7=E5=8D=95=E8=A1=8C=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BB=B7=E6=A0=BC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/purchase_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py index 3cc0d877..5ee7d8f2 100644 --- a/sf_manufacturing/models/purchase_order.py +++ b/sf_manufacturing/models/purchase_order.py @@ -60,13 +60,14 @@ class PurchaseOrder(models.Model): purchase.production_count = len(production_id) def write(self, vals): + res = super(PurchaseOrder, self).write(vals) for record in self: for line in record.order_line: if line.product_qty <= 0: raise UserError('请对【产品】中的【数量】进行输入') if line.price_unit <= 0: raise UserError('请对【产品】中的【单价】进行输入') - return super(PurchaseOrder, self).write(vals) + return res origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')