mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix calls to invoice.save
This commit is contained in:
parent
d0777187f7
commit
528bfcdef3
2 changed files with 7 additions and 6 deletions
|
@ -329,11 +329,12 @@ class Facture(BaseInvoice):
|
|||
purchase.save()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
super(Facture, self).save(*args, **kwargs)
|
||||
|
||||
try:
|
||||
request = kwargs.pop("request")
|
||||
except:
|
||||
request = None
|
||||
if "request" in kwargs:
|
||||
request = kwargs["request"]
|
||||
|
||||
super(Facture, self).save(*args, **kwargs)
|
||||
|
||||
if not self.__original_valid and self.valid:
|
||||
self.reorder_purchases()
|
||||
|
@ -875,7 +876,7 @@ class Paiement(RevMixin, AclMixin, models.Model):
|
|||
|
||||
# So make this invoice valid, trigger send mail
|
||||
invoice.valid = True
|
||||
invoice.save(request)
|
||||
invoice.save(request=request)
|
||||
|
||||
# In case a cotisation was bought, inform the user, the
|
||||
# cotisation time has been extended too
|
||||
|
|
|
@ -1008,7 +1008,7 @@ def credit_solde(request, user, **_kwargs):
|
|||
else:
|
||||
price_ok = True
|
||||
if price_ok:
|
||||
invoice.save(request)
|
||||
invoice.save(request=request)
|
||||
Vente.objects.create(
|
||||
facture=invoice,
|
||||
name="solde",
|
||||
|
|
Loading…
Reference in a new issue