diff --git a/asset/views.py b/asset/views.py index db60657..e15f9ba 100644 --- a/asset/views.py +++ b/asset/views.py @@ -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'))