询价单行项目价格判断
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user