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