inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.32k stars 781 forks source link

[FR]Simplify displayed part name if IPN and part name equals #8011

Closed martonmiklos closed 2 months ago

martonmiklos commented 2 months ago

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

Problem statement

With the default part name template the part names looks the following in the case if the IPN and the part name equals: kép which is kind of weird.

Suggested solution

Changing the value of the PART_NAME_FORMAT from the default:

{{ part.IPN if part.IPN }}{{ ' | ' if part.IPN }}{{ part.name }}{{ ' | ' if part.revision }}{{ part.revision if part.revision }}

to

{{ part.IPN if part.IPN and part.name != part.IPN}}{{ ' | ' if part.IPN and part.name != part.IPN}}{{ part.name }}{{ ' | ' if part.revision }}{{ part.revision if part.revision }}

I think it would be useful to change the default value, and the fallback would also be useful to change: https://github.com/inventree/InvenTree/blob/master/src/backend/InvenTree/part/helpers.py#L76

Describe alternatives you've considered

Using different IPN and part name ;)

Examples of other systems

-

Do you want to develop this?

matmair commented 2 months ago

I am against changing the default, you can already set it up the way you like with the provided mechansim.

SchrodingersGat commented 2 months ago

Agreed, I think this makes the default "more" complicated.