-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
[16.0][mig] product_multi_image #1707
base: 16.0
Are you sure you want to change the base?
Conversation
Waiting for a merge in server-tools |
05b9819
to
b0ab882
Compare
f884ced
to
e4b0c54
Compare
@IJOL Can you rebase to see what this now does |
d3286f3
to
57044a6
Compare
Green Green, needs review thought |
71234e0
to
2373ea9
Compare
@jacekmichalski @rousseldenis @thomaspaulb maybe you could review the code? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this. Please remove the new introduced comments in the migration commit.
* Upgrade product_multi_image to v9 * Add server-tools to oca_dependencies
* Migrate product_multi_image to v10 * Remove old api from `product.product` * Add test coverage for hooks and variant count * Fix oca depends * Add uninstall hook
multi to single mode
when saved from single image
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-15.0/product-attribute-15.0-product_multi_image Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_multi_image/
Currently translated at 100.0% (14 of 14 strings) Translation: product-attribute-15.0/product-attribute-15.0-product_multi_image Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_multi_image/es/
Currently translated at 100.0% (14 of 14 strings) Translation: product-attribute-15.0/product-attribute-15.0-product_multi_image Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_multi_image/it/
7d33f46
to
6317125
Compare
I dont think I fully understand this remark.. |
6317125
to
91a12df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify this is what I was pointing at.
91a12df
to
2cc4f89
Compare
a9e1dc3
to
12e3233
Compare
/ocabot migration product_multi_image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Code review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this module. 👍
I have found some warnings in the log to call deprecated flush method.Added code suggestions to fix it.
I noticed there is some leftover from previous migration.
I have found some things that didn't work during functional tests.
On product variants incorrect values are shown in the variants section.
To reproduce....
Add an image from the product variant.Go to a product variant,
On Images tab click ADD.
In the screen that opens there is a "Visible in these Variants" section.
When clicking on the dropdown.
You can select another totally unrelated product (variant).
Which is actually quite confusing.
It should be restricted automatically to the variant you are editing.
But when you click save.
It actually does restrict the image to the variant you are editing.
First image is not saved when creating a new product.
To reproduce....
Create a new product.
Add one image, click save and new,
Add the second product image.
Hit the save button (The cloud symbol) Then you will notice the content of the first image is deleted.
Image is not saved on a newly created product
To reproduce....
Create a new product.
Go to images tab. Click add. select a image.Click "Save & Close".
You will see a preview of the image on the images tab.
Once you click the save button (The cloud symbol).
The image preview is deleted.
Image is deleted when changing the sequence.
To reproduce....
Create or select an existing product.
click on save button (The cloud icon).
Click the add button to add a image.
Upload an image click save and close.
Back in the product click on save button (The cloud icon).
Upload another image click save and close.
Back in the product click on save button (The cloud icon).
Click on the image you last uploaded to edit it.
Change sequence from 10 to a lower number.. e.g. 9
Click save
Now it is ok. Earlier my test was failling. Likely when not pressing the cloud icon.
It is possible to add an empty image
Rather more a "feature then a big bug"
To reproduce....
Create or select an existing product.
On Images tab click ADD.
Fill nothing in... Leave all empty. Click on save button.You have just added an empty picture to your product.
Adding an image from url results in an error.
Use the url field when adding an image.
The above server error caused the following client error:
null
</details>
These 2 commits should be squashed:
![image](https://github.com/user-attachments/assets/4cfd9984-61dd-4dae-bdaa-c0975dde8dda)
{"image_1920": self.grey_image}, | ||
) | ||
] | ||
self.product_template.refresh() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.product_template.refresh() | |
self.product_template.invalidate_cache() |
def test_edit_image_variant(self): | ||
text = "Test name changed" | ||
self.product_1.image_ids[0].name = text | ||
self.product_template.refresh() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.product_template.refresh() | |
self.product_template.invalidate_cache() |
def test_remove_image_all_variants(self): | ||
self.product_1.image_ids = [(3, self.product_1.image_ids[0].id)] | ||
self.product_2.image_ids = [(3, self.product_2.image_ids[0].id)] | ||
self.product_template.refresh() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.product_template.refresh() | |
self.product_template.invalidate_cache() |
|
||
def test_remove_image_variant(self): | ||
self.product_1.image_ids = [(3, self.product_1.image_ids[0].id)] | ||
self.product_template.refresh() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.product_template.refresh() | |
self.product_template.invalidate_cache() |
* When you change the image on the product variant, the preview image of the | ||
*Images* tab doesn't get refreshed until you refresh the browser, or if you | ||
go to its template, but the image has been actually saved! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* When you change the image on the product variant, the preview image of the | |
*Images* tab doesn't get refreshed until you refresh the browser, or if you | |
go to its template, but the image has been actually saved! |
This actually has been fixed. So can be removed from the roadmap.
#. If you add an image here, the image is actually added to the product | ||
template, and restricted to this variant. | ||
#. When editing an existing image, the image is changed generally for all | ||
the variants where is enabled, not only for this variant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variants where is enabled, not only for this variant. | |
the variants where it is enabled, not only for this variant. |
the variants where is enabled, not only for this variant. | ||
#. When removing an image from this form, if the image is only in this variant, | ||
the image is removed. Otherwise, the image gets restricted to the rest of | ||
the variants where is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variants where is available. | |
the variants where it is used. |
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/135/9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | |
:alt: Try me on Runbot | |
:target: https://runbot.odoo-community.org/runbot/135/9.0 |
Runbot 9 is no longer there. Better remove this section.
image.product_variant_count, | ||
1, | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an test to import image from url. As it is failling with an error currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an test to import image from url. As it is failling with an error currently.
@bosd I think this issue has been fixed in this PR - OCA/server-tools#3168
Co-authored-by: bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>
@IJOL How is going here? |
No description provided.