-
-
Notifications
You must be signed in to change notification settings - Fork 530
[18.0][MIG] website_sale_product_attachment: Migration to 18.0 #1060
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] website_sale_product_attachment: Migration to 18.0 #1060
Conversation
… website This module lets you publish downloadable attachments in a product page. This is useful if you want to publish firmwares, manuals, specs, warranties, or whatever document related to the product. @Tecnativa TT20984 TT23657
… names Without this fix, the order in which attachments were displayed couldn't be predictable. Now, it's as expected by user: by name. Also the thumbnails got stretched when the attachment had a long name. @Tecnativa TT24437
Currently translated at 100.0% (9 of 9 strings) Translation: e-commerce-12.0/e-commerce-12.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_attachment/es/
Currently translated at 33.3% (3 of 9 strings) Translation: e-commerce-12.0/e-commerce-12.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_attachment/fr/
Currently translated at 100.0% (9 of 9 strings) Translation: e-commerce-12.0/e-commerce-12.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_attachment/fr/
Currently translated at 33.3% (3 of 9 strings) Translation: e-commerce-12.0/e-commerce-12.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_attachment/nl/
Currently translated at 100.0% (9 of 9 strings) Translation: e-commerce-12.0/e-commerce-12.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_product_attachment/ca/
…sudo In v13, there's no general read ACL for public files, so we need to get filenames and file type using sudo. The download is performed normally due to the public=True field in the attachments.
On previous version, attachments had 2 fields for adding both attachment name and file name. Now on v13, there's only one, that is fille with the file name. On initial migration, it was considered that this field is enough, but putting file names on the website product page can be ugly, limited and confusing, so we are adding here a new field to store the name we want to give it for the website e-commerce product page. It also includes migration script for recovering the old information if coming from v12.
Currently translated at 100.0% (12 of 12 strings) Translation: e-commerce-13.0/e-commerce-13.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-13-0/e-commerce-13-0-website_sale_product_attachment/ca/
Currently translated at 100.0% (12 of 12 strings) Translation: e-commerce-16.0/e-commerce-16.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-16-0/e-commerce-16-0-website_sale_product_attachment/es/
Currently translated at 100.0% (12 of 12 strings) Translation: e-commerce-16.0/e-commerce-16.0-website_sale_product_attachment Translate-URL: https://translation.odoo-community.org/projects/e-commerce-16-0/e-commerce-16-0-website_sale_product_attachment/it/
…justment - Make the alert and table placed correctly with the grid display, avoiding overlap and poor placement of the elements in the view.
c4fbc40 to
9b7b1f8
Compare
|
@pilarvargas-tecnativa, @victoralmau Could you take a look at it? |
victoralmau
left a comment
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.
I'm not entirely sure but I think this will solve the tests.
9b7b1f8 to
5e25371
Compare
|
Let's go 🎉! Thank you very much, @victoralmau . |
victoralmau
left a comment
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.
Functional review OK
Please note that although the feature in core v17 allows you to list attachments in the product page, it only includes attachments linked to that product, which still makes this module necessary, IMO.
|
/ocabot migration website_sale_product_attachment |
IMO, there's a big difference. In core, if there are some common files for, say, 20 products, you'll have to upload the file (and create 20) for each product. With this module, you can use the same file and link it across all 20 products. It's true that the behavior could be "unified," but it might be more confusing to unify it than to keep it separate as it is now. |
|
At low level, it's the same, as upload the file 20 times only means one time to take the space, as having the same hash, it doesn't require more space, and for the user it's the same to upload the file 20 times than to link it. They have to do 20 operations the same. |
|
I seem to remember there's an option (in the form view of an attachment) that allows you to link the products to which it applies, so you can link all 20 products in a single operation without adding the same attachment 20 times. Also, if you need to change something (instructions for "same" products), having to delete them all and upload them again isn't very intuitive, but it could be done. This also applies to v17. |
|
That's the only advantage, but what we should do is to provide that features with the core feature, not the replace it with yet another similar one. I will definitively go with not migrating this module and create extra modules to cover that feature. |
|
Thinking about this again, even though this module isn't exactly necessary i think it's appropriate to reuse it., IMO the right thing to do would be:
What do you think about this? |
|
I still think it doesn't bring enough value to keep it, at least on our migration path, which should be: consider this module as merged in |
Sorry to bring this up again. I'm preparing the migration script in Openupgrade to create the corresponding Let's imagine that someone is using this module and has, for example, 100 product.template records with The “ I still think that the behavior of this module is not possible with core, but I don't want to insist. |
|
OK, apart from the |
|
Okay, so if I understand correctly, if one attachment that is not linked to anything is now linked to 20 products, with this new approach I will have to create 20 attachments (each linked to one product template). Can you confirm that this is correct? (I hope no one wants to change that file later or “link” it to more products, as they will have to create new attachments). |
|
Yes, that's it. I know you are seeing this as something tremendous, but the cases where the same file is shared between several products is not so frequent, and if so, then the tool to build instead of keeping this module is one that allows to do "massive replacements" over |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |




Standard migration to v18 using oca-port