diff --git a/import_lots/doc/RELEASE_NOTES.md b/import_lots/doc/RELEASE_NOTES.md index 917f6adc6..7c380bff8 100644 --- a/import_lots/doc/RELEASE_NOTES.md +++ b/import_lots/doc/RELEASE_NOTES.md @@ -4,3 +4,8 @@ #### Version 16.0.1.0.0 #### ADD - Initial commit for Import Lot from Excel + +#### 05.07.2024 +#### Version 15.0.1.0.2 +##### Fix on the validation for import +- Bug Fix diff --git a/import_lots/wizard/lots_attachment.py b/import_lots/wizard/lots_attachment.py index 46b03ca4d..c50ea0d61 100644 --- a/import_lots/wizard/lots_attachment.py +++ b/import_lots/wizard/lots_attachment.py @@ -21,7 +21,7 @@ ############################################################################### from odoo import fields, models from odoo import _ -from odoo.exceptions import UserError +from odoo.exceptions import UserError, ValidationError import openpyxl import base64 from io import BytesIO @@ -54,6 +54,8 @@ class LotsAttachment(models.TransientModel): wb = openpyxl.load_workbook( filename=BytesIO(base64.b64decode(self.attachment)), read_only=True) \ if self.attachment else "" + if not wb: + raise ValidationError(_('Check whether you upload the document')) ws = wb.active # Check if product exists in the sheet product_found = any(