update
@ -29,7 +29,6 @@ DEBUG = True
|
|||||||
ALLOWED_HOSTS = ['10.10.1.109', 'localhost', '127.0.0.1', '192.168.1.109', '172.20.10.4']
|
ALLOWED_HOSTS = ['10.10.1.109', 'localhost', '127.0.0.1', '192.168.1.109', '172.20.10.4']
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'django.contrib.sites',
|
'django.contrib.sites',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
@ -40,8 +39,6 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'inventory.apps.InventoryConfig',
|
'inventory.apps.InventoryConfig',
|
||||||
'api.apps.ApiConfig',
|
'api.apps.ApiConfig',
|
||||||
|
|
||||||
# Other Apps to select what we need before deploy
|
|
||||||
'allauth',
|
'allauth',
|
||||||
'allauth.account',
|
'allauth.account',
|
||||||
'allauth.socialaccount',
|
'allauth.socialaccount',
|
||||||
@ -62,7 +59,6 @@ INSTALLED_APPS = [
|
|||||||
'djmoney',
|
'djmoney',
|
||||||
'sslserver',
|
'sslserver',
|
||||||
'haikalbot',
|
'haikalbot',
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
@ -138,7 +134,6 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Authentications
|
# Authentications
|
||||||
|
|
||||||
LOGIN_REDIRECT_URL = '/'
|
LOGIN_REDIRECT_URL = '/'
|
||||||
ACCOUNT_LOGOUT_REDIRECT_URL = '/'
|
ACCOUNT_LOGOUT_REDIRECT_URL = '/'
|
||||||
ACCOUNT_EMAIL_VERIFICATION = "none"
|
ACCOUNT_EMAIL_VERIFICATION = "none"
|
||||||
@ -151,19 +146,12 @@ AUTHENTICATION_BACKENDS = [
|
|||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'DEFAULT_AUTHENTICATION_CLASSES': [
|
'DEFAULT_AUTHENTICATION_CLASSES': [
|
||||||
'rest_framework.authentication.TokenAuthentication',
|
'rest_framework.authentication.TokenAuthentication',
|
||||||
# 'rest_framework.authentication.SessionAuthentication',
|
|
||||||
# 'dj_rest_auth.jwt_auth.JWTCookieAuthentication',
|
|
||||||
],
|
],
|
||||||
'DEFAULT_PERMISSION_CLASSES': [
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
# 'rest_framework.permissions.IsAuthenticated',
|
|
||||||
'rest_framework.permissions.AllowAny',
|
'rest_framework.permissions.AllowAny',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# REST_AUTH = {
|
|
||||||
# 'USE_JWT': True,
|
|
||||||
# 'JWT_AUTH_COOKIE': 'jwt-auth',
|
|
||||||
# }
|
|
||||||
|
|
||||||
# Email backend
|
# Email backend
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||||
@ -223,24 +211,18 @@ DJANGO_TABLES2_TABLE_ATTRS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
|
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
|
||||||
|
|
||||||
CRISPY_TEMPLATE_PACK = "bootstrap5"
|
CRISPY_TEMPLATE_PACK = "bootstrap5"
|
||||||
|
|
||||||
# DEFAULT_CURRENCY = 'SAR'
|
|
||||||
|
|
||||||
# API KEYS
|
# API KEYS
|
||||||
# OPENAI (GPT)
|
# OPENAI
|
||||||
OPENAI_API_KEY = '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'
|
OPENAI_API_KEY = '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'
|
||||||
|
|
||||||
# ELM API KEYS
|
|
||||||
# vehicle-info
|
|
||||||
# c2729afb
|
|
||||||
# 6d397471920412d672af1b8a02ca52ea
|
|
||||||
|
|
||||||
# option-info
|
# option-info
|
||||||
# 367974ed
|
# 367974ed
|
||||||
# 046b0412c1b4d3f8c39ec6375d6f3030
|
# 046b0412c1b4d3f8c39ec6375d6f3030
|
||||||
|
|
||||||
|
# vehicle-info
|
||||||
|
# ELM API KEYS
|
||||||
ELM_APP_ID = 'c2729afb'
|
ELM_APP_ID = 'c2729afb'
|
||||||
ELM_APP_KEY = '6d397471920412d672af1b8a02ca52ea'
|
ELM_APP_KEY = '6d397471920412d672af1b8a02ca52ea'
|
||||||
ELM_CLIENT_ID = '94142c27-2536-47e9-8e28-9ca7728b9442'
|
ELM_CLIENT_ID = '94142c27-2536-47e9-8e28-9ca7728b9442'
|
||||||
@ -256,15 +238,16 @@ LOGGING = {
|
|||||||
'loggers': {
|
'loggers': {
|
||||||
'django': {
|
'django': {
|
||||||
'handlers': ['console'],
|
'handlers': ['console'],
|
||||||
'level': 'INFO', # Change to WARNING or ERROR as needed
|
'level': 'INFO',
|
||||||
},
|
},
|
||||||
'openai': {
|
'openai': {
|
||||||
'handlers': ['console'],
|
'handlers': ['console'],
|
||||||
'level': 'WARNING', # Suppress detailed logs from OpenAI client
|
'level': 'WARNING',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Global Settings
|
# Global Settings
|
||||||
|
DEFAULT_CURRENCY = 'SAR'
|
||||||
CURRENCY = _('SAR')
|
CURRENCY = _('SAR')
|
||||||
VAT_RATE = Decimal('0.15')
|
VAT_RATE = Decimal('0.15')
|
||||||
@ -64,10 +64,8 @@ def create_ledger_entity(sender, instance, created, **kwargs):
|
|||||||
entity = EntityModel.objects.create(
|
entity = EntityModel.objects.create(
|
||||||
name=instance.name,
|
name=instance.name,
|
||||||
admin=instance.user,
|
admin=instance.user,
|
||||||
# address_1=instance.address,
|
|
||||||
accrual_method=False,
|
accrual_method=False,
|
||||||
fy_start_month=1,
|
fy_start_month=1,
|
||||||
# depth=0,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
default_coa = entity.create_chart_of_accounts(assign_as_default=True,
|
default_coa = entity.create_chart_of_accounts(assign_as_default=True,
|
||||||
|
|||||||
@ -298,7 +298,6 @@ class CarColorCreate(LoginRequiredMixin, CreateView):
|
|||||||
def inventory_stats_view(request):
|
def inventory_stats_view(request):
|
||||||
dealer = request.user.dealer
|
dealer = request.user.dealer
|
||||||
|
|
||||||
# Annotate total cars by make, model, and trim
|
|
||||||
cars = (
|
cars = (
|
||||||
models.Car.objects.filter(dealer=dealer.get_parent_or_self)
|
models.Car.objects.filter(dealer=dealer.get_parent_or_self)
|
||||||
.select_related('id_car_make', 'id_car_model', 'id_car_trim')
|
.select_related('id_car_make', 'id_car_model', 'id_car_trim')
|
||||||
@ -316,7 +315,6 @@ def inventory_stats_view(request):
|
|||||||
inventory[make.id_car_make] = {
|
inventory[make.id_car_make] = {
|
||||||
'make_id': make.id_car_make,
|
'make_id': make.id_car_make,
|
||||||
'make_name': make.get_local_name,
|
'make_name': make.get_local_name,
|
||||||
'logo': make.logo,
|
|
||||||
'total_cars': 0,
|
'total_cars': 0,
|
||||||
'models': {}
|
'models': {}
|
||||||
}
|
}
|
||||||
@ -347,7 +345,6 @@ def inventory_stats_view(request):
|
|||||||
{
|
{
|
||||||
'make_id': make_data['make_id'],
|
'make_id': make_data['make_id'],
|
||||||
'make_name': make_data['make_name'],
|
'make_name': make_data['make_name'],
|
||||||
'logo': make_data['logo'],
|
|
||||||
'total_cars': make_data['total_cars'],
|
'total_cars': make_data['total_cars'],
|
||||||
'models': [
|
'models': [
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
static/images/.DS_Store
vendored
BIN
static/images/logos/.DS_Store
vendored
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@ -274,9 +274,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card rounded shadow mt-3">
|
<div class="card rounded shadow mt-3">
|
||||||
|
|
||||||
<p class="card-header bg-primary text-white rounded-top fw-bold">{% trans 'Colors Details' %}</p>
|
<p class="card-header bg-primary text-white rounded-top fw-bold">{% trans 'Colors Details' %}</p>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-sm table-responsive align-middle">
|
<table class="table table-sm table-responsive align-middle">
|
||||||
<tbody class="align-middle">
|
<tbody class="align-middle">
|
||||||
@ -370,10 +368,12 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<form method="POST" action="{% url 'reserve_car' car.id %}" class="d-inline">
|
<button type="button"
|
||||||
{% csrf_token %}
|
class="btn btn-sm btn-success"
|
||||||
<button type="submit" class="btn btn-success btn-sm">{% trans "Reserve" %}</button>
|
data-bs-toggle="modal"
|
||||||
</form>
|
data-bs-target="#reserveModal">
|
||||||
|
{% trans 'Reserve' %}
|
||||||
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||