[IMP] sale: improve error message when trying to delete confirmed so lines
Closes #18521 .
This commit is contained in:
committed by
Thibault Delavallée
parent
8cfee8634c
commit
6eaf9de482
@@ -1056,7 +1056,7 @@ class SaleOrderLine(models.Model):
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
if self.filtered(lambda x: x.state in ('sale', 'done')):
|
||||
raise UserError(_('You can not remove a sales order line.\nDiscard changes and try setting the quantity to 0.'))
|
||||
raise UserError(_('You can not remove an order line once the sales order is confirmed.\nYou should rather set the quantity to 0.'))
|
||||
return super(SaleOrderLine, self).unlink()
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user