mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1047 from eeintech/add_ipn_supplier_part_str
Added IPN to Supplier Part string representation (global)
This commit is contained in:
commit
2dc9109b11
@ -423,12 +423,16 @@ class SupplierPart(models.Model):
|
|||||||
return str(self)
|
return str(self)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
s = "{supplier} ({sku})".format(
|
s = ''
|
||||||
sku=self.SKU,
|
|
||||||
supplier=self.supplier.name)
|
if self.part.IPN:
|
||||||
|
s += f'{self.part.IPN}'
|
||||||
|
s += ' | '
|
||||||
|
|
||||||
|
s += f'{self.supplier.name} | {self.SKU}'
|
||||||
|
|
||||||
if self.manufacturer_string:
|
if self.manufacturer_string:
|
||||||
s = s + ' - ' + self.manufacturer_string
|
s = s + ' | ' + self.manufacturer_string
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
$('#order-part').click(function() {
|
$('#order-part, #order-part2').click(function() {
|
||||||
launchModalForm(
|
launchModalForm(
|
||||||
"{% url 'order-parts' %}",
|
"{% url 'order-parts' %}",
|
||||||
{
|
{
|
||||||
|
@ -6,18 +6,18 @@
|
|||||||
|
|
||||||
{% include "company/supplier_part_tabs.html" with tab='orders' %}
|
{% include "company/supplier_part_tabs.html" with tab='orders' %}
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>{% trans "Supplier Part Orders" %}</h4>
|
<h4>{% trans "Supplier Part Orders" %}</h4>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<div id='button-bar'>
|
<div id='button-bar'>
|
||||||
<div class='btn-group'>
|
<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>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'>
|
<table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
{% include "company/supplier_part_tabs.html" with tab='pricing' %}
|
{% include "company/supplier_part_tabs.html" with tab='pricing' %}
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>{% trans "Pricing Information" %}</h4>
|
<h4>{% trans "Pricing Information" %}</h4>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<div id='price-break-toolbar' class='btn-group'>
|
<div id='price-break-toolbar' class='btn-group'>
|
||||||
<button class='btn btn-primary' id='new-price-break' type='button'>{% trans "Add Price Break" %}</button>
|
<button class='btn btn-primary' id='new-price-break' type='button'>{% trans "Add Price Break" %}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
{% include "company/supplier_part_tabs.html" with tab='stock' %}
|
{% include "company/supplier_part_tabs.html" with tab='stock' %}
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<h4>{% trans "Supplier Part Stock" %}</h4>
|
<h4>{% trans "Supplier Part Stock" %}</h4>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
{% include "stock_table.html" %}
|
{% include "stock_table.html" %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
|
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
|
||||||
{% if order.status == PurchaseOrderStatus.PENDING and roles.purchase_order.change %}
|
{% 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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user