diff --git a/docs/assets/images/report/picklist_with_path.png b/docs/assets/images/report/picklist_with_path.png new file mode 100644 index 0000000..7b2c863 Binary files /dev/null and b/docs/assets/images/report/picklist_with_path.png differ diff --git a/docs/report/pack.md b/docs/report/pack.md index 42fa9db..f598b23 100644 --- a/docs/report/pack.md +++ b/docs/report/pack.md @@ -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 + {% for loc in line.stock_item.location.path %}{{ loc.name }}{% if not forloop.last %}-{% endif %}{% endfor %} +``` +{% 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.