Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
e98ffb5c
Commit
e98ffb5c
authored
Nov 10, 2016
by
Skia
🤘
Browse files
Fix unappropriate behavior when delete selling
parent
11c263b6
Pipeline
#389
passed with stage
in 7 minutes and 43 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
core/templates/core/user_account_detail.jinja
View file @
e98ffb5c
...
...
@@ -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>
...
...
counter/models.py
View file @
e98ffb5c
...
...
@@ -223,7 +223,7 @@ class Counter(models.Model):
def
is_inactive
(
self
):
"""
Returns True if the counter self is inactive from SITH_COUNTER_MINUTE_INACTIVE's value minutes, else False
Returns True if the counter self is inactive from SITH_COUNTER_MINUTE_INACTIVE's value minutes, else False
"""
return
self
.
is_open
()
and
((
timezone
.
now
()
-
self
.
permanencies
.
order_by
(
'-activity'
).
first
().
activity
)
>
datetime
.
timedelta
(
minutes
=
settings
.
SITH_COUNTER_MINUTE_INACTIVE
))
...
...
@@ -303,8 +303,9 @@ class Selling(models.Model):
return
user
==
self
.
customer
.
user
def
delete
(
self
,
*
args
,
**
kwargs
):
self
.
customer
.
amount
+=
self
.
quantity
*
self
.
unit_price
self
.
customer
.
save
()
if
self
.
payment_method
==
"SITH_ACCOUNT"
:
self
.
customer
.
amount
+=
self
.
quantity
*
self
.
unit_price
self
.
customer
.
save
()
super
(
Selling
,
self
).
delete
(
*
args
,
**
kwargs
)
def
send_mail_customer
(
self
):
...
...
@@ -331,7 +332,7 @@ class Selling(models.Model):
self
.
customer
.
user
.
email_user
(
subject
,
message_txt
,
html_message
=
message_html
html_message
=
message_html
)
def
save
(
self
,
*
args
,
**
kwargs
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment