|
@@ -14,7 +14,8 @@ from django.dispatch import receiver
|
|
from coin.offers.models import OfferSubscription
|
|
from coin.offers.models import OfferSubscription
|
|
from coin.members.models import Member
|
|
from coin.members.models import Member
|
|
from coin.html2pdf import render_as_pdf
|
|
from coin.html2pdf import render_as_pdf
|
|
-from coin.utils import private_files_storage, start_of_month, end_of_month
|
|
|
|
|
|
+from coin.utils import private_files_storage, start_of_month, end_of_month, \
|
|
|
|
+ disable_for_loaddata
|
|
from coin.isp_database.context_processors import branding
|
|
from coin.isp_database.context_processors import branding
|
|
|
|
|
|
def next_invoice_number():
|
|
def next_invoice_number():
|
|
@@ -204,6 +205,7 @@ class Payment(models.Model):
|
|
|
|
|
|
|
|
|
|
@receiver(post_save, sender=Payment)
|
|
@receiver(post_save, sender=Payment)
|
|
|
|
+@disable_for_loaddata
|
|
def set_invoice_as_paid_if_needed(sender, instance, **kwargs):
|
|
def set_invoice_as_paid_if_needed(sender, instance, **kwargs):
|
|
"""
|
|
"""
|
|
Lorsqu'un paiement est enregistré, vérifie si la facture est alors
|
|
Lorsqu'un paiement est enregistré, vérifie si la facture est alors
|