Browse Source

Pouvoir changer le status d'une facture

Irina LAMBLA 6 years ago
parent
commit
cee1faa7f0
1 changed files with 7 additions and 2 deletions
  1. 7 2
      coin/billing/admin.py

+ 7 - 2
coin/billing/admin.py

@@ -123,12 +123,17 @@ class InvoiceAdmin(admin.ModelAdmin):
         """
         if obj and obj.validated:
             if self.declared_fieldsets:
-                return flatten_fieldsets(self.declared_fieldsets)
+                ro_fields = flatten_fieldsets(self.declared_fieldsets)
             else:
-                return list(set(
+                ro_fields = list(set(
                     [field.name for field in self.opts.local_fields] +
                     [field.name for field in self.opts.local_many_to_many]
                 ))
+            try:
+                ro_fields.remove("status")
+            except:
+                pass
+            return ro_fields
         return self.readonly_fields
 
     def get_inline_instances(self, request, obj=None):