InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Input Chinese characters at Unit field reported an error

Open weizhangny opened this issue 1 year ago • 7 comments

Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find a similar issue

Describe the bug*

In old version 0.11 doesn't report an issue; the new version reported an error after system migration. I have found a workaround method - In administrator mode, add a physical unit for the international characters - both name and symbol need be the Chinese unit name.

Steps to Reproduce

  1. Go to “Add new part"
  2. Input Chinese characters "个“ at field "Unit"
  3. Click submit

Expected behaviour

measurement unit error

Deployment Method

  • [X] Docker
  • [ ] Bare metal

Version Information

0.13.5

Please verify if you can reproduce this bug on the demo site.

  • [ ] I can reproduce this bug on the demo site.

Relevant log output

No response

weizhangny avatar Feb 28 '24 04:02 weizhangny

I have found a workaround method - In administrator mode, add a physical unit for the international characters - both name and symbol need be the Chinese unit name.

This is probably what you are going to have to do - create custom physical units as needed. InvenTree already provides a way to add custom units on top of the pint conversion library (which as far as I can tell, does not support multi-lingual support).

So, I would suggest that you add these custom units as required.

SchrodingersGat avatar Feb 28 '24 05:02 SchrodingersGat

The workaround (add physical unit) is not stable. Now when I edit a part, the unit measurement appear again. I suggest that reopen this issue. Probably just after I modified/added the physical unit, the part edit/add seems to work; after some days, it wouldn't work any more.

weizhangny avatar Mar 01 '24 00:03 weizhangny

@weizhangny can you please provide some more information about your latest comment. Some screenshots and examples would be really helpful.

SchrodingersGat avatar Mar 01 '24 01:03 SchrodingersGat

Just after I added a new custom physical unit, the error was not generated. After a while, the unit error came up consistently. The Chinese word is "个“ or "次". hopefully you can input the word and reproduce the issue.

weizhangny avatar Mar 10 '24 07:03 weizhangny

inventree-create-part-with-unit-error inventree-custom-physical-unit

weizhangny avatar Mar 10 '24 07:03 weizhangny

Have you tried updating to the latest version? This seems to work ok in 0.14.x:

image

SchrodingersGat avatar Mar 12 '24 04:03 SchrodingersGat

This issue seems stale. Please react to show this is still important.

github-actions[bot] avatar May 11 '24 11:05 github-actions[bot]