Skip to content

Commit

Permalink
added some more things to the models.py and to the admin.py the modul…
Browse files Browse the repository at this point in the history
…e can soon be used in the crm
  • Loading branch information
Aaron Riedener committed Jul 11, 2011
1 parent 0d1135b commit 4962527
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 18 additions & 6 deletions subscriptions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class AdminSubscriptionEvent(admin.TabularInline):
class OptionSubscription(admin.ModelAdmin):
list_display = ('id', 'customer','subscriptiontype' , 'startdate', 'cancelingdate', 'staff', 'lastmodification', 'lastmodifiedby')
list_display_links = ('id', )
list_filter = ('customer', 'startdate', 'staff', 'defaultcurrency')
ordering = ('id', 'defaultcustomer', 'defaultcurrency')
search_fields = ('id','contract', 'defaultcurrency__description')
list_filter = ('customer', 'subscriptiontype')
ordering = ('id', 'customer', 'subscriptiontype')
search_fields = ('id', 'customer')
fieldsets = (
(_('Basics'), {
'fields': ('description', 'defaultcustomer', 'defaultSupplier', 'defaultcurrency')
'fields': ('customer','subscriptiontype' , 'startdate', 'cancelingdate', 'staff', 'lastmodification', 'lastmodifiedby')
}),
)
inlines = [SubscriptionEvent, ContractPhoneAddress, ContractEmailAddress, InlineQuote, InlineInvoice, InlinePurchaseOrder]
inlines = [SubscriptionEvent]

def save_model(self, request, obj, form, change):
if (change == True):
Expand All @@ -41,4 +41,16 @@ def save_model(self, request, obj, form, change):
obj.lastmodifiedby = request.user
obj.staff = request.user
obj.save()
actions = ['createContract', 'createInvoice', 'createQuote']
actions = ['createSubscriptionPDF']

class OptionSubscriptionType(admin.ModelAdmin):
list_display = ('id', 'title',)
list_display_links = ('id', )
list_filter = ('title', )
ordering = ('id', 'title',)
search_fields = ('id', 'title')
fieldsets = (
(_('Basics'), {
'fields': ('title', 'description' , 'cancelationPeriod', 'automaticContractExtension', 'automaticContractExtensionReminder', 'minimumDuration', 'paymentIntervall', 'contractDocument')
}),
)
2 changes: 2 additions & 0 deletions subscriptions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Meta:


class SubscriptionType(models.Model):
title = models.CharField(verbose_name=_("Title"), max_length=200)
description = models.TextField(verbose_name=_("Description"))
cancelationPeriod = models.IntegerField(verbose_name = _("Cancelation Period (months)"), blank=True, null=True)
automaticContractExtension = models.IntegerField(verbose_name = _("Automatic Contract Extension (months)"), blank=True, null=True)
automaticContractExtensionReminder = models.IntegerField(verbose_name = _("Automatic Contract Extensoin Reminder (days)"), blank=True, null=True)
Expand Down

0 comments on commit 4962527

Please sign in to comment.