mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Add another check for merging stock
This commit is contained in:
parent
dd53748f9f
commit
52ca2e5068
@ -72,7 +72,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"| {locale.ljust(4, ' ')} : {str(percentage).rjust(4, ' ')}% |")
|
print(f"| {locale.ljust(4, ' ')} : {str(percentage).rjust(4, ' ')}% |")
|
||||||
|
|
||||||
locales_perc[locale] = percentage
|
locales_perc[locale] = percentage
|
||||||
|
|
||||||
percentages.append(percentage)
|
percentages.append(percentage)
|
||||||
@ -89,4 +89,4 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
avg = 0
|
avg = 0
|
||||||
|
|
||||||
print(f"InvenTree translation coverage: {avg}%")
|
print(f"InvenTree translation coverage: {avg}%")
|
||||||
|
@ -1166,6 +1166,9 @@ class StockItem(MPTTModel):
|
|||||||
if self.belongs_to:
|
if self.belongs_to:
|
||||||
raise ValidationError(_('Stock item is installed in another item'))
|
raise ValidationError(_('Stock item is installed in another item'))
|
||||||
|
|
||||||
|
if self.installed_item_count() > 0:
|
||||||
|
raise ValidationError(_('Stock item contains other items'))
|
||||||
|
|
||||||
if self.customer:
|
if self.customer:
|
||||||
raise ValidationError(_('Stock item has been assigned to a customer'))
|
raise ValidationError(_('Stock item has been assigned to a customer'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user