diff --git a/CHANGELOG.md b/CHANGELOG.md
index 00ffc0c..0c8470c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file.
+## [0.6.4.1] - 2020-03-06
+
+### FIXED
+
+- Fix local_customer filtering by name
+- Fix setting tenant to conection instead of schema_name
+- Fix default REALM_CONNECTION_DECORATOR
+- Fix installation requirements of extra tenant package
+
+
## [0.6.4] - 2020-02-26
### ADDED
@@ -41,3 +51,4 @@ All notable changes to this project will be documented in this file.
[0.6.0]: https://github.com/weltlink/django-quickbooks/compare/0.5...0.6
[0.6.3]: https://github.com/weltlink/django-quickbooks/compare/0.6...0.6.3
[0.6.4]: https://github.com/weltlink/django-quickbooks/compare/0.6.3...0.6.4
+[0.6.4.1]: https://github.com/weltlink/django-quickbooks/compare/0.6.4...0.6.4.1
diff --git a/README.md b/README.md
index b581e2c..5b0b38c 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ integration support for Python 3.6+ and Django 2.0+
-| Version: | 0.6.4 |
+| Version: | 0.6.4.1 |
|-----------|--------------------------------------------------------------------------------------------------------------------|
| Download: | https://pypi.org/project/django-quickbooks/ |
| Source: | https://github.com/weltlink/django-quickbooks/ |
diff --git a/django_quickbooks/decorators.py b/django_quickbooks/decorators.py
index 2d23a37..fdcfdfc 100644
--- a/django_quickbooks/decorators.py
+++ b/django_quickbooks/decorators.py
@@ -17,7 +17,13 @@ def connect(realm, *args, **kwargs):
def base_realm_tenant_connection(func):
def connect(realm, *args, **kwargs):
if hasattr(realm, 'schema_name') and hasattr(connection, 'set_schema'):
- connection.set_schema(realm.schema_name)
+ try:
+ from django_tenants.utils import get_tenant_model
+ connection.set_tenant(get_tenant_model().objects.get(schema_name=realm.schema_name))
+ except ImportError:
+ raise ModuleNotFoundError(
+ 'django-tenants package is not installed: pip install django-quickbooks[tenant]'
+ )
return func(realm, *args, **kwargs)
return connect
diff --git a/django_quickbooks/processors/customer.py b/django_quickbooks/processors/customer.py
index a5ae132..36f7538 100644
--- a/django_quickbooks/processors/customer.py
+++ b/django_quickbooks/processors/customer.py
@@ -20,7 +20,7 @@ def process(self, realm):
local_customer = None
if customer.ListID:
local_customer = self.find_by_list_id(customer.ListID)
- elif not local_customer and customer.Name:
+ if not local_customer and customer.Name:
local_customer = self.find_by_name(customer.Name)
if local_customer:
diff --git a/django_quickbooks/settings.py b/django_quickbooks/settings.py
index eaea123..ad244a1 100644
--- a/django_quickbooks/settings.py
+++ b/django_quickbooks/settings.py
@@ -14,7 +14,7 @@
'REALM_SESSION_MODEL_CLASS': 'django_quickbooks.models.RealmSession',
'QBD_TASK_MODEL_CLASS': 'django_quickbooks.models.QBDTask',
- 'REALM_CONNECTION_DECORATOR': 'django_quickbooks.decorators.base_realm_tenant_connection',
+ 'REALM_CONNECTION_DECORATOR': 'django_quickbooks.decorators.base_realm_connection',
'RESPONSE_PROCESSORS': (
'django_quickbooks.processors.CustomerQueryResponseProcessor',
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 716f486..dd1dcfd 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -22,7 +22,7 @@
author = 'Bedilbek Khamidov'
# The full version, including alpha/beta/rc tags
-release = '0.6.4'
+release = '0.6.4.1'
# -- General configuration ---------------------------------------------------
diff --git a/setup.cfg b/setup.cfg
index 27d7b37..0468692 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,29 @@
[metadata]
name = django-quickbooks
-version = 0.6.4
+version = 0.6.4.1
description = A Django app to integrate with quickbooks.
url = https://github.com/weltlink/django-quickbooks
author = Bedilbek Khamidov
author_email = bedilbek@gmail.com
license = Mozilla Public License 2.0
+keywords =
+ django
+ django-quickbooks
+ intuit
+ quickbooks
+ quickbooks-django
+ quickbooks-desktop
+ quickbooks-online
+ quickbooks-web-connector
+ qwc
+ qb
+ qbwc
+ web-connector
+ integration
+ soap-server
+ spyne
+ lxml
+
classifiers =
Environment :: Web Environment
Framework :: Django
@@ -34,4 +52,4 @@ install_requires =
[options.extras_require]
rabbit = pika>=1.1.0
celery = celery==4.3.0
-tenant = django-tenant-schemas==1.10.0
+tenant = django-tenants==2.2.3