Add asset if new GTIN product has been created
This commit is contained in:
		@@ -65,4 +65,10 @@ def asset_from_gtin(request):
 | 
			
		||||
        print(f'ERROR: Could not create asset for gtin={gtin}')
 | 
			
		||||
    else:
 | 
			
		||||
        print(f'Create new product: {product.name}, brand={product.brand}, gtin={product.gtin}')
 | 
			
		||||
        asset = Asset.objects.create(
 | 
			
		||||
            named_id='A-' + product.gtin,
 | 
			
		||||
            description=product.name,
 | 
			
		||||
            created_by=request.user,
 | 
			
		||||
            changed_by=request.user)
 | 
			
		||||
        asset.save()
 | 
			
		||||
    return HttpResponseRedirect(reverse('asset:list'))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user