mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-27 05:06: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:
parent
854bdb16d1
commit
e913095abe
BIN
docs/assets/images/report/picklist_with_path.png
Normal file
BIN
docs/assets/images/report/picklist_with_path.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user