2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Merge branch 'inventree:master' into not-working-tests

This commit is contained in:
Matthias Mair
2022-05-18 01:54:00 +02:00
committed by GitHub
85 changed files with 30275 additions and 29599 deletions

View File

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin

View File

@ -1,5 +1,3 @@
from __future__ import unicode_literals
import logging
from django.db.utils import OperationalError, ProgrammingError

View File

@ -59,7 +59,6 @@ from order import models as OrderModels
from company.models import SupplierPart
import part.settings as part_settings
from stock import models as StockModels
from plugin.models import MetadataMixin
@ -2291,12 +2290,13 @@ def after_save_part(sender, instance: Part, created, **kwargs):
"""
Function to be executed after a Part is saved
"""
from part import tasks as part_tasks
if not created and not InvenTree.ready.isImportingData():
# Check part stock only if we are *updating* the part (not creating it)
# Run this check in the background
InvenTree.tasks.offload_task('part.tasks.notify_low_stock_if_required', instance)
InvenTree.tasks.offload_task(part_tasks.notify_low_stock_if_required, instance)
class PartAttachment(InvenTreeAttachment):

View File

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.utils.translation import gettext_lazy as _
@ -49,6 +46,6 @@ def notify_low_stock_if_required(part: part.models.Part):
for p in parts:
if p.is_part_low_on_stock():
InvenTree.tasks.offload_task(
'part.tasks.notify_low_stock',
notify_low_stock,
p
)

View File

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import PIL
from django.urls import reverse

View File

@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import transaction
from django.test import TestCase

View File

@ -1,8 +1,5 @@
# Tests for the Part model
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from allauth.account.models import EmailAddress
from django.contrib.auth import get_user_model