mirror of
https://github.com/ae-utbm/sith.git
synced 2025-09-18 14:13:49 +00:00
Fix Multiple Fields Inputs & check
being override in base Models class
This commit is contained in:
@@ -990,7 +990,7 @@ class CashRegisterSummaryItem(models.Model):
|
||||
)
|
||||
value = CurrencyField(_("value"))
|
||||
quantity = models.IntegerField(_("quantity"), default=0)
|
||||
check = models.BooleanField(_("check"), default=False)
|
||||
checked = models.BooleanField(_("check"), default=False)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("cash register summary item")
|
||||
@@ -998,7 +998,7 @@ class CashRegisterSummaryItem(models.Model):
|
||||
|
||||
class Eticket(models.Model):
|
||||
"""
|
||||
Eticket can be linked to a product an allows PDF generation
|
||||
Eticket can be linked to a product and allows PDF generation
|
||||
"""
|
||||
|
||||
product = models.OneToOneField(
|
||||
|
@@ -1199,35 +1199,35 @@ class CashRegisterSummaryForm(forms.Form):
|
||||
cash_summary=summary,
|
||||
value=cd["check_1_value"],
|
||||
quantity=cd["check_1_quantity"],
|
||||
check=True,
|
||||
checked=True,
|
||||
).save()
|
||||
if cd["check_2_quantity"]:
|
||||
CashRegisterSummaryItem(
|
||||
cash_summary=summary,
|
||||
value=cd["check_2_value"],
|
||||
quantity=cd["check_2_quantity"],
|
||||
check=True,
|
||||
checked=True,
|
||||
).save()
|
||||
if cd["check_3_quantity"]:
|
||||
CashRegisterSummaryItem(
|
||||
cash_summary=summary,
|
||||
value=cd["check_3_value"],
|
||||
quantity=cd["check_3_quantity"],
|
||||
check=True,
|
||||
checked=True,
|
||||
).save()
|
||||
if cd["check_4_quantity"]:
|
||||
CashRegisterSummaryItem(
|
||||
cash_summary=summary,
|
||||
value=cd["check_4_value"],
|
||||
quantity=cd["check_4_quantity"],
|
||||
check=True,
|
||||
checked=True,
|
||||
).save()
|
||||
if cd["check_5_quantity"]:
|
||||
CashRegisterSummaryItem(
|
||||
cash_summary=summary,
|
||||
value=cd["check_5_value"],
|
||||
quantity=cd["check_5_quantity"],
|
||||
check=True,
|
||||
checked=True,
|
||||
).save()
|
||||
if summary.items.count() < 1:
|
||||
summary.delete()
|
||||
|
Reference in New Issue
Block a user