[FIX] stock: Inventory Adjustments Deletion
It's not allowed to delete inventory adjustement linked to validated moves. opw:1826300
This commit is contained in:
@@ -6647,6 +6647,12 @@ msgstr ""
|
||||
msgid "You cannot delete a scrap which is done."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
#: code:addons/stock/models/stock_inventory.py:103
|
||||
#, python-format
|
||||
msgid "You cannot delete a validated inventory adjustement."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
#: code:addons/stock/models/stock_inventory.py:374
|
||||
#, python-format
|
||||
|
||||
@@ -96,6 +96,13 @@ class Inventory(models.Model):
|
||||
else:
|
||||
self.total_qty = 0
|
||||
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
for inventory in self:
|
||||
if inventory.state == 'done':
|
||||
raise UserError(_('You cannot delete a validated inventory adjustement.'))
|
||||
return super(Inventory, self).unlink()
|
||||
|
||||
@api.model
|
||||
def _selection_filter(self):
|
||||
""" Get the list of filter allowed according to the options checked
|
||||
|
||||
Reference in New Issue
Block a user