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

[FR] i want to get the serial number in the sales order template #8998

Open
1 of 2 tasks
ineselhajahmed11 opened this issue Jan 31, 2025 · 3 comments
Open
1 of 2 tasks
Labels
question This is a question report Report/Label generation wontfix No work will be done against this issue or PR

Comments

@ineselhajahmed11
Copy link

Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find a similar feature request

Problem statement

Image

Image

I want to get the stock item information in the sales order templates
how can i do this ?

Suggested solution

{{ line.serial }} to get me the serial number of the item in the report of the sales order template
this doesn't work, i only can get the fullname of the item and the quantity

Describe alternatives you've considered

.

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.
@ineselhajahmed11 ineselhajahmed11 added enhancement This is an suggested enhancement or new feature triage:not-checked Item was not checked by the core team labels Jan 31, 2025
@ineselhajahmed11 ineselhajahmed11 changed the title [FR] title [FR] i want to get the serial number in the sales order template Jan 31, 2025
@SchrodingersGat SchrodingersGat added question This is a question report Report/Label generation wontfix No work will be done against this issue or PR and removed enhancement This is an suggested enhancement or new feature triage:not-checked Item was not checked by the core team labels Feb 1, 2025
@SchrodingersGat
Copy link
Member

{{ line.serial }} does not work because line is a sales order line item - not a stock item.

You can loop through the allocated stock against the line item like thus:

{% for allocation in line.allocations.all %}
Serial: {{ allocation.item.serial }}
Part: {{ allocation.item.part.name }}
{% endfor %}

etc

@ineselhajahmed11
Copy link
Author

ineselhajahmed11 commented Feb 3, 2025

@SchrodingersGat allocation.item gives only the name and the quantity, there is no serial in the object

Image

Image

@SchrodingersGat
Copy link
Member

Right, so the {{ allocation.item }} resolves to a StockItem Instance so you can access serial from that e.g.

serial: {{ allocation.item.serial }}

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 wontfix No work will be done against this issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants