mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Log plugin event errors (#6455)
* Log plugin event errors - Log errors from plugins running process_event function * Catch exception on custom validation * Catch some more errors * Fix circular imports
This commit is contained in:
		@@ -25,6 +25,7 @@ from mptt.models import MPTTModel, TreeForeignKey
 | 
			
		||||
from taggit.managers import TaggableManager
 | 
			
		||||
 | 
			
		||||
import common.models
 | 
			
		||||
import InvenTree.exceptions
 | 
			
		||||
import InvenTree.helpers
 | 
			
		||||
import InvenTree.models
 | 
			
		||||
import InvenTree.ready
 | 
			
		||||
@@ -601,6 +602,10 @@ class StockItem(
 | 
			
		||||
                plugin.validate_batch_code(self.batch, self)
 | 
			
		||||
            except ValidationError as exc:
 | 
			
		||||
                raise ValidationError({'batch': exc.message})
 | 
			
		||||
            except Exception:
 | 
			
		||||
                InvenTree.exceptions.log_error(
 | 
			
		||||
                    f'plugin.{plugin.slug}.validate_batch_code'
 | 
			
		||||
                )
 | 
			
		||||
 | 
			
		||||
    def clean(self):
 | 
			
		||||
        """Validate the StockItem object (separate to field validation).
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user