Skip to content

Commit

Permalink
FIX: pack&go fig big file issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Sep 25, 2024
1 parent 820200d commit fd797e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion plm_pack_and_go/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################
{
"name": "Plm Pack and Go",
"version": "16.0.3",
"version": "16.0.4",
"author": "OmniaSolutions",
"website": "https://odooplm.omniasolutions.website",
"category": "Manufacturing/Product Lifecycle Management (PLM)",
Expand All @@ -29,6 +29,7 @@
"license": "AGPL-3",
"images": [],
"depends": ["plm"],
'external_dependencies': {'python': ['base64io']},
"data": [ # security
"security/plm_security.xml",
'views/plm_component.xml',
Expand Down
19 changes: 9 additions & 10 deletions plm_pack_and_go/wizard/pack_and_go_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
from odoo import fields
from odoo import api
from odoo import _
from odoo import tools
from odoo.exceptions import UserError
import os
import base64
import io
from base64io import Base64IO
import shutil
import requests
_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -572,14 +572,13 @@ def checkCreateFolder(path):
'domain': "[]"}

def get_steram(self, file_name):
stream=b''
with open(file_name, 'rb') as fr:
while True:
piece = fr.read(75232000)
if not piece:
break
stream+=base64.encodebytes(piece)
return stream
target = io.BytesIO()
with open(file_name, "rb") as source:
with Base64IO(target) as encoded_target:
for line in source:
encoded_target.write(line)
target.seek(0)
return target.read()

def getFileExtension(self, docBrws):
fileExtension = ''
Expand Down

0 comments on commit fd797e6

Please sign in to comment.