Skip to content
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

[3305][15.0][MIG] product_carousel_image_attachment: Migration to 15.0 #324

Closed

Conversation

AungKoKoLin1997
Copy link
Contributor

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AungKoKoLin1997 Can you please explain how image resizing is irrelevant now, since it was once of the key concerns not to allow uploading large image files to keep the data volume subdued.

@@ -0,0 +1,2 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Part of Odoo. See LICENSE file for full copyright and licensing details.

Comment on lines 1 to 2
This module does when an image (.jpg/.png/.gif/.bmp) is attached to a product, create a
corresponding product.image record for the attached file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This module does when an image (.jpg/.png/.gif/.bmp) is attached to a product, create a
corresponding product.image record for the attached file.
This module does the following:
- When an image (.jpg/.png/.gif/.bmp) is attached to a product, create a corresponding product.image record
for the attached file.

@AungKoKoLin1997
Copy link
Contributor Author

I thought image_resize_image() is not required anymore because product_template_image_ids and product_variant_image_ids use the image field type and they will resize themself. https://www.odoo.com/forum/help-1/which-function-odoo-13-replace-image-resize-image-164007

@yostashiro
Copy link
Member

I thought image_resize_image() is not required anymore because product_template_image_ids and product_variant_image_ids use the image field type and they will resize themself. https://www.odoo.com/forum/help-1/which-function-odoo-13-replace-image-resize-image-164007

@AungKoKoLin1997 If I'm not mistaken, the data volume will increase by x4 or so. Can you please check and verify if this is the correct understanding?

@AungKoKoLin1997
Copy link
Contributor Author

If I'm not mistaken, the data volume will increase by x4 or so. Can you please check and verify if this is the correct understanding?

Yes, the volume will increased because when we add value to image_1920, system will resize the image and stored in relevant fields.

@yostashiro
Copy link
Member

@AungKoKoLin1997 OK, we may wait and see how things will go with attachment_s3. If x4 data is not much a concern (i.e. cost impact is neglegible) then we could abandon the resizing logic.

@yostashiro yostashiro changed the title [3305][MIG] product_carousel_image_attachment: Migration to 15.0 [3305][15.0][MIG] product_carousel_image_attachment: Migration to 15.0 Mar 30, 2023
@kanda999
Copy link
Contributor

kanda999 commented Apr 13, 2023

@AungKoKoLin1997`

I got that error when I deplicate res_user
` File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/res_users.py", line 1386, in create
users = super(UsersView, self).create(new_vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/res_users.py", line 1139, in create
return super(UsersImplied, self).create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/res_users.py", line 561, in create
users = super(Users, self).create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/ir_fields.py", line 613, in create
recs = super().create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/models.py", line 4071, in create
parents = self.env[model_name].create([
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/addons/account/models/partner.py", line 553, in create
return super().create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/res_partner.py", line 621, in create
partners = super(Partner, self).create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/addons/mail/models/mail_thread.py", line 265, in create
threads = super(MailThread, self).create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/addons/website/models/mixins.py", line 211, in create
records = super(WebsitePublishedMixin, self).create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/addons/base/models/ir_fields.py", line 613, in create
recs = super().create(vals_list)
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/odoo/odoo/models.py", line 4079, in create
records = self._create(data_list)
File "/odoo/code/odoo/odoo/models.py", line 4229, in _create
field.create([
File "/odoo/code/odoo/odoo/fields.py", line 2289, in create
super(Image, self).create(new_record_values)
File "/odoo/code/odoo/odoo/fields.py", line 2193, in create
env['ir.attachment'].sudo().with_context(
File "", line 2, in create
File "/odoo/code/odoo/odoo/api.py", line 413, in _model_create_multi
return create(self, arg)
File "/odoo/code/sst-custom/product_carousel_image_attachment/models/ir_attachment.py", line 37, in create
return attachment
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/odoo/code/odoo/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/code/odoo/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
UnboundLocalError: local variable 'attachment' referenced before assignment`

@AungKoKoLin1997
Copy link
Contributor Author

@kanda999 I fixed it. Thanks for the feedback.

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 15.0-mig-product_carousel_image_attachment branch from 68a801f to 99d0347 Compare August 10, 2023 04:16
Copy link
Contributor

@rinaldifirdaus rinaldifirdaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done functional test for this module and it works well. and about the image size for zoom in the image, as discussed with customer that the image only can be zoomed in for image with 1025 x 1025 in this v15.

@kanda999
Copy link
Contributor

kanda999 commented Nov 9, 2023

This PR is used by rmm-custom. qrtl/rmm-custom#79

@kanda999 kanda999 closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants