New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:arrow_up::one::two: ir_attachment_url #674

Open
wants to merge 5 commits into
base: 12.0
from

Conversation

Projects
None yet
3 participants
@RafiZz
Member

RafiZz commented Oct 31, 2018

No description provided.

Show resolved Hide resolved ir_attachment_url/tests/test_data_get.py Outdated
Show resolved Hide resolved ir_attachment_url/models/ir_http.py Outdated
Show resolved Hide resolved ir_attachment_url/models/image.py Outdated
Show resolved Hide resolved ir_attachment_url/models/image.py Outdated
@yelizariev

Don't change version. We don't do it for migration updates. We update only prefix (11.0 to 12.0)

Show resolved Hide resolved ir_attachment_url/doc/changelog.rst Outdated
Show resolved Hide resolved ir_attachment_url/models/ir_http.py Outdated
@@ -5,8 +5,11 @@
super_image_resize_images = tools.image_resize_images
def updated_image_resize_images(vals, big_name='image', medium_name='image_medium', small_name='image_small'):
def updated_image_resize_images(vals, big_name='image', medium_name='image_medium', small_name='image_small', sizes=None):

This comment has been minimized.

@yelizariev

yelizariev Nov 13, 2018

Member

I cannot find updated_image_resize_images in odoo source. Do we need this method here?

This comment has been minimized.

@RafiZz

RafiZz Nov 13, 2018

Member

"updated_" is a prefix in order to show that it is changed. The original function is called "image_resize_images". I made the code so that it looked like other code in the same file.

@yelizariev

This comment has been minimized.

Member

yelizariev commented Nov 13, 2018

@RafiZz also fix lint:

ir_attachment_url/models/ir_http.py:86:25: F841 local variable 'last_update' is assigned to but never used

Show resolved Hide resolved ir_attachment_url/models/image.py Outdated
Show resolved Hide resolved ir_attachment_url/models/image.py Outdated
@@ -80,6 +84,8 @@ def binary_content(cls, xmlid=None, model='ir.attachment', id=None, field='datas
with open(module_resource_path, 'rb') as f:
content = base64.b64encode(f.read())
last_update = pycompat.text_type(os.path.getmtime(module_resource_path))
# lint error fix
del last_update

This comment has been minimized.

@yelizariev

RafiZz added some commits Oct 31, 2018

🚑 when the "image_resize_image" function was called, they received th…
…e error "binascii.Error: decoding with base64 codec failed (Error: Incorrect padding)", since the value of the binary field is the URL, not the base_64 string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment