Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Tezor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Tezor
Commits
3a33fc04
Verified
Commit
3a33fc04
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Fix constraints for manual invoicing
parent
6612dd6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#59657
failed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/tezor/models/invoice.py
+8
-3
8 additions, 3 deletions
aleksis/apps/tezor/models/invoice.py
with
8 additions
and
3 deletions
aleksis/apps/tezor/models/invoice.py
+
8
−
3
View file @
3a33fc04
...
@@ -67,8 +67,10 @@ class Invoice(BasePayment, PureDjangoModel):
...
@@ -67,8 +67,10 @@ class Invoice(BasePayment, PureDjangoModel):
number
=
models
.
CharField
(
verbose_name
=
_
(
"
Invoice number
"
),
max_length
=
255
)
number
=
models
.
CharField
(
verbose_name
=
_
(
"
Invoice number
"
),
max_length
=
255
)
due_date
=
models
.
DateField
(
verbose_name
=
_
(
"
Payment due date
"
),
null
=
True
)
due_date
=
models
.
DateField
(
verbose_name
=
_
(
"
Payment due date
"
),
null
=
True
)
for_content_type
=
models
.
ForeignKey
(
ContentType
,
on_delete
=
models
.
SET_NULL
,
null
=
True
)
for_content_type
=
models
.
ForeignKey
(
for_object_id
=
models
.
PositiveIntegerField
()
ContentType
,
on_delete
=
models
.
SET_NULL
,
null
=
True
,
blank
=
True
)
for_object_id
=
models
.
PositiveIntegerField
(
null
=
True
,
blank
=
True
)
for_object
=
GenericForeignKey
(
"
for_content_type
"
,
"
for_object_id
"
)
for_object
=
GenericForeignKey
(
"
for_content_type
"
,
"
for_object_id
"
)
# For manual invoicing
# For manual invoicing
...
@@ -119,7 +121,10 @@ class Invoice(BasePayment, PureDjangoModel):
...
@@ -119,7 +121,10 @@ class Invoice(BasePayment, PureDjangoModel):
constraints
=
[
constraints
=
[
models
.
UniqueConstraint
(
fields
=
[
"
number
"
,
"
group
"
],
name
=
"
number_uniq_per_group
"
),
models
.
UniqueConstraint
(
fields
=
[
"
number
"
,
"
group
"
],
name
=
"
number_uniq_per_group
"
),
models
.
CheckConstraint
(
models
.
CheckConstraint
(
check
=
(
Q
(
for_object_id__isnull
=
True
)
|
Q
(
person__isnull
=
True
)),
check
=
(
(
Q
(
for_object_id__isnull
=
True
)
&
Q
(
person__isnull
=
False
))
|
(
Q
(
for_object_id__isnull
=
False
)
&
Q
(
person__isnull
=
True
))
),
name
=
"
object_or_person
"
,
name
=
"
object_or_person
"
,
),
),
]
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment