Fixes for order.js

This commit is contained in:
Oliver 2021-07-29 11:58:32 +10:00
parent ba5479090a
commit 6fe5f0e0e6
4 changed files with 9 additions and 9 deletions

View File

@ -96,8 +96,9 @@ settings_urls = [
# These javascript files are served "dynamically" - i.e. rendered on demand # These javascript files are served "dynamically" - i.e. rendered on demand
dynamic_javascript_urls = [ dynamic_javascript_urls = [
url(r'^inventree.js', DynamicJsView.as_view(template_name='js/dynamic/inventree.js'), name='inventree.js'), url(r'^inventree.js', DynamicJsView.as_view(template_name='js/dynamic/inventree.js'), name='inventree.js'),
url(r'^settings.js', DynamicJsView.as_view(template_name='js/dynamic/settings.js'), name='settings.js'), url(r'^calendar.js', DynamicJsView.as_view(template_name='js/dynamic/calendar.js'), name='calendar.js'),
url(r'^nav.js', DynamicJsView.as_view(template_name='js/dynamic/nav.js'), name='nav.js'), url(r'^nav.js', DynamicJsView.as_view(template_name='js/dynamic/nav.js'), name='nav.js'),
url(r'^settings.js', DynamicJsView.as_view(template_name='js/dynamic/settings.js'), name='settings.js'),
] ]
# These javascript files are pased through the Django translation layer # These javascript files are pased through the Django translation layer
@ -107,7 +108,6 @@ translated_javascript_urls = [
url(r'^barcode.js', DynamicJsView.as_view(template_name='js/translated/barcode.js'), name='barcode.js'), url(r'^barcode.js', DynamicJsView.as_view(template_name='js/translated/barcode.js'), name='barcode.js'),
url(r'^bom.js', DynamicJsView.as_view(template_name='js/translated/bom.js'), name='bom.js'), url(r'^bom.js', DynamicJsView.as_view(template_name='js/translated/bom.js'), name='bom.js'),
url(r'^build.js', DynamicJsView.as_view(template_name='js/translated/build.js'), name='build.js'), url(r'^build.js', DynamicJsView.as_view(template_name='js/translated/build.js'), name='build.js'),
url(r'^calendar.js', DynamicJsView.as_view(template_name='js/translated/calendar.js'), name='calendar.js'),
url(r'^company.js', DynamicJsView.as_view(template_name='js/translated/company.js'), name='company.js'), url(r'^company.js', DynamicJsView.as_view(template_name='js/translated/company.js'), name='company.js'),
url(r'^filters.js', DynamicJsView.as_view(template_name='js/translated/filters.js'), name='filters.js'), url(r'^filters.js', DynamicJsView.as_view(template_name='js/translated/filters.js'), name='filters.js'),
url(r'^forms.js', DynamicJsView.as_view(template_name='js/translated/forms.js'), name='forms.js'), url(r'^forms.js', DynamicJsView.as_view(template_name='js/translated/forms.js'), name='forms.js'),

View File

@ -147,6 +147,8 @@
<!-- dynamic javascript templates --> <!-- dynamic javascript templates -->
<script type='text/javascript' src="{% url 'inventree.js' %}"></script> <script type='text/javascript' src="{% url 'inventree.js' %}"></script>
<script type='text/javascript' src="{% url 'calendar.js' %}"></script>
<script type='text/javascript' src="{% url 'nav.js' %}"></script>
<script type='text/javascript' src="{% url 'settings.js' %}"></script> <script type='text/javascript' src="{% url 'settings.js' %}"></script>
<!-- translated javascript templates--> <!-- translated javascript templates-->
@ -155,12 +157,10 @@
<script type='text/javascript' src="{% i18n_static 'barcode.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'barcode.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'bom.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'bom.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'build.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'build.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'calendar.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'company.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'company.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'filters.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'filters.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'forms.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'forms.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'label.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'label.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'nav.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'modals.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'modals.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'model_renderers.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'model_renderers.js' %}"></script>
<script type='text/javascript' src="{% i18n_static 'order.js' %}"></script> <script type='text/javascript' src="{% i18n_static 'order.js' %}"></script>

View File

@ -9,7 +9,7 @@ function createSalesOrder(options={}) {
method: 'POST', method: 'POST',
fields: { fields: {
reference: { reference: {
prefix: '{% settings_value "SALESORDER_REFERENCE_PREFIX" %}', prefix: global_settings.SALESORDER_REFERENCE_PREFIX,
}, },
customer: { customer: {
value: options.customer, value: options.customer,
@ -40,7 +40,7 @@ function createPurchaseOrder(options={}) {
method: 'POST', method: 'POST',
fields: { fields: {
reference: { reference: {
prefix: "{% settings_value 'PURCHASEORDER_REFERENCE_PREFIX' %}", prefix: global_settings.PURCHASEORDER_REFERENCE_PREFIX,
}, },
supplier: { supplier: {
value: options.supplier, value: options.supplier,
@ -214,7 +214,7 @@ function loadPurchaseOrderTable(table, options) {
switchable: false, switchable: false,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var prefix = "{% settings_value 'PURCHASEORDER_REFERENCE_PREFIX' %}"; var prefix = global_settings.PURCHASEORDER_REFERENCE_PREFIX;
if (prefix) { if (prefix) {
value = `${prefix}${value}`; value = `${prefix}${value}`;
@ -309,7 +309,7 @@ function loadSalesOrderTable(table, options) {
title: '{% trans "Sales Order" %}', title: '{% trans "Sales Order" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var prefix = "{% settings_value 'SALESORDER_REFERENCE_PREFIX' %}"; var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
if (prefix) { if (prefix) {
value = `${prefix}${value}`; value = `${prefix}${value}`;
@ -423,7 +423,7 @@ function loadSalesOrderAllocationTable(table, options={}) {
switchable: false, switchable: false,
formatter: function(value, row) { formatter: function(value, row) {
var prefix = "{% settings_value 'SALESORDER_REFERENCE_PREFIX' %}"; var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
var ref = `${prefix}${row.order_detail.reference}`; var ref = `${prefix}${row.order_detail.reference}`;