校验修改

This commit is contained in:
guanhuan
2025-07-14 16:13:49 +08:00
parent 588b7d340f
commit ff7cd9c927
2 changed files with 19 additions and 15 deletions

View File

@@ -222,9 +222,6 @@ class SfDemandPlan(models.Model):
line_ids = self.line_ids.filtered(lambda p: p.status == '30')
sum_product_uom_qty = sum(line_ids.mapped('plan_uom_qty'))
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
for line in self.line_ids:
if line.manual_quotation and line.custom_made_type == 'automation':
raise ValidationError(f"产品{line.product_id.name}为人工编程,不能选择自动化产线加工")
if not self.overdelivery_allowed and line_ids.filtered(lambda p: p.location_id.id == customer_location_id):
if float_compare(sum_product_uom_qty, self.product_uom_qty,
precision_rounding=self.product_id.uom_id.rounding) == 1: