8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

Fix calls to invoice.save

This commit is contained in:
Jean-Romain Garnier 2020-04-19 19:19:06 +00:00 committed by Supelec Rezo Rennes
parent d0777187f7
commit 528bfcdef3
2 changed files with 7 additions and 6 deletions

View file

@ -329,11 +329,12 @@ class Facture(BaseInvoice):
purchase.save() purchase.save()
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
super(Facture, self).save(*args, **kwargs) try:
request = kwargs.pop("request")
except:
request = None request = None
if "request" in kwargs:
request = kwargs["request"] super(Facture, self).save(*args, **kwargs)
if not self.__original_valid and self.valid: if not self.__original_valid and self.valid:
self.reorder_purchases() self.reorder_purchases()
@ -875,7 +876,7 @@ class Paiement(RevMixin, AclMixin, models.Model):
# So make this invoice valid, trigger send mail # So make this invoice valid, trigger send mail
invoice.valid = True invoice.valid = True
invoice.save(request) invoice.save(request=request)
# In case a cotisation was bought, inform the user, the # In case a cotisation was bought, inform the user, the
# cotisation time has been extended too # cotisation time has been extended too

View file

@ -1008,7 +1008,7 @@ def credit_solde(request, user, **_kwargs):
else: else:
price_ok = True price_ok = True
if price_ok: if price_ok:
invoice.save(request) invoice.save(request=request)
Vente.objects.create( Vente.objects.create(
facture=invoice, facture=invoice,
name="solde", name="solde",