解决供货路线选择报错

This commit is contained in:
胡尧
2025-03-26 08:42:08 +08:00
parent 4ca655ad51
commit 40dcd11da8
6 changed files with 74 additions and 3 deletions

View File

@@ -59,15 +59,14 @@ class PurchaseOrder(models.Model):
production_id = self.env['mrp.production'].search([('origin', 'in', origins)])
purchase.production_count = len(production_id)
def write(self, vals):
res = super(PurchaseOrder, self).write(vals)
def button_confirm(self):
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 res
return super(PurchaseOrder, self).button_confirm()
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')