Withdraw to deduct

* refactors Models and attributes
This commit is contained in:
mipel
2021-08-30 11:34:35 +02:00
parent cd5fb9cad6
commit d569be80b3
5 changed files with 14 additions and 14 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ from django.db import transaction
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from compensation.models import EcoAccountWithdraw, EcoAccount
from compensation.models import EcoAccountDeduction, EcoAccount
from intervention.models import Intervention, Revocation
from konova.forms import BaseForm, BaseModalForm
from konova.models import Document
@@ -568,14 +568,14 @@ class NewDeductionForm(BaseModalForm):
# Create deductions depending on Intervention or EcoAccount as the initial instance
if self.is_intervention_initially:
deduction = EcoAccountWithdraw.objects.create(
deduction = EcoAccountDeduction.objects.create(
intervention=self.instance,
account=self.cleaned_data["account"],
surface=self.cleaned_data["surface"],
created=user_action_create,
)
else:
deduction = EcoAccountWithdraw.objects.create(
deduction = EcoAccountDeduction.objects.create(
intervention=self.cleaned_data["intervention"],
account=self.instance,
surface=self.cleaned_data["surface"],