mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 15:41:10 +00:00
Set initial value fields to disabled for some forms
- Prevent user from changing certain fields - Only when a form is launched from a particular view
This commit is contained in:
@@ -98,11 +98,18 @@ $(document).ready(function () {
|
||||
launchModalForm("#modal-form", "{% url 'part-edit' part.id %}");
|
||||
});
|
||||
|
||||
{% if part.category %}
|
||||
var partRedirect = "{% url 'category-detail' part.category.id %}";
|
||||
{% else %}
|
||||
var partRedirect = "{% url 'part-index' %}";
|
||||
{% endif %}
|
||||
|
||||
$('#delete-part').click(function() {
|
||||
launchDeleteForm("#modal-delete",
|
||||
"{% url 'part-delete' part.id %}",
|
||||
{redirect: "{% url 'part-index' %}"}
|
||||
);
|
||||
{
|
||||
redirect: partRedirect
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user