Added service metric and match descriptions and fixed domain slaves without master

This commit is contained in:
Marc 2014-10-21 11:22:31 +00:00
parent 8f27720c69
commit ed0e51b73f
7 changed files with 19 additions and 15 deletions

View File

@ -33,7 +33,7 @@ ACCOUNTS_CREATE_RELATED = getattr(settings, 'ACCOUNTS_CREATE_RELATED', (
'password': 'account.password', 'password': 'account.password',
'is_main': 'True', 'is_main': 'True',
}, },
_("Designates whether to creates a related system users with the same username and password or not."), _("Designates whether to creates a related system user with the same username and password or not."),
), ),
('mailboxes.Mailbox', ('mailboxes.Mailbox',
'name', 'name',

View File

@ -8,6 +8,8 @@ CONTACTS_DEFAULT_EMAIL_USAGES = getattr(settings, 'CONTACTS_DEFAULT_EMAIL_USAGES
CONTACTS_DEFAULT_CITY = getattr(settings, 'CONTACTS_DEFAULT_CITY', 'Barcelona') CONTACTS_DEFAULT_CITY = getattr(settings, 'CONTACTS_DEFAULT_CITY', 'Barcelona')
CONTACTS_DEFAULT_PROVINCE = getattr(settings, 'CONTACTS_DEFAULT_PROVINCE', 'Barcelona') CONTACTS_DEFAULT_PROVINCE = getattr(settings, 'CONTACTS_DEFAULT_PROVINCE', 'Barcelona')
CONTACTS_DEFAULT_COUNTRY = getattr(settings, 'CONTACTS_DEFAULT_COUNTRY', 'Spain') CONTACTS_DEFAULT_COUNTRY = getattr(settings, 'CONTACTS_DEFAULT_COUNTRY', 'Spain')

View File

@ -1,7 +1,6 @@
from django.conf import settings from django.conf import settings
DATABASES_TYPE_CHOICES = getattr(settings, 'DATABASES_TYPE_CHOICES', ( DATABASES_TYPE_CHOICES = getattr(settings, 'DATABASES_TYPE_CHOICES', (
('mysql', 'MySQL'), ('mysql', 'MySQL'),
('postgres', 'PostgreSQL'), ('postgres', 'PostgreSQL'),

View File

@ -32,6 +32,7 @@ MAILBOXES_VIRTUAL_ALIAS_DOMAINS_PATH = getattr(settings, 'MAILBOXES_VIRTUAL_ALIA
MAILBOXES_VIRTUAL_MAILBOX_DEFAULT_DOMAIN = getattr(settings, 'MAILBOXES_VIRTUAL_MAILBOX_DEFAULT_DOMAIN', MAILBOXES_VIRTUAL_MAILBOX_DEFAULT_DOMAIN = getattr(settings, 'MAILBOXES_VIRTUAL_MAILBOX_DEFAULT_DOMAIN',
'orchestra.lan') 'orchestra.lan')
MAILBOXES_PASSWD_PATH = getattr(settings, 'MAILBOXES_PASSWD_PATH', MAILBOXES_PASSWD_PATH = getattr(settings, 'MAILBOXES_PASSWD_PATH',
'/etc/dovecot/passwd') '/etc/dovecot/passwd')

View File

@ -18,9 +18,12 @@ from .handlers import ServiceHandler
class Plan(models.Model): class Plan(models.Model):
name = models.CharField(_("plan"), max_length=128) name = models.CharField(_("plan"), max_length=128)
is_default = models.BooleanField(_("default"), default=False) is_default = models.BooleanField(_("default"), default=False,
is_combinable = models.BooleanField(_("combinable"), default=True) help_text=_("Designates whether this plan is used by default or not."))
allow_multiple = models.BooleanField(_("allow multiple"), default=False) is_combinable = models.BooleanField(_("combinable"), default=True,
help_text=_("Designates whether this plan can be combined with other plans or not."))
allow_multiple = models.BooleanField(_("allow multiple"), default=False,
help_text=_("Designates whether this plan allow for multiple contractions."))
def __unicode__(self): def __unicode__(self):
return self.name return self.name
@ -120,10 +123,10 @@ class Service(models.Model):
choices=ServiceHandler.get_plugin_choices()) choices=ServiceHandler.get_plugin_choices())
is_active = models.BooleanField(_("active"), default=True) is_active = models.BooleanField(_("active"), default=True)
ignore_superusers = models.BooleanField(_("ignore superusers"), default=True, ignore_superusers = models.BooleanField(_("ignore superusers"), default=True,
help_text=_("Designates whether superuser orders are marked as ignored by default or not")) help_text=_("Designates whether superuser orders are marked as ignored by default or not."))
# Billing # Billing
billing_period = models.CharField(_("billing period"), max_length=16, billing_period = models.CharField(_("billing period"), max_length=16,
help_text=_("Renewal period for recurring invoicing"), help_text=_("Renewal period for recurring invoicing."),
choices=( choices=(
(NEVER, _("One time service")), (NEVER, _("One time service")),
(MONTHLY, _("Monthly billing")), (MONTHLY, _("Monthly billing")),
@ -158,8 +161,7 @@ class Service(models.Model):
tax = models.PositiveIntegerField(_("tax"), choices=settings.SERVICES_SERVICE_TAXES, tax = models.PositiveIntegerField(_("tax"), choices=settings.SERVICES_SERVICE_TAXES,
default=settings.SERVICES_SERVICE_DEFAUL_TAX) default=settings.SERVICES_SERVICE_DEFAUL_TAX)
pricing_period = models.CharField(_("pricing period"), max_length=16, pricing_period = models.CharField(_("pricing period"), max_length=16,
help_text=_("Period used for calculating the metric used on the " help_text=_("Time period that is used for computing the rate metric."),
"pricing rate"),
choices=( choices=(
(BILLING_PERIOD, _("Same as billing period")), (BILLING_PERIOD, _("Same as billing period")),
(MONTHLY, _("Monthly data")), (MONTHLY, _("Monthly data")),
@ -167,14 +169,14 @@ class Service(models.Model):
), ),
default=BILLING_PERIOD) default=BILLING_PERIOD)
rate_algorithm = models.CharField(_("rate algorithm"), max_length=16, rate_algorithm = models.CharField(_("rate algorithm"), max_length=16,
help_text=_("Algorithm used to interprete the rating table"), help_text=_("Algorithm used to interprete the rating table."),
choices=( choices=(
(STEP_PRICE, _("Step price")), (STEP_PRICE, _("Step price")),
(MATCH_PRICE, _("Match price")), (MATCH_PRICE, _("Match price")),
), ),
default=STEP_PRICE) default=STEP_PRICE)
on_cancel = models.CharField(_("on cancel"), max_length=16, on_cancel = models.CharField(_("on cancel"), max_length=16,
help_text=_("Defines the cancellation behaviour of this service"), help_text=_("Defines the cancellation behaviour of this service."),
choices=( choices=(
(NOTHING, _("Nothing")), (NOTHING, _("Nothing")),
(DISCOUNT, _("Discount")), (DISCOUNT, _("Discount")),
@ -184,7 +186,7 @@ class Service(models.Model):
default=DISCOUNT) default=DISCOUNT)
payment_style = models.CharField(_("payment style"), max_length=16, payment_style = models.CharField(_("payment style"), max_length=16,
help_text=_("Designates whether this service should be paid after " help_text=_("Designates whether this service should be paid after "
"consumtion (postpay/on demand) or prepaid"), "consumtion (postpay/on demand) or prepaid."),
choices=( choices=(
(PREPAY, _("Prepay")), (PREPAY, _("Prepay")),
(POSTPAY, _("Postpay (on demand)")), (POSTPAY, _("Postpay (on demand)")),

View File

@ -4,14 +4,13 @@ from django.utils.translation import ugettext_lazy as _
SERVICES_SERVICE_TAXES = getattr(settings, 'SERVICES_SERVICE_TAXES', ( SERVICES_SERVICE_TAXES = getattr(settings, 'SERVICES_SERVICE_TAXES', (
(0, _("Duty free")), (0, _("Duty free")),
(7, _("7%")), (21, "21%"),
(21, _("21%")),
)) ))
SERVICES_SERVICE_DEFAUL_TAX = getattr(settings, 'ORDERS_SERVICE_DFAULT_TAX', 0) SERVICES_SERVICE_DEFAUL_TAX = getattr(settings, 'ORDERS_SERVICE_DFAULT_TAX', 0)
SERVICES_SERVICE_ANUAL_BILLING_MONTH = getattr(settings, 'SERVICES_SERVICE_ANUAL_BILLING_MONTH', 4) SERVICES_SERVICE_ANUAL_BILLING_MONTH = getattr(settings, 'SERVICES_SERVICE_ANUAL_BILLING_MONTH', 1)
SERVICES_ORDER_MODEL = getattr(settings, 'SERVICES_ORDER_MODEL', 'orders.Order') SERVICES_ORDER_MODEL = getattr(settings, 'SERVICES_ORDER_MODEL', 'orders.Order')

View File

@ -196,6 +196,7 @@ WEBAPPS_PHP_DISABLED_FUNCTIONS = getattr(settings, 'WEBAPPS_PHP_DISABLED_FUNCTIO
]) ])
# TODO
WEBAPPS_WORDPRESSMU_BASE_URL = getattr(settings, 'WEBAPPS_WORDPRESSMU_BASE_URL', WEBAPPS_WORDPRESSMU_BASE_URL = getattr(settings, 'WEBAPPS_WORDPRESSMU_BASE_URL',
'http://blogs.example.com') 'http://blogs.example.com')