# 89 Ecoaccount recorded state reset (fix)
* fixes bug where recorded state of eco account has been reset, if a deduction is created from the detail view of the ecoaccount itself
This commit is contained in:
@@ -370,7 +370,7 @@ class NewDeductionModalForm(BaseModalForm):
|
||||
|
||||
def save(self):
|
||||
deduction = self.instance.add_deduction(self)
|
||||
self.instance.mark_as_edited(self.user, self.request)
|
||||
self.instance.mark_as_edited(self.user, self.request, reset_recorded=False)
|
||||
return deduction
|
||||
|
||||
|
||||
|
||||
@@ -250,17 +250,20 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec
|
||||
)
|
||||
return deduction
|
||||
|
||||
def mark_as_edited(self, performing_user: User, request: HttpRequest = None, edit_comment: str = None):
|
||||
def mark_as_edited(self, performing_user: User, request: HttpRequest = None, edit_comment: str = None, reset_recorded: bool = True):
|
||||
""" In case the object or a related object changed, internal processes need to be started, such as
|
||||
unrecord and uncheck
|
||||
|
||||
Args:
|
||||
performing_user (User): The user which performed the editing action
|
||||
request (HttpRequest): The used request for this action
|
||||
edit_comment (str): Additional comment for the log entry
|
||||
reset_recorded (bool): Whether the record-state of the object should be reset
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
super().mark_as_edited(performing_user, request)
|
||||
super().mark_as_edited(performing_user, request, edit_comment, reset_recorded)
|
||||
if self.checked:
|
||||
self.set_unchecked()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user