mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 15:15:42 +00:00 
			
		
		
		
	Merge pull request #1217 from eeintech/bom_item_delete
Allow user with part.change permission to delete BOM items, part attachments and parameters
This commit is contained in:
		@@ -37,7 +37,7 @@
 | 
				
			|||||||
                    {% if roles.part.change %}
 | 
					                    {% if roles.part.change %}
 | 
				
			||||||
                    <button title='{% trans "Edit" %}' class='btn btn-default btn-glyph param-edit' url="{% url 'part-param-edit' param.id %}" type='button'><span class='fas fa-edit'/></button>
 | 
					                    <button title='{% trans "Edit" %}' class='btn btn-default btn-glyph param-edit' url="{% url 'part-param-edit' param.id %}" type='button'><span class='fas fa-edit'/></button>
 | 
				
			||||||
                    {% endif %}
 | 
					                    {% endif %}
 | 
				
			||||||
                    {% if roles.part.delete %}
 | 
					                    {% if roles.part.change %}
 | 
				
			||||||
                    <button title='{% trans "Delete" %}' class='btn btn-default btn-glyph param-delete' url="{% url 'part-param-delete' param.id %}" type='button'><span class='fas fa-trash-alt icon-red'/></button>
 | 
					                    <button title='{% trans "Delete" %}' class='btn btn-default btn-glyph param-delete' url="{% url 'part-param-delete' param.id %}" type='button'><span class='fas fa-trash-alt icon-red'/></button>
 | 
				
			||||||
                    {% endif %}
 | 
					                    {% endif %}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -231,7 +231,7 @@ class PartAttachmentDelete(AjaxDeleteView):
 | 
				
			|||||||
    ajax_template_name = "attachment_delete.html"
 | 
					    ajax_template_name = "attachment_delete.html"
 | 
				
			||||||
    context_object_name = "attachment"
 | 
					    context_object_name = "attachment"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    role_required = 'part.delete'
 | 
					    role_required = 'part.change'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_data(self):
 | 
					    def get_data(self):
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
@@ -2073,7 +2073,7 @@ class PartParameterEdit(AjaxUpdateView):
 | 
				
			|||||||
class PartParameterDelete(AjaxDeleteView):
 | 
					class PartParameterDelete(AjaxDeleteView):
 | 
				
			||||||
    """ View for deleting a PartParameter """
 | 
					    """ View for deleting a PartParameter """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    role_required = 'part.delete'
 | 
					    role_required = 'part.change'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model = PartParameter
 | 
					    model = PartParameter
 | 
				
			||||||
    ajax_template_name = 'part/param_delete.html'
 | 
					    ajax_template_name = 'part/param_delete.html'
 | 
				
			||||||
@@ -2554,7 +2554,7 @@ class BomItemDelete(AjaxDeleteView):
 | 
				
			|||||||
    context_object_name = 'item'
 | 
					    context_object_name = 'item'
 | 
				
			||||||
    ajax_form_title = _('Confim BOM item deletion')
 | 
					    ajax_form_title = _('Confim BOM item deletion')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    role_required = 'part.delete'
 | 
					    role_required = 'part.change'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PartSalePriceBreakCreate(AjaxCreateView):
 | 
					class PartSalePriceBreakCreate(AjaxCreateView):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user