Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made the Inlines in the Contracts read only

  • Loading branch information...
commit 312c2b0c61b31f1c9b14708985d8df43d6bda48c 1 parent 99393cf
@scaphilo authored
Showing with 6 additions and 1 deletion.
  1. +5 −1 crm/admin.py
  2. +1 −0  subscriptions/admin.py
View
6 crm/admin.py
@@ -128,6 +128,7 @@ class InlineQuote(admin.TabularInline):
model = Quote
classes = ('collapse-open')
extra = 1
+ readonly_fields = ('description', 'contract', 'customer', 'validuntil', 'status', 'lastPricingDate', 'lastCalculatedPrice', 'lastCalculatedTax', )
fieldsets = (
(_('Basics'), {
'fields': ('description', 'contract', 'customer', 'validuntil', 'status')
@@ -143,21 +144,24 @@ class InlineInvoice(admin.TabularInline):
model = Invoice
classes = ('collapse-open')
extra = 1
+ readonly_fields = ('lastPricingDate', 'lastCalculatedPrice', 'lastCalculatedTax', 'description', 'contract', 'customer', 'payableuntil', 'status' )
fieldsets = (
(_('Basics'), {
- 'fields': ('description', 'contract', 'customer', 'payableuntil', 'status')
+ 'fields': ('description', 'contract', 'customer', 'payableuntil', 'status'),
}),
(_('Advanced (not editable)'), {
'classes': ('collapse',),
'fields': ('lastPricingDate', 'lastCalculatedPrice', 'lastCalculatedTax',)
}),
)
+
allow_add = False
class InlinePurchaseOrder(admin.TabularInline):
model = PurchaseOrder
classes = ('collapse-open')
extra = 1
+ readonly_fields = ('description', 'contract', 'supplier', 'externalReference', 'status', 'lastPricingDate', 'lastCalculatedPrice' )
fieldsets = (
(_('Basics'), {
'fields': ('description', 'contract', 'supplier', 'externalReference', 'status')
View
1  subscriptions/admin.py
@@ -27,6 +27,7 @@ class InlineSubscription(admin.TabularInline):
model = Subscription
extra = 1
classes = ('collapse-open',)
+ readonly_fields = ('contract', 'subscriptiontype')
fieldsets = (
(_('Basics'), {
'fields': ( 'contract', 'subscriptiontype' )
Please sign in to comment.
Something went wrong with that request. Please try again.