Minor enhancements
* refactors eco account rest surface calculation into designated method get_available_rest() * refactors placeholder setter for BaseForm * adds automatic eco account identifier generating on saving * fixes ServerMessageImportance template tag
This commit is contained in:
@@ -67,6 +67,7 @@ class NewPaymentForm(BaseModalForm):
|
||||
self.intervention = self.instance
|
||||
self.form_title = _("Payment")
|
||||
self.form_caption = _("Add a payment for intervention '{}'").format(self.intervention.title)
|
||||
self.add_placeholder_for_field("amount", "0,00")
|
||||
|
||||
def save(self):
|
||||
with transaction.atomic():
|
||||
@@ -110,6 +111,7 @@ class NewStateModalForm(BaseModalForm):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.form_title = _("New state")
|
||||
self.form_caption = _("Insert data for the new state")
|
||||
self.add_placeholder_for_field("surface", "0,00")
|
||||
|
||||
def save(self, is_before_state: bool = False):
|
||||
with transaction.atomic():
|
||||
@@ -286,6 +288,7 @@ class NewActionModalForm(BaseModalForm):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.form_title = _("New action")
|
||||
self.form_caption = _("Insert data for the new action")
|
||||
self.add_placeholder_for_field("amount", "0,00")
|
||||
|
||||
def save(self):
|
||||
with transaction.atomic():
|
||||
|
||||
Reference in New Issue
Block a user