-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #174] sketched use of agreement and resources
- Loading branch information
Showing
10 changed files
with
153 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 25 additions & 17 deletions
42
...ing/estimation_of_resource_consumption.py → koalixcrm/crm/reporting/agreement.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from django.db import models | ||
from django.utils.translation import ugettext as _ | ||
from django.contrib import admin | ||
from rest_framework import serializers | ||
|
||
|
||
class AgreementStatus(models.Model): | ||
title = models.CharField(verbose_name=_("Title"), | ||
max_length=250, | ||
blank=False, | ||
null=False) | ||
description = models.TextField(verbose_name=_("Text"), | ||
blank=True, | ||
null=True) | ||
is_agreed = models.BooleanField(verbose_name=_("Status represents agreement exists"),) | ||
|
||
class Meta: | ||
app_label = "crm" | ||
verbose_name = _('Agreement Status') | ||
verbose_name_plural = _('Agreement Status') | ||
|
||
def __str__(self): | ||
return str(self.id) + " " + str(self.title) | ||
|
||
|
||
class OptionProjectStatus(admin.ModelAdmin): | ||
list_display = ('id', | ||
'title', | ||
'description', | ||
'is_agreed') | ||
|
||
fieldsets = ( | ||
(_('Agreement Status'), { | ||
'fields': ('title', | ||
'description', | ||
'is_agreed') | ||
}), | ||
) | ||
save_as = True | ||
|
||
|
||
class AgreementStatusJSONSerializer(serializers.HyperlinkedModelSerializer): | ||
class Meta: | ||
model = AgreementStatus | ||
fields = ('id', | ||
'title', | ||
'description',) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from django.db import models | ||
from django.utils.translation import ugettext as _ | ||
from django.contrib import admin | ||
|
||
|
||
class AgreementType(models.Model): | ||
title = models.CharField(verbose_name=_("Title"), max_length=300, blank=False, null=False) | ||
description = models.TextField(verbose_name=_("Text"), blank=True, null=True) | ||
|
||
class Meta: | ||
app_label = "crm" | ||
verbose_name = _('Agreement Type') | ||
verbose_name_plural = _('Agreement Type') | ||
|
||
def __str__(self): | ||
return _("Agreement Type") + " ID: " + str(self.id) + " title: " + str(self.title) | ||
|
||
|
||
class OptionAgreementType(admin.ModelAdmin): | ||
list_display = ('id', | ||
'title', | ||
'description') | ||
|
||
fieldsets = ( | ||
(_('AgreementType'), { | ||
'fields': ('title', | ||
'description') | ||
}), | ||
) | ||
save_as = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from django.db import models | ||
from django.forms import ValidationError | ||
from django.contrib import admin | ||
from django.utils.html import format_html | ||
from django.utils.translation import ugettext as _ | ||
from koalixcrm.crm.documents.pdf_export import PDFExport | ||
from koalixcrm.global_support_functions import * | ||
from koalixcrm.crm.exceptions import ReportingPeriodDoneDeleteNotPossible | ||
from django.contrib import messages | ||
|
||
|
||
class Resource(models.Model): | ||
default_cost | ||
ressource_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from django.db import models | ||
from django.forms import ValidationError | ||
from django.contrib import admin | ||
from django.utils.html import format_html | ||
from django.utils.translation import ugettext as _ | ||
from koalixcrm.crm.documents.pdf_export import PDFExport | ||
from koalixcrm.global_support_functions import * | ||
from koalixcrm.crm.exceptions import ReportingPeriodDoneDeleteNotPossible | ||
from django.contrib import messages | ||
|
||
|
||
class ResourceManager(models.Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters