[FIX]pms: unlink records folio sale lines

This commit is contained in:
Darío Lodeiros
2023-03-08 12:07:26 +01:00
parent b93dcd7731
commit 44f086e4c7

View File

@@ -1089,13 +1089,14 @@ class FolioSaleLine(models.Model):
return res
def unlink(self):
if self.qty_invoiced > 0:
raise UserError(
_(
"You cannot delete a sale order line once a "
"invoice has been created from it."
for record in self:
if record.qty_invoiced > 0:
raise UserError(
_(
"You cannot delete a sale order line once a "
"invoice has been created from it."
)
)
)
return super(FolioSaleLine, self).unlink()
def _get_real_price_currency(self, product, rule_id, qty, uom, pricelist_id):