diff --git a/InvenTree/company/templates/company/detail_manufacturer_part.html b/InvenTree/company/templates/company/detail_manufacturer_part.html index 902d456eaf..9916d597ed 100644 --- a/InvenTree/company/templates/company/detail_manufacturer_part.html +++ b/InvenTree/company/templates/company/detail_manufacturer_part.html @@ -71,7 +71,7 @@ field: 'manufacturer', label: '{% trans "New Manufacturer" %}', title: '{% trans "Create new Manufacturer" %}', - url: "{% url 'manufacturer-create' %}", + //url: "{% url 'manufacturer-create' %}", }, ] }); diff --git a/InvenTree/company/templates/company/detail_supplier_part.html b/InvenTree/company/templates/company/detail_supplier_part.html index bf92f96843..d12e53aeca 100644 --- a/InvenTree/company/templates/company/detail_supplier_part.html +++ b/InvenTree/company/templates/company/detail_supplier_part.html @@ -71,7 +71,7 @@ field: 'supplier', label: "{% trans 'New Supplier' %}", title: "{% trans 'Create new Supplier' %}", - url: "{% url 'supplier-create' %}", + // url: "{% url 'supplier-create' %}", }, ] }); diff --git a/InvenTree/company/templates/company/manufacturer_part_suppliers.html b/InvenTree/company/templates/company/manufacturer_part_suppliers.html index 9f445ec215..440d43d646 100644 --- a/InvenTree/company/templates/company/manufacturer_part_suppliers.html +++ b/InvenTree/company/templates/company/manufacturer_part_suppliers.html @@ -81,7 +81,7 @@ $('#supplier-create').click(function () { field: 'supplier', label: '{% trans "New Supplier" %}', title: '{% trans "Create new supplier" %}', - url: "{% url 'supplier-create' %}" + // url: "{% url 'supplier-create' %}" }, ] }); diff --git a/InvenTree/company/urls.py b/InvenTree/company/urls.py index 51aa81f1c7..0aa4d39364 100644 --- a/InvenTree/company/urls.py +++ b/InvenTree/company/urls.py @@ -8,7 +8,6 @@ from . import views company_detail_urls = [ - url(r'edit/?', views.CompanyEdit.as_view(), name='company-edit'), url(r'delete/?', views.CompanyDelete.as_view(), name='company-delete'), # url(r'orders/?', views.CompanyDetail.as_view(template_name='company/orders.html'), name='company-detail-orders'), @@ -31,11 +30,6 @@ company_detail_urls = [ company_urls = [ - url(r'new/supplier/', views.CompanyCreate.as_view(), name='supplier-create'), - url(r'new/manufacturer/', views.CompanyCreate.as_view(), name='manufacturer-create'), - url(r'new/customer/', views.CompanyCreate.as_view(), name='customer-create'), - url(r'new/?', views.CompanyCreate.as_view(), name='company-create'), - url(r'^(?P\d+)/', include(company_detail_urls)), url(r'suppliers/', views.CompanyIndex.as_view(), name='supplier-index'), diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index c42e3e2465..7d8440f9de 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -246,61 +246,6 @@ class CompanyImage(AjaxUpdateView): } -class CompanyCreate(AjaxCreateView): - """ - View for creating a new Company object - """ - - model = Company - context_object_name = 'company' - form_class = EditCompanyForm - ajax_template_name = 'modal_form.html' - permission_required = 'company.add_company' - - def get_form_title(self): - - url = self.request.path - - if url == reverse('supplier-create'): - return _("Create new Supplier") - - if url == reverse('manufacturer-create'): - return _('Create new Manufacturer') - - if url == reverse('customer-create'): - return _('Create new Customer') - - return _('Create new Company') - - def get_initial(self): - """ Initial values for the form data """ - initials = super().get_initial().copy() - - url = self.request.path - - if url == reverse('supplier-create'): - initials['is_supplier'] = True - initials['is_customer'] = False - initials['is_manufacturer'] = False - - elif url == reverse('manufacturer-create'): - initials['is_manufacturer'] = True - initials['is_supplier'] = True - initials['is_customer'] = False - - elif url == reverse('customer-create'): - initials['is_customer'] = True - initials['is_manufacturer'] = False - initials['is_supplier'] = False - - return initials - - def get_data(self): - return { - 'success': _("Created new company"), - } - - class CompanyDelete(AjaxDeleteView): """ View for deleting a Company object """ diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index a2a5d5d0fa..3eec3d3a2f 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -184,7 +184,7 @@ $("#po-create").click(function() { field: 'supplier', label: '{% trans "New Supplier" %}', title: '{% trans "Create new Supplier" %}', - url: '{% url "supplier-create" %}', + // url: '{% url "supplier-create" %}', } ] } diff --git a/InvenTree/order/templates/order/sales_orders.html b/InvenTree/order/templates/order/sales_orders.html index 448ab4b095..2cec25b3d2 100644 --- a/InvenTree/order/templates/order/sales_orders.html +++ b/InvenTree/order/templates/order/sales_orders.html @@ -186,7 +186,7 @@ $("#so-create").click(function() { field: 'customer', label: '{% trans "New Customer" %}', title: '{% trans "Create new Customer" %}', - url: '{% url "customer-create" %}', + // url: '{% url "customer-create" %}', } ] } diff --git a/InvenTree/part/templates/part/manufacturer.html b/InvenTree/part/templates/part/manufacturer.html index 82f02ba85f..4460ad9fe2 100644 --- a/InvenTree/part/templates/part/manufacturer.html +++ b/InvenTree/part/templates/part/manufacturer.html @@ -51,7 +51,7 @@ field: 'manufacturer', label: '{% trans "New Manufacturer" %}', title: '{% trans "Create new manufacturer" %}', - url: "{% url 'manufacturer-create' %}", + // url: "{% url 'manufacturer-create' %}", } ] }); diff --git a/InvenTree/part/templates/part/supplier.html b/InvenTree/part/templates/part/supplier.html index 45d2d1d55c..7959bb79bb 100644 --- a/InvenTree/part/templates/part/supplier.html +++ b/InvenTree/part/templates/part/supplier.html @@ -49,13 +49,13 @@ field: 'supplier', label: '{% trans "New Supplier" %}', title: '{% trans "Create new supplier" %}', - url: "{% url 'supplier-create' %}" + // url: "{% url 'supplier-create' %}" }, { field: 'manufacturer', label: '{% trans "New Manufacturer" %}', title: '{% trans "Create new manufacturer" %}', - url: "{% url 'manufacturer-create' %}", + // url: "{% url 'manufacturer-create' %}", } ] });