Skip to content

Conversation

@aperebaskine
Copy link
Contributor

@aperebaskine aperebaskine commented Dec 1, 2025

Description

This PR allows users to modify an item's name in the cart, for the corresponding invoice only. This is useful as some small businesses do not register an entry for every single of their SKUs on sale, opting instead use a more general item entry and specify a name on a per-invoice basis.

This does not update the item's original name nor does it allow the user to tamper with the item code (the actual identifier for the SKU in the database).

This is an updated version of PR #27, which may be closed following the merging of this one.

Implementation details

As requested in PR #27, a check field in POS Settings has been added to toggle this feature.
If the feature is enabled, within the item edit dialog, the item name is replaced with an input field. A function is added to restore the original name from cache, which can be triggered manually via a button in the UI, or automatically on blur if the field is empty.

To improve UX with this feature enabled, item code is now also displayed below the editable item name.

1 2

@aperebaskine
Copy link
Contributor Author

Added a new commit: item code is now displayed below the item name in the edit dialog

@aperebaskine
Copy link
Contributor Author

aperebaskine commented Dec 2, 2025

Potential improvement: validate server-side that item name in the form data matches the item name in the database when "Allow Custom Item Name in Cart" is disabled. I'm not seeing any currently implemented logic that already validates item names in form so I'm not sure if this is necessary.

@engahmed1190
Copy link
Contributor

Thanks I will start reviewing this code.

@git-avc
Copy link

git-avc commented Dec 3, 2025

Potential improvement: validate server-side that item name in the form data matches the item name in the database when "Allow Custom Item Name in Cart" is disabled. I'm not seeing any currently implemented logic that already validates item names in form so I'm not sure if this is necessary.

IMO this make no sense, because in case od disable this new option item_name on form will always match the item_name in Item doctype since it is fetched from there.

Maybe I am missing something

@aperebaskine
Copy link
Contributor Author

aperebaskine commented Dec 3, 2025

@git-avc even when the option is disabled, item_name is sent by client so in theory it would be possible to construct and send manual API calls (bypassing the front-end) with modified item names. The question is whether it's necessary to prevent that or not.

I'm assuming this was deemed unnecessary since there's no validation to begin with but thought it was worth mentioning.

@engahmed1190
Copy link
Contributor

My Concern about this PR what will prevent the Casher to sell a higher rate item with Lower rate by just changing the names. e.g. IPhone 13 can be Sold as IPhone 17 by just renaming.

@git-avc
Copy link

git-avc commented Dec 9, 2025

Hy @engahmed1190 @aperebaskine

Purpose of this is let people use POS system without all the items created ... Imagine a printing services shop. We have some items/services created (A4 color print, A4 BW print, ...) but need to specify on the item name something related to the job (ADS PROTOTYPE, CAMPAIGN SAMPLE ...). Maybe we can configure 1 item group for that ... We can consider too add a custom field to Item Doctype (something like "Let change item name on POS")

@aperebaskine
Copy link
Contributor Author

aperebaskine commented Dec 11, 2025

@engahmed1190

Your concern is valid, here are possible steps we could take to solve this problem:

  • As per @git-avc's suggestion, we could add the ability to enable this for specific item group(s). This seems like a good approach to me, as it adds more fine-grained control on what kind of items can have their name modified.
  • I would also suggest adding the ability to control this on a per-role or per-user basis, so that the feature is only enabled for trusted users.
  • It might also be helpful to allow toggling whether to show item code alongside item name in the default receipt.

This would have to be implemented in Desk, removing the toggle inside the settings menu of the front-end.
I'd like to know your thoughts before I work on this. Thanks!

@aperebaskine aperebaskine marked this pull request as draft December 16, 2025 17:14
@engahmed1190
Copy link
Contributor

@engahmed1190

Your concern is valid, here are possible steps we could take to solve this problem:

  • As per @git-avc's suggestion, we could add the ability to enable this for specific item group(s). This seems like a good approach to me, as it adds more fine-grained control on what kind of items can have their name modified.
  • I would also suggest adding the ability to control this on a per-role or per-user basis, so that the feature is only enabled for trusted users.
  • It might also be helpful to allow toggling whether to show item code alongside item name in the default receipt.

This would have to be implemented in Desk, removing the toggle inside the settings menu of the front-end. I'd like to know your thoughts before I work on this. Thanks!

This seems good plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants