mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "contact" for SalesOrder
This commit is contained in:
parent
7109bdbc78
commit
2883f9774f
@ -662,6 +662,8 @@ class SalesOrderSerializer(AbstractOrderSerializer, InvenTreeModelSerializer):
|
|||||||
'creation_date',
|
'creation_date',
|
||||||
'customer',
|
'customer',
|
||||||
'customer_detail',
|
'customer_detail',
|
||||||
|
'contact',
|
||||||
|
'contact_detail',
|
||||||
'customer_reference',
|
'customer_reference',
|
||||||
'description',
|
'description',
|
||||||
'line_items',
|
'line_items',
|
||||||
@ -715,6 +717,8 @@ class SalesOrderSerializer(AbstractOrderSerializer, InvenTreeModelSerializer):
|
|||||||
|
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
contact_detail = ContactSerializer(source='contact', many=False, read_only=True)
|
||||||
|
|
||||||
customer_detail = CompanyBriefSerializer(source='customer', many=False, read_only=True)
|
customer_detail = CompanyBriefSerializer(source='customer', many=False, read_only=True)
|
||||||
|
|
||||||
line_items = serializers.IntegerField(read_only=True)
|
line_items = serializers.IntegerField(read_only=True)
|
||||||
|
@ -177,6 +177,13 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if order.contact %}
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-user-tie'></span></td>
|
||||||
|
<td>{% trans "Contact" %}</td>
|
||||||
|
<td>{{ order.contact.name }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
{% if order.responsible %}
|
{% if order.responsible %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-users'></span></td>
|
<td><span class='fas fa-users'></span></td>
|
||||||
|
@ -72,6 +72,18 @@ function salesOrderFields(options={}) {
|
|||||||
link: {
|
link: {
|
||||||
icon: 'fa-link',
|
icon: 'fa-link',
|
||||||
},
|
},
|
||||||
|
contact: {
|
||||||
|
icon: 'fa-user',
|
||||||
|
adjustFilters: function(filters) {
|
||||||
|
let customer = getFormFieldValue('customer', {}, {modal: options.modal});
|
||||||
|
|
||||||
|
if (customer) {
|
||||||
|
filters.company = customer;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
},
|
||||||
responsible: {
|
responsible: {
|
||||||
icon: 'fa-user',
|
icon: 'fa-user',
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user