[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 return res
def unlink(self): def unlink(self):
if self.qty_invoiced > 0: for record in self:
raise UserError( if record.qty_invoiced > 0:
_( raise UserError(
"You cannot delete a sale order line once a " _(
"invoice has been created from it." "You cannot delete a sale order line once a "
"invoice has been created from it."
)
) )
)
return super(FolioSaleLine, self).unlink() return super(FolioSaleLine, self).unlink()
def _get_real_price_currency(self, product, rule_id, qty, uom, pricelist_id): def _get_real_price_currency(self, product, rule_id, qty, uom, pricelist_id):