Withdraw to deduct
* refactors Models and attributes
This commit is contained in:
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user