Commit e98ffb5c authored by Skia's avatar Skia
Browse files

Fix unappropriate behavior when delete selling

parent 11c263b6
Pipeline #389 passed with stage
in 7 minutes and 43 seconds
......@@ -55,8 +55,7 @@
</tr>
</thead>
<tbody>
{% for i in customer.refillings.order_by('-date').filter(
date__year=year, date__month=month) %}
{% for i in customer.refillings.order_by('-date').filter( date__year=year, date__month=month) %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td>{{ i.counter }}</td>
......
......@@ -303,6 +303,7 @@ class Selling(models.Model):
return user == self.customer.user
def delete(self, *args, **kwargs):
if self.payment_method == "SITH_ACCOUNT":
self.customer.amount += self.quantity * self.unit_price
self.customer.save()
super(Selling, self).delete(*args, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment