Skip to content

Commit

Permalink
comment out problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Sep 27, 2024
1 parent d95fe63 commit c020020
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plm/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ class IrAttachment(models.Model):
compute="_compute_must_update_from_cad",
help="""When this flag is enabled the 2d document must be updated in order to guaranteey the update betwin 2d and 3d document""")

@api.depends('store_fname', 'db_datas', 'file_size')
@api.depends_context('bin_size')
def _compute_datas(self):
if self._context.get('bin_size'):
for attach in self:
attach.datas = human_size(attach.file_size)
return

for attach in self:
attach.datas = binascii.a2b_base64(attach.raw or b'')
#attach.datas = self.get_stream_b64encode(attach.raw or b'')
# @api.depends('store_fname', 'db_datas', 'file_size')
# @api.depends_context('bin_size')
# def _compute_datas(self):
# if self._context.get('bin_size'):
# for attach in self:
# attach.datas = human_size(attach.file_size)
# return
#
# for attach in self:
# attach.datas = binascii.a2b_base64(attach.raw or b'')
# #attach.datas = self.get_stream_b64encode(attach.raw or b'')

def get_stream_b64encode(self, from_stream):
source = io.BytesIO()
Expand Down

0 comments on commit c020020

Please sign in to comment.