Added IPN to Supplier Part string representation

Improved Supplier Part templates and fixed 'Order Part' button in supplier_part_orders
This commit is contained in:
eeintech 2020-10-15 13:09:00 -05:00
parent ca8472ac23
commit af6b30eaca
6 changed files with 20 additions and 17 deletions

View File

@ -423,12 +423,15 @@ class SupplierPart(models.Model):
return str(self)
def __str__(self):
s = "{supplier} ({sku})".format(
sku=self.SKU,
supplier=self.supplier.name)
s = ''
if self.part.IPN:
s += f'{self.part.IPN}'
s += f' | {self.supplier.name} | {self.SKU}'
if self.manufacturer_string:
s = s + ' - ' + self.manufacturer_string
s = s + ' | ' + self.manufacturer_string
return s

View File

@ -94,7 +94,7 @@ src="{% static 'img/blank_image.png' %}"
{% block js_ready %}
{{ block.super }}
$('#order-part').click(function() {
$('#order-part, #order-part2').click(function() {
launchModalForm(
"{% url 'order-parts' %}",
{

View File

@ -6,13 +6,13 @@
{% include "company/supplier_part_tabs.html" with tab='orders' %}
<hr>
<h4>{% trans "Supplier Part Orders" %}</h4>
<hr>
<div id='button-bar'>
<div class='btn-group'>
<button class='btn btn-primary' type='button' id='part-order2' title='Order part'>Order Part</button>
<button class='btn btn-primary' type='button' id='order-part2' title='Order part'>Order Part</button>
</div>
</div>

View File

@ -7,10 +7,10 @@
{% include "company/supplier_part_tabs.html" with tab='pricing' %}
<hr>
<h4>{% trans "Pricing Information" %}</h4>
<hr>
<div id='price-break-toolbar' class='btn-group'>
<button class='btn btn-primary' id='new-price-break' type='button'>{% trans "Add Price Break" %}</button>
</div>

View File

@ -6,10 +6,10 @@
{% include "company/supplier_part_tabs.html" with tab='stock' %}
<hr>
<h4>{% trans "Supplier Part Stock" %}</h4>
<hr>
{% include "stock_table.html" %}
{% endblock %}

View File

@ -13,7 +13,7 @@
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
{% if order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change %}
<button type='button' class='btn btn-default' id='new-po-line'>{% trans "Add Line Item" %}</button>
<button type='button' class='btn btn-primary' id='new-po-line'>{% trans "Add Line Item" %}</button>
{% endif %}
</div>