Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
chocapix-server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Camille MASSET
chocapix-server
Commits
d41befb8
Commit
d41befb8
authored
May 21, 2016
by
wilhelmhb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permettre de forcer le logage d'un sellitem en unités entières
parent
b9e5bff4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
bars_items/migrations/0010_sellitem_sell_fraction.py
bars_items/migrations/0010_sellitem_sell_fraction.py
+19
-0
bars_items/models/sellitem.py
bars_items/models/sellitem.py
+2
-0
bars_transactions/serializers.py
bars_transactions/serializers.py
+4
-0
No files found.
bars_items/migrations/0010_sellitem_sell_fraction.py
0 → 100644
View file @
d41befb8
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bars_items'
,
'0009_suggesteditem'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'sellitem'
,
name
=
'sell_fraction'
,
field
=
models
.
BooleanField
(
default
=
True
),
),
]
bars_items/models/sellitem.py
View file @
d41befb8
...
...
@@ -28,6 +28,8 @@ class SellItem(models.Model):
unit_name
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
)
unit_name_plural
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
)
sell_fraction
=
models
.
BooleanField
(
default
=
True
)
tax
=
models
.
FloatField
(
default
=
0
)
deleted
=
models
.
BooleanField
(
default
=
False
)
...
...
bars_transactions/serializers.py
View file @
d41befb8
# encoding: utf8
import
math
from
django.core.mail
import
send_mail
from
django.utils
import
timezone
...
...
@@ -120,6 +122,8 @@ class ItemQtySerializer(serializers.Serializer):
elif
"sellitem"
in
data
:
sellitem
=
data
[
'sellitem'
]
if
not
sellitem
.
sell_fraction
:
qty
=
math
.
ceil
(
qty
)
total_qty
=
sellitem
.
calc_qty
()
stockitems
=
sellitem
.
stockitems
.
all
()
...
...
Write
Preview
Markdown
is supported
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