Skip to content

Commit

Permalink
Merge pull request #348 from KoalixSwitzerland/#347_UpdateDjango32
Browse files Browse the repository at this point in the history
#347 update django32
  • Loading branch information
scaphilo authored Mar 31, 2024
2 parents 4c30b13 + b9cc50a commit ce80000
Show file tree
Hide file tree
Showing 118 changed files with 858 additions and 644 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Django CI

on:
push:
branches: [ "master", "development"]
pull_request:
branches: [ "master", "development" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build Docker Image
run: docker-compose build web

- name: Run Tests in Docker
run: |
docker-compose run --service-ports web coverage run -m pytest --cov=koalixcrm --cov-branch --cov-report xml:test_report/coverage.xml --cov-report term
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r test_report/coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
- name: Upload Coverage Report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: test_results/coverage.xml
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2009-2018, Aaron Riedener, Untereggen, Switzerland
Copyright (c) 2009-2024, Aaron Riedener, Untereggen, Switzerland
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
## Quality badges on master
| Project build: | Codacy results: |Docker: | Social Networks: |
| --- | --- | --- | --- |
| tbd | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/cfae578b5c174f438786c935fa425002)](https://app.codacy.com/gh/KoalixSwitzerland/koalixcrm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)| [![Docker Automated build](https://img.shields.io/docker/automated/koalixswitzerland/koalixcrm.svg)]() <br/> [![Docker Stars](https://img.shields.io/docker/stars/koalixswitzerland/koalixcrm.svg)]() [![Docker Pulls](https://img.shields.io/docker/pulls/koalixswitzerland/koalixcrm.svg)]() | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/koalix-crm/Lobby) |
| [![Django CI](https://github.com/KoalixSwitzerland/koalixcrm/actions/workflows/django.yml/badge.svg)](https://github.com/KoalixSwitzerland/koalixcrm/actions/workflows/django.yml) | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/cfae578b5c174f438786c935fa425002)](https://app.codacy.com/gh/KoalixSwitzerland/koalixcrm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) </br> [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/cfae578b5c174f438786c935fa425002)](https://app.codacy.com/gh/KoalixSwitzerland/koalixcrm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)| [![Docker Automated build](https://img.shields.io/docker/automated/koalixswitzerland/koalixcrm.svg)]() <br/> [![Docker Stars](https://img.shields.io/docker/stars/koalixswitzerland/koalixcrm.svg)]() [![Docker Pulls](https://img.shields.io/docker/pulls/koalixswitzerland/koalixcrm.svg)]() | [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/koalix-crm/Lobby) |

## Demos
[demo](http://koalixcrmdemoenglish.koalix.org/admin/).
Expand Down
16 changes: 6 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
version: '2.0'
version: '3.8'

services:
db:
image: postgres
koalixcrm:
build: .
environment:
- DJANGO_SETTINGS_MODULE=projectsettings.settings.docker_development_settings
- JAVA_HOME=/usr/bin/jdk1.8.0_181/jre
web:
image: ghcr.io/koalixswitzerland/koalixcrm-dev-container:main
ports:
- "8000:8000"
depends_on:
- db
volumes:
- .:/usr/src/app
- ./data:/usr/src/app/data
4 changes: 0 additions & 4 deletions entrypoint.prod.sh

This file was deleted.

4 changes: 0 additions & 4 deletions entrypoint.sh

This file was deleted.

3 changes: 2 additions & 1 deletion koalixcrm/accounting/accounting/account.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django import forms

from koalixcrm.accounting.const.accountTypeChoices import *
Expand All @@ -10,6 +10,7 @@


class Account(models.Model):
id = models.BigAutoField(primary_key=True)
account_number = models.IntegerField(verbose_name=_("Account Number"))
title = models.CharField(verbose_name=_("Account Title"),
max_length=50)
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/accounting/accounting/accounting_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import *
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django import forms
from koalixcrm.accounting.models import Account
from koalixcrm.crm.documents.pdf_export import PDFExport
Expand All @@ -16,6 +16,7 @@ class AccountingPeriod(models.Model):
"""Accounting period represents the equivalent of the business logic element of a fiscal year
the accounting period is referred in the booking and is used as a supporting object to generate
balance sheets and profit/loss statements"""
id = models.BigAutoField(primary_key=True)
title = models.CharField(max_length=200, verbose_name=_("Title")) # For example "Year 2009", "1st Quarter 2009"
begin = models.DateField(verbose_name=_("Begin"))
end = models.DateField(verbose_name=_("End"))
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/accounting/accounting/booking.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


class Booking(models.Model):
id = models.BigAutoField(primary_key=True)
from_account = models.ForeignKey('Account', on_delete=models.CASCADE, verbose_name=_("From Account"), related_name="db_booking_fromaccount")
to_account = models.ForeignKey('Account', on_delete=models.CASCADE, verbose_name=_("To Account"), related_name="db_booking_toaccount")
amount = models.DecimalField(max_digits=20, decimal_places=2, verbose_name=_("Amount"))
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/accounting/accounting/product_category.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from koalixcrm.accounting.models import Account


class ProductCategory(models.Model):
id = models.BigAutoField(primary_key=True)
title = models.CharField(verbose_name=_("Product Category Title"),
max_length=50)
profit_account = models.ForeignKey(Account,
Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/accounting/const/accountTypeChoices.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

ACCOUNTTYPECHOICES = (
('E', _('Earnings')),
Expand Down
33 changes: 33 additions & 0 deletions koalixcrm/accounting/migrations/0011_auto_20240329_2207.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.2.20 on 2024-03-29 22:07

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounting', '0010_auto_20181216_2224'),
]

operations = [
migrations.AlterField(
model_name='account',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='accountingperiod',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='booking',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='productcategory',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
]
2 changes: 1 addition & 1 deletion koalixcrm/accounting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.http import HttpResponseRedirect
from koalixcrm.crm.exceptions import *
from koalixcrm.djangoUserExtension.exceptions import *
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


def export_pdf(calling_model_admin, request, whereToCreateFrom, whatToCreate, redirectTo):
Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/crm/const/country.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

COUNTRIES = (
('AF', 'AFG', '004', _('Afghanistan')),
Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/crm/const/postaladdressprefix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

POSTALADDRESSPREFIX = (
('F', _('Company')),
Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/crm/const/purpose.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

PURPOSESADDRESSINCONTRACT = (
('D', _('Delivery Address')),
Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/crm/const/status.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*

from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

INVOICESTATUS = (
('P', _('Payed')),
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
from datetime import *
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.utils import timezone
from koalixcrm.crm.const.status import *


class Call(models.Model):
id = models.BigAutoField(primary_key=True)
staff = models.ForeignKey('auth.User',
on_delete=models.CASCADE,
limit_choices_to={'is_staff': True},
Expand Down
4 changes: 3 additions & 1 deletion koalixcrm/crm/contact/contact.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from koalixcrm.crm.contact.phone_address import PhoneAddress
from koalixcrm.crm.contact.email_address import EmailAddress
from koalixcrm.crm.contact.postal_address import PostalAddress
Expand All @@ -13,6 +13,7 @@


class Contact(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=300,
verbose_name=_("Name"))
date_of_creation = models.DateTimeField(verbose_name=_("Created at"),
Expand Down Expand Up @@ -128,6 +129,7 @@ class ContactEmailAddress(admin.TabularInline):


class ContactPersonAssociation(models.Model):
id = models.BigAutoField(primary_key=True)
contact = models.ForeignKey(Contact, on_delete=models.CASCADE, related_name='person_association', blank=True, null=True)
person = models.ForeignKey(Person, on_delete=models.CASCADE, related_name='contact_association', blank=True, null=True)

Expand Down
2 changes: 1 addition & 1 deletion koalixcrm/crm/contact/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.http import HttpResponseRedirect
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from koalixcrm.plugin import *
from koalixcrm.crm.contact.contact import Contact, ContactCall, ContactVisit,\
PeopleInlineAdmin, PostalAddressForContact, ContactPostalAddress, \
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/customer_billing_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


class CustomerBillingCycle(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=300,
verbose_name=_("Name"))
time_to_payment_date = models.IntegerField(verbose_name=_("Days To Payment Date"))
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/customer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


class CustomerGroup(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=300)

def __str__(self):
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/email_address.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


class EmailAddress(models.Model):
id = models.BigAutoField(primary_key=True)
email = models.EmailField(max_length=200,
verbose_name=_("Email Address"))

Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/person.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from koalixcrm.crm.const.postaladdressprefix import *


class Person(models.Model):
id = models.BigAutoField(primary_key=True)
prefix = models.CharField(max_length=1,
choices=POSTALADDRESSPREFIX,
verbose_name=_("Prefix"),
Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/phone_address.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _


class PhoneAddress(models.Model):
id = models.BigAutoField(primary_key=True)
phone = models.CharField(max_length=20,
verbose_name=_("Phone Number"))

Expand Down
3 changes: 2 additions & 1 deletion koalixcrm/crm/contact/postal_address.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from koalixcrm.crm.const.country import *
from koalixcrm.crm.const.postaladdressprefix import *


class PostalAddress(models.Model):
id = models.BigAutoField(primary_key=True)
prefix = models.CharField(max_length=1,
choices=POSTALADDRESSPREFIX,
verbose_name=_("Prefix"), blank=True,
Expand Down
Loading

0 comments on commit ce80000

Please sign in to comment.