update
This commit is contained in:
parent
6ad4350183
commit
aefa8a6881
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@
|
||||
__pycache__
|
||||
**/*__pycache__
|
||||
db.sqlite
|
||||
db.sqlite3
|
||||
media
|
||||
car_inventory/settings.py
|
||||
# Backup files #
|
||||
|
||||
@ -121,7 +121,7 @@ urlpatterns = [
|
||||
path('coa_accounts/<uuid:pk>/delete/', views.account_delete, name='account_delete'),
|
||||
# Estimate
|
||||
path('sales/estimates/', views.EstimateListView.as_view(), name='estimate_list'),
|
||||
path('estimates/<uuid:pk>/', views.EstimateDetailView.as_view(), name='estimate_detail'),
|
||||
path('sales/estimates/<uuid:pk>/', views.EstimateDetailView.as_view(), name='estimate_detail'),
|
||||
path('sales/estimates/create/', views.create_estimate, name='estimate_create'),
|
||||
]
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.contrib.auth.models import Group
|
||||
from .utils import get_calculations
|
||||
from django.contrib.auth.models import User
|
||||
from allauth.account import views
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
@ -1637,10 +1638,11 @@ class EstimateCreateView(LoginRequiredMixin, SuccessMessageMixin, CreateView):
|
||||
form.instance.entity = self.request.user.dealer.entity
|
||||
return super().form_valid(form)
|
||||
|
||||
@csrf_exempt
|
||||
# @csrf_exempt
|
||||
@login_required
|
||||
def create_estimate(request):
|
||||
entity = request.user.dealer.entity
|
||||
|
||||
print(entity)
|
||||
if request.method == 'POST':
|
||||
try:
|
||||
data = json.loads(request.body)
|
||||
|
||||
@ -560,13 +560,8 @@
|
||||
<!-- ===============================================-->
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% block extra_js %}{% endblock extra_js %}
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// Function to calculate Total Cost and Total Revenue
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user