Commit 380fc1ba authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[enh] had stock management

parent 8e703b92
......@@ -60,7 +60,7 @@ class OrderAdmin(VersionAdmin, AdminViews):
class ComponentAdmin(VersionAdmin):
list_display = ('__unicode__', 'current_price', 'in_default_pack', 'available')
list_display = ('__unicode__', 'current_price', 'in_default_pack', 'available', 'stock')
admin.site.register(GroupOrder, GroupOrderAdmin)
......
......@@ -176,6 +176,8 @@ class Component(models.Model):
in_default_pack = models.BooleanField(default=False)
available = models.BooleanField(default=True)
stock = models.PositiveIntegerField(default=0)
@property
def provider(self):
return self.url.split("//")[1].split("/")[0].replace("www.", "").replace(".com", "")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment