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',
|
||||
'customer',
|
||||
'customer_detail',
|
||||
'contact',
|
||||
'contact_detail',
|
||||
'customer_reference',
|
||||
'description',
|
||||
'line_items',
|
||||
@ -715,6 +717,8 @@ class SalesOrderSerializer(AbstractOrderSerializer, InvenTreeModelSerializer):
|
||||
|
||||
return queryset
|
||||
|
||||
contact_detail = ContactSerializer(source='contact', many=False, read_only=True)
|
||||
|
||||
customer_detail = CompanyBriefSerializer(source='customer', many=False, read_only=True)
|
||||
|
||||
line_items = serializers.IntegerField(read_only=True)
|
||||
|
@ -177,6 +177,13 @@ src="{% static 'img/blank_image.png' %}"
|
||||
</td>
|
||||
</tr>
|
||||
{% 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 %}
|
||||
<tr>
|
||||
<td><span class='fas fa-users'></span></td>
|
||||
|
@ -72,6 +72,18 @@ function salesOrderFields(options={}) {
|
||||
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: {
|
||||
icon: 'fa-user',
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user