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:
Oliver 2021-01-13 10:16:25 +11:00 committed by GitHub
commit eedd8059d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@
{% 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>
{% 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>
{% endif %}
</div>

View File

@ -231,7 +231,7 @@ class PartAttachmentDelete(AjaxDeleteView):
ajax_template_name = "attachment_delete.html"
context_object_name = "attachment"
role_required = 'part.delete'
role_required = 'part.change'
def get_data(self):
return {
@ -2073,7 +2073,7 @@ class PartParameterEdit(AjaxUpdateView):
class PartParameterDelete(AjaxDeleteView):
""" View for deleting a PartParameter """
role_required = 'part.delete'
role_required = 'part.change'
model = PartParameter
ajax_template_name = 'part/param_delete.html'
@ -2554,7 +2554,7 @@ class BomItemDelete(AjaxDeleteView):
context_object_name = 'item'
ajax_form_title = _('Confim BOM item deletion')
role_required = 'part.delete'
role_required = 'part.change'
class PartSalePriceBreakCreate(AjaxCreateView):