Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access project information on stock item labels. #8649

Closed
akrly opened this issue Dec 10, 2024 · 2 comments
Closed

Access project information on stock item labels. #8649

akrly opened this issue Dec 10, 2024 · 2 comments
Labels
question This is a question report Report/Label generation

Comments

@akrly
Copy link

akrly commented Dec 10, 2024

Body of the issue

Hi,

Hope my question is posted at the right place.

I am responsible implementing Inventree at the company I work for. Currently I am developing label templates.

Our operation includes installing equipment in racks. These racks are serialized stock items. They are the output of a build order. Each build order is associated with a project.

I would like to create a label that has the following information:

  1. project.id (serialised project number)
  2. project.description (we use this as project name)
  3. part.name
  4. part.IPN
  5. item.serial

1 and 2 are not part of the stock item context variable list. I would like to get the project id and description on the labels without extra user input. Can you suggest a workaround for this? Can something be done in the background?

Many thanks!

@akrly akrly added documentation triage:not-checked Item was not checked by the core team labels Dec 10, 2024
@SchrodingersGat
Copy link
Member

If the stock item is generated as part of a build order, then this build order will be available as the {{ build }} context variable.

Then, you can access the project information associated with the build.

Project Code: {{ item.build.project_code.code }}
<br>
Description: {{ Item.build.project_code.description }}

@matmair matmair added question This is a question and removed triage:not-checked Item was not checked by the core team documentation labels Dec 10, 2024
@akrly
Copy link
Author

akrly commented Dec 10, 2024

Thanks a lot! It works.

@SchrodingersGat SchrodingersGat added the report Report/Label generation label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question report Report/Label generation
Projects
None yet
Development

No branches or pull requests

3 participants