Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
5
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
e23eafd5
Commit
e23eafd5
authored
4 years ago
by
ynerant
Browse files
Options
Downloads
Patches
Plain Diff
Add invoices in Django Admin
parent
3e28ed87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!104
Beta
,
!98
Morefront
,
!91
Documents
Pipeline
#8385
passed with warnings with stages
in 5 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/treasury/admin.py
+19
-1
19 additions, 1 deletion
apps/treasury/admin.py
apps/treasury/models.py
+1
-1
1 addition, 1 deletion
apps/treasury/models.py
with
20 additions
and
2 deletions
apps/treasury/admin.py
+
19
−
1
View file @
e23eafd5
...
...
@@ -3,8 +3,9 @@
from
django.contrib
import
admin
from
note_kfet.admin
import
admin_site
from
.forms
import
ProductForm
from
.models
import
RemittanceType
,
Remittance
,
SogeCredit
from
.models
import
RemittanceType
,
Remittance
,
SogeCredit
,
Invoice
,
Product
@admin.register
(
RemittanceType
,
site
=
admin_site
)
...
...
@@ -39,3 +40,20 @@ class SogeCreditAdmin(admin.ModelAdmin):
def
has_add_permission
(
self
,
request
):
# Don't create a credit manually
return
False
class
ProductInline
(
admin
.
StackedInline
):
"""
Inline product in invoice admin
"""
model
=
Product
form
=
ProductForm
@admin.register
(
Invoice
,
site
=
admin_site
)
class
InvoiceAdmin
(
admin
.
ModelAdmin
):
"""
Admin customisation for Invoice
"""
list_display
=
(
'
object
'
,
'
id
'
,
'
bde
'
,
'
name
'
,
'
date
'
,
'
acquitted
'
,)
inlines
=
(
ProductInline
,)
This diff is collapsed.
Click to expand it.
apps/treasury/models.py
+
1
−
1
View file @
e23eafd5
...
...
@@ -55,7 +55,7 @@ class Invoice(models.Model):
date
=
models
.
DateField
(
default
=
timezone
.
now
,
verbose_name
=
_
(
"
Plac
e
"
),
verbose_name
=
_
(
"
Dat
e
"
),
)
acquitted
=
models
.
BooleanField
(
...
...
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