mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Revert "Add extra context to SupplierPartCreate form"
This reverts commit 5f8f0232a9d556b6c6622ce6efa9488efd7eed68.
This commit is contained in:
parent
5f8f0232a9
commit
50a88e4826
@ -1,17 +0,0 @@
|
|||||||
{% extends "modal_form.html" %}
|
|
||||||
|
|
||||||
{% load i18n %}
|
|
||||||
|
|
||||||
{% block pre_form_content %}
|
|
||||||
{{ block.super }}
|
|
||||||
|
|
||||||
{% if part %}
|
|
||||||
<div class='alert alert-block alert-info'>
|
|
||||||
{% include "hover_image.html" with image=part.image %}
|
|
||||||
{{ part.full_name}}
|
|
||||||
<br>
|
|
||||||
<i>{{ part.description }}</i>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -291,7 +291,7 @@ class SupplierPartCreate(AjaxCreateView):
|
|||||||
|
|
||||||
model = SupplierPart
|
model = SupplierPart
|
||||||
form_class = EditSupplierPartForm
|
form_class = EditSupplierPartForm
|
||||||
ajax_template_name = 'company/supplier_part_create.html'
|
ajax_template_name = 'modal_form.html'
|
||||||
ajax_form_title = _('Create new Supplier Part')
|
ajax_form_title = _('Create new Supplier Part')
|
||||||
context_object_name = 'part'
|
context_object_name = 'part'
|
||||||
role_required = 'purchase_order.add'
|
role_required = 'purchase_order.add'
|
||||||
@ -304,27 +304,6 @@ class SupplierPartCreate(AjaxCreateView):
|
|||||||
# TODO - What validation steps can be performed on the single_pricing field?
|
# TODO - What validation steps can be performed on the single_pricing field?
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_context_data(self):
|
|
||||||
"""
|
|
||||||
Supply context data to the form
|
|
||||||
"""
|
|
||||||
|
|
||||||
ctx = super().get_context_data()
|
|
||||||
|
|
||||||
# Add 'part' object
|
|
||||||
form = self.get_form()
|
|
||||||
|
|
||||||
part = form['part'].value()
|
|
||||||
|
|
||||||
try:
|
|
||||||
part = Part.objects.get(pk=part)
|
|
||||||
except (ValueError, Part.DoesNotExist):
|
|
||||||
part = None
|
|
||||||
|
|
||||||
ctx['part'] = part
|
|
||||||
|
|
||||||
return ctx
|
|
||||||
|
|
||||||
def save(self, form):
|
def save(self, form):
|
||||||
"""
|
"""
|
||||||
If single_pricing is defined, add a price break for quantity=1
|
If single_pricing is defined, add a price break for quantity=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user