mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-09-12 09:13:08 +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()
|
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
|
super(Facture, self).save(*args, **kwargs)
|
||||||
if "request" in kwargs:
|
|
||||||
request = kwargs["request"]
|
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue