Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#347 update django32 #348

Merged
merged 18 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cd58141
[Issue #347] Updated libraries to be compatible with Python V3.8 and …
ria-htkw Mar 29, 2024
668ab0b
[Issue #347] Fixed two migration files to be compatible with the sele…
ria-htkw Mar 29, 2024
4e86024
Merge branch 'development' into #347_UpdateDjango32
scaphilo Mar 29, 2024
c7b5dd0
[Issue #347] Removed obsolete travis.yml and updated obsolete transla…
ria-htkw Mar 29, 2024
0ba4ce7
[Issue #347] Add new required migration files
ria-htkw Mar 29, 2024
16dcc33
[Issue #347] updated and simplified the requirements.txt, updated the…
ria-htkw Mar 30, 2024
5163910
[Issue #347] removed obsolete settings and improved security of the p…
ria-htkw Mar 30, 2024
cec0ae5
[Issue #347] updated the test dependencies
ria-htkw Mar 30, 2024
ae26d5f
Create django.yml
scaphilo Mar 30, 2024
f4472de
[Issue #347] fixed most testcases
ria-htkw Mar 30, 2024
dbbcba8
[Issue #347] defined more branches to be equipped with the actions
ria-htkw Mar 30, 2024
aa068f1
[Issue #347] repaired and refactored many of the testcases
ria-htkw Mar 31, 2024
0ec83fc
Update README.md
scaphilo Mar 31, 2024
26880bd
[Issue #347] repaired all remaining testcases, updated with cobertura…
ria-htkw Mar 31, 2024
f3804d7
[Issue #347] updated with cobertura coverage report and push to codacy
ria-htkw Mar 31, 2024
f15be69
[Issue #347] updated with cobertura coverage report and push to codac…
ria-htkw Mar 31, 2024
392fa2e
Update README.md
scaphilo Mar 31, 2024
b9cc50a
[Issue #347] updated version and production settings
ria-htkw Mar 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading