2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-27 21:26:43 +00:00

Added path trick to the picklist example (#416)

* started python API reference guide

* Added test to the API reference guide

* Added Price break

* added context variables to the build section

* Cleand up build section and added new example

* Fine tuning

* fixed picture

* removed unfinished python reference guide

* Added allocated_stock to the build rreport

* Added contect variables for user model

* Added link to user in build.md

* Fixed misunderstanding of can_complete

* Added context variables for Suppliers

* Fixed typos

* Added example for a warehouse pick list

* Added path trick to the picklist example

* Corrected typo
This commit is contained in:
Michael 2023-01-09 23:09:16 +01:00 committed by GitHub
parent 854bdb16d1
commit e913095abe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -52,3 +52,20 @@ that is needed for the build. This will result in the following printout:
{% with id="report-options", url="report/picklist.png", description="Picklist Example" %} {% include "img.html" %} {% endwith %}
For those of you who would like to replace the "/" by something else because it is hard
to read in some fonts use the following trick:
{% raw %}
```html
<td> {% for loc in line.stock_item.location.path %}{{ loc.name }}{% if not forloop.last %}-{% endif %}{% endfor %} </td>
```
{% endraw %}
Here we use location.path which is a query set that contains the location path up to the
topmost parent. We use a loop to cycle through that and print the .name of the entry followed
by a "-". The foorloop.last is a Django trick that allows us to not print the "-" after
the last entry. The result looks like here:
{% with id="report-options", url="report/picklist_with_path.png", description="Picklist Example" %} {% include "img.html" %} {% endwith %}
Finally added a |floatformat:0 to the quantity that removes the trailing zeros.