解决供货路线选择报错
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user