Skip to content

[BUG] Exported a stock report, cleaned it and reimported but encountered errors #7526

Closed

Description

@mikeabiz

Been having an issue with import in the Admin-Stock item. Exported a stock report, cleaned it and reimported but encountered errors. From a list of 900+ to be imported, tried to work on a shorter file to try to find the error. Unfortunately, the error shown was not too helpful for me.

Error is as follows
StockItem-2024-06-28.csv

Line number: 1 - [<class 'decimal.ConversionSyntax'>]
5, 493, AV0000489 | 3D Lace Fuchsia, 1, , , OK, 10, 1, Main Warehouse, , , , , , , , , , , , , FALSE, FALSE, TRUE, , , , , , , USD,
Traceback (most recent call last):
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/resources.py", line 804, in import_row
self.import_obj(instance, row, dry_run, **kwargs)
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/resources.py", line 594, in import_obj
self.import_field(field, obj, data, **kwargs)
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/resources.py", line 577, in import_field
field.save(obj, data, is_m2m, **kwargs)
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/fields.py", line 130, in save
cleaned = self.clean(data, **kwargs)
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/fields.py", line 86, in clean
value = self.widget.clean(value, row=data, **kwargs)
File "/opt/inventree/env/lib/python3.9/site-packages/import_export/widgets.py", line 99, in clean
return int(Decimal(value))
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

Activity

  1. added
    bug
    import / export
    on Jun 29, 2024
  2. added this to the 0.16.0 milestone on Jun 29, 2024
  3. SchrodingersGat commented on Jun 29, 2024

    @SchrodingersGat
    Member

    @mikeabiz thanks for reporting - fix incoming in #7535

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimport / export

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions