Browse Source

July 10: [FIX] Bug Fixed 'import_lots'

pull/320/head
RisvanaCybro 10 months ago
parent
commit
3422fa0009
  1. 5
      import_lots/doc/RELEASE_NOTES.md
  2. 4
      import_lots/wizard/lots_attachment.py

5
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

4
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(

Loading…
Cancel
Save