Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added some more things to the models.py and to the admin.py the modul…

…e can soon be used in the crm
  • Loading branch information...
commit 4962527230c423042fc1c61509a4f133117e46d2 1 parent 0d1135b
Aaron Riedener authored
Showing with 20 additions and 6 deletions.
  1. +18 −6 subscriptions/admin.py
  2. +2 −0  subscriptions/models.py
View
24 subscriptions/admin.py
@@ -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):
@@ -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')
+ }),
+ )
View
2  subscriptions/models.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.