update
This commit is contained in:
parent
8ae17c9560
commit
8714162a58
@ -50,6 +50,9 @@ class DealerUserManager(UserManager):
|
||||
return user
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class StaffUserManager(UserManager):
|
||||
def create_user_with_staff(
|
||||
self,
|
||||
@ -946,9 +949,10 @@ class Staff(models.Model, LocalizedNameMixin):
|
||||
return self.staff_member.user
|
||||
|
||||
@property
|
||||
def groups(self):
|
||||
def groups(self):
|
||||
return [x.customgroup for x in self.user.groups.all()]
|
||||
|
||||
|
||||
def clear_groups(self):
|
||||
return self.user.groups.clear()
|
||||
|
||||
|
||||
1072
inventory/views.py
1072
inventory/views.py
File diff suppressed because it is too large
Load Diff
1
static/css/nice-select2.css
Normal file
1
static/css/nice-select2.css
Normal file
@ -0,0 +1 @@
|
||||
.nice-select{-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:#fff;border-radius:5px;border:solid 1px #e8e8e8;box-sizing:border-box;clear:both;cursor:pointer;display:block;float:left;font-family:inherit;font-size:14px;font-weight:normal;height:38px;line-height:36px;outline:none;padding-left:18px;padding-right:30px;position:relative;text-align:left !important;transition:all .2s ease-in-out;user-select:none;white-space:nowrap;width:auto}.nice-select:hover{border-color:hsl(0,0%,85.9803921569%)}.nice-select:active,.nice-select.open,.nice-select:focus{border-color:#999}.nice-select:after{border-bottom:2px solid #999;border-right:2px solid #999;content:"";display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:12px;top:50%;transform-origin:66% 66%;transform:rotate(45deg);transition:all .15s ease-in-out;width:5px}.nice-select.open:after{transform:rotate(-135deg)}.nice-select.open .nice-select-dropdown{opacity:1;pointer-events:auto;transform:scale(1) translateY(0)}.nice-select.disabled{border-color:rgb(237.1,237.1,237.1);color:#999;pointer-events:none}.nice-select.disabled:after{border-color:#ccc}.nice-select.wide{width:100%}.nice-select.wide .nice-select-dropdown{left:0 !important;right:0 !important}.nice-select.right{float:right}.nice-select.right .nice-select-dropdown{left:auto;right:0}.nice-select.small{font-size:12px;height:36px;line-height:34px}.nice-select.small:after{height:4px;width:4px}.nice-select.small .option{line-height:34px;min-height:34px}.nice-select .nice-select-dropdown{margin-top:4px;background-color:#fff;border-radius:5px;box-shadow:0 0 0 1px rgba(68,68,68,.11);pointer-events:none;position:absolute;top:100%;left:0;transform-origin:50% 0;transform:scale(0.75) translateY(19px);transition:all .2s cubic-bezier(0.5, 0, 0, 1.25),opacity .15s ease-out;z-index:9;opacity:0}.nice-select .list{border-radius:5px;box-sizing:border-box;overflow:hidden;padding:0;max-height:210px;overflow-y:auto}.nice-select .list:hover .option:not(:hover){background-color:rgba(0,0,0,0) !important}.nice-select .option{cursor:pointer;font-weight:400;line-height:40px;list-style:none;outline:none;padding-left:18px;padding-right:29px;text-align:left;transition:all .2s}.nice-select .option:hover,.nice-select .option.focus,.nice-select .option.selected.focus{background-color:#f6f6f6}.nice-select .option.selected{font-weight:bold}.nice-select .option.disabled{background-color:rgba(0,0,0,0);color:#999;cursor:default}.nice-select .extra{float:right}.nice-select .optgroup{font-weight:bold}.no-csspointerevents .nice-select .nice-select-dropdown{display:none}.no-csspointerevents .nice-select.open .nice-select-dropdown{display:block}.nice-select .list::-webkit-scrollbar{width:0}.nice-select .has-multiple{white-space:inherit;height:auto;padding:7px 12px;min-height:36px;line-height:22px}.nice-select .has-multiple span.current{border:1px solid #ccc;background:#eee;padding:0 10px;border-radius:3px;display:inline-block;line-height:24px;font-size:14px;margin-bottom:3px;margin-right:3px}.nice-select .has-multiple .multiple-options{display:block;line-height:24px;padding:0}.nice-select .nice-select-search-box{box-sizing:border-box;width:100%;padding:5px;pointer-events:none;border-radius:5px 5px 0 0}.nice-select .nice-select-search{box-sizing:border-box;background-color:#fff;border:1px solid #e8e8e8;border-radius:3px;color:#444;display:inline-block;vertical-align:middle;padding:7px 12px;margin:0 10px 0 0;width:100%;min-height:36px;line-height:22px;height:auto;outline:0 !important;font-size:14px}
|
||||
1
static/js/nice-select2.js
Normal file
1
static/js/nice-select2.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,8 @@
|
||||
{% load i18n static %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<nav class="navbar navbar-vertical navbar-expand-lg">
|
||||
<div class="collapse navbar-collapse" id="navbarVerticalCollapse">
|
||||
<div class="collapse navbar-collapse" id="navbarVerticalCollapse">
|
||||
<!-- scrollbar removed-->
|
||||
<div class="navbar-vertical-content">
|
||||
<ul class="navbar-nav flex-column" id="navbarVerticalNav">
|
||||
@ -456,7 +457,9 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3 d-block" href=""> <span class="me-2 text-body align-bottom" data-feather="settings"></span>Settings & Privacy </a>
|
||||
{% if user.dealer %}
|
||||
<a class="nav-link px-3 d-block" href="{% url 'dealer_settings' user.dealer.pk %}"> <span class="me-2 text-body align-bottom" data-feather="settings"></span>Settings & Privacy </a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3 d-block" href=""> <span class="me-2 text-body align-bottom" data-feather="help-circle"></span>Help Center</a>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{% load django_ledger %}
|
||||
|
||||
{% load i18n %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
@ -16,17 +17,26 @@
|
||||
|
||||
<!-- Year Navigation -->
|
||||
<div class="text-center mb-3">
|
||||
<p class="mb-1">
|
||||
|
||||
<p class="mb-1">
|
||||
<span class="fw-bold">{{ _("Year") }}: </span>
|
||||
<a href="{{ previous_year_url }}" class="text-decoration-none me-2">
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
{% if LANGUAGE_CODE == 'ar' %}
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
{% else %}
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
{% endif %}
|
||||
{{ previous_year }}</a>
|
||||
<a href="{{ current_year_url }}" class="text-decoration-none me-2 fw-bolder">{{ year }}</a>
|
||||
<a href="{{ next_year_url }}" class="text-decoration-none">{{ next_year }}
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
{% if LANGUAGE_CODE == 'ar' %}
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
<span class="fas fa-chevron-left"> </span>
|
||||
{% else %}
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
<span class="fas fa-chevron-right"> </span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
@ -72,12 +82,5 @@
|
||||
{% trans 'Go To Current Month' %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Date Picker -->
|
||||
|
||||
|
||||
<div class="text-center ">
|
||||
{% date_picker date_navigation_url %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -87,24 +87,7 @@
|
||||
</td>
|
||||
<td>{% currency_symbol %}{{ acc.balance | reverse_sign | currency_format }}</td>
|
||||
<td>
|
||||
<div class="dropdown is-hoverable" id="account-action-{{ account.uuid }}">
|
||||
<div class="dropdown-trigger">
|
||||
<button class="button is-small is-rounded"
|
||||
aria-haspopup="true"
|
||||
aria-controls="dropdown-menu">
|
||||
<span>{% trans 'Actions' %}</span>
|
||||
<span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-menu" id="dropdown-menu-{{ acc.uuid }}" role="menu">
|
||||
<div class="dropdown-content">
|
||||
<a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
|
||||
<a href="{% url 'django_ledger:account-update' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -161,24 +144,7 @@
|
||||
</td>
|
||||
<td>{% currency_symbol %}{{ acc.balance | reverse_sign | currency_format }}</td>
|
||||
<td>
|
||||
<div class="dropdown is-hoverable" id="account-action-{{ account.uuid }}">
|
||||
<div class="dropdown-trigger">
|
||||
<button class="button is-small is-rounded"
|
||||
aria-haspopup="true"
|
||||
aria-controls="dropdown-menu">
|
||||
<span>{% trans 'Actions' %}</span>
|
||||
<span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-menu" id="dropdown-menu-{{ acc.uuid }}" role="menu">
|
||||
<div class="dropdown-content">
|
||||
<a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
|
||||
<a href="{% url 'django_ledger:account-update' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -235,24 +201,7 @@
|
||||
</td>
|
||||
<td class="is-size-5">{% currency_symbol %}{{ acc.balance | currency_format }}</td>
|
||||
<td>
|
||||
<div class="dropdown is-hoverable" id="account-action-{{ account.uuid }}">
|
||||
<div class="dropdown-trigger">
|
||||
<button class="button is-small is-rounded"
|
||||
aria-haspopup="true"
|
||||
aria-controls="dropdown-menu">
|
||||
<span>{% trans 'Actions' %}</span>
|
||||
<span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-menu" id="dropdown-menu-{{ acc.uuid }}" role="menu">
|
||||
<div class="dropdown-content">
|
||||
<a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
|
||||
<a href="{% url 'django_ledger:account-update' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -296,24 +245,7 @@
|
||||
</td>
|
||||
<td class="is-size-5">{% currency_symbol %}{{ acc.balance | reverse_sign | currency_format }}</td>
|
||||
<td>
|
||||
<div class="dropdown is-hoverable" id="account-action-{{ account.uuid }}">
|
||||
<div class="dropdown-trigger">
|
||||
<button class="button is-small is-rounded"
|
||||
aria-haspopup="true"
|
||||
aria-controls="dropdown-menu">
|
||||
<span>{% trans 'Actions' %}</span>
|
||||
<span class="icon is-small">{% icon 'bi:arrow-down' 24 %}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dropdown-menu" id="dropdown-menu-{{ acc.uuid }}" role="menu">
|
||||
<div class="dropdown-content">
|
||||
<a href="{% url 'django_ledger:account-detail' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-success">{% trans 'Detail' %}</a>
|
||||
<a href="{% url 'django_ledger:account-update' entity_slug=entity_slug coa_slug=acc.coa_slug account_pk=acc.account_uuid %}"
|
||||
class="dropdown-item has-text-warning">{% trans 'Update' %}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
{% endblock content %}
|
||||
|
||||
{% block customJS %}
|
||||
<script>
|
||||
<script>
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: "top-end",
|
||||
@ -67,7 +67,7 @@
|
||||
const newForm = document.createElement('div');
|
||||
newForm.className = 'form-row row g-3 mb-3 mt-5';
|
||||
newForm.innerHTML = `
|
||||
<div class="mb-2 col-sm-2">
|
||||
<div class="mb-2 col-sm-4">
|
||||
<select class="form-control item" name="item[]" required>
|
||||
{% for item in items %}
|
||||
<option value="{{ item.hash }}">{{ item.make }} {{item.model}} {{item.serie}} {{item.trim}} {{item.color}}</option>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user