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

[MIG][10.0] product_multi_image #201

Closed

Conversation

lasley
Copy link

@lasley lasley commented Nov 10, 2016

This is WIP & served to rule out old API wire crossing as the 9.0 upgrade issue in #199. We're getting the same effect here, so that's not the case.

I'll fix this PR up once the issue is figured out in the 9.0 version.

Depends:

@lasley lasley mentioned this pull request Nov 10, 2016
1 task
@pedrobaeza
Copy link
Member

You can rebase now

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch 2 times, most recently from dd16b90 to ed5884d Compare November 15, 2016 17:18
@lasley
Copy link
Author

lasley commented Nov 15, 2016

Rebased. I don't think it made any difference though? I'm still fixing the variant removal issue noted in #199

@lasley
Copy link
Author

lasley commented Nov 30, 2016

This is solved in OCA/server-tools#629 & should be ready for review after merge

@@ -0,0 +1 @@
server-tools https://github.com/laslabs/server-tools release/10.0/base_multi_image
Copy link
Member

Choose a reason for hiding this comment

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

Change this to regular repo

@lasley
Copy link
Author

lasley commented Jan 10, 2017

Restarted build now that base fix is merged. Hopefully we go 🍏 !

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch from 3af98db to bb971d2 Compare January 10, 2017 18:22
@lasley
Copy link
Author

lasley commented Jan 10, 2017

Oh crap this is still pending OCA/server-tools#677 - updating issue description

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch 2 times, most recently from 1ab7984 to 871f110 Compare January 16, 2017 17:09
@lasley
Copy link
Author

lasley commented Jan 16, 2017

Alright rebased now the OCA/server-tools#677 is merged. We should hopefully be 🍏 here now.

@pedrobaeza @yajo - you guys mind if I squash your commits into changesets by author?

@yajo
Copy link
Member

yajo commented Jan 17, 2017

No problem on my side. Still ❌ though.

@pedrobaeza
Copy link
Member

Yes, please squash, and check Travis status.

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch from b2be042 to 5e229c2 Compare January 21, 2017 02:32
@lasley
Copy link
Author

lasley commented Jan 21, 2017

Ok so it seems the registry does not operate the same way that we expect it to in the hooks. I totally remember now why I went down the path of making an environment in my server-tools PR. It's wanting a BaseModel instance passed into the search call, but the model being returned from the registry here is a MetaModel.

I'm submitting a new PR for the base & linked this PR against it. We will use this one to determine that my fix actually worked. Don't merge this PR until I switch back 😉

Edit - the MetaModel linked to Travis, which overwrote when I rebuilt - sorry!

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch from 5e229c2 to a57258a Compare January 22, 2017 01:24
@yajo
Copy link
Member

yajo commented Jan 23, 2017

OK so now it's 💚, but... are we allowed to merge it like this?

@pedrobaeza
Copy link
Member

What are you referring to?

@@ -0,0 +1 @@
server-tools https://github.com/laslabs/server-tools bugfix/10.0/base_multi_image-hook-revisited
Copy link
Member

Choose a reason for hiding this comment

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

@pedrobaeza I'm talking about this.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, OK. No, then we should wait for the merge on the server-tools repo.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah please don't merge yet. I'm just using this as proof that my patch in server-tools actually works this time. I didn't do it last time & now we're in this situation. Sorry, I should have been more clear in my comment.

@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch from a57258a to 871f110 Compare January 23, 2017 18:31
@lasley
Copy link
Author

lasley commented Jan 23, 2017

Alright at long last, these tests should pass!

Well, except for the fact that they won't pass due to OCA/maintainer-quality-tools#427 😆

* 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
@lasley lasley force-pushed the release/10.0/SMD-216-product_multi_image branch from 871f110 to 57958f5 Compare January 23, 2017 18:36
@lasley
Copy link
Author

lasley commented Jan 23, 2017

Hrm no idea how tests are actually passing with the missing headers, but I'll take it!

@lasley
Copy link
Author

lasley commented Jan 27, 2017

Without futher ado, I present a 🍏 build - using the production server-tools! Ready for review 🎸

Btw nobody rebuild Travis or it'll go 🔴 on unrelated issue in odoo/odoo. Delicate tip-toe, this passing CI is.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Please include also #229

@lasley
Copy link
Author

lasley commented Feb 11, 2017

Added

@lasley
Copy link
Author

lasley commented Mar 2, 2017

@tedsalmon please review

@angelmoya
Copy link
Member

Checked on local environment and works nice!
👍

@pedrobaeza
Copy link
Member

@lasley have you checked if in uninstallation product images are restored?

@angelmoya
Copy link
Member

@pedrobaeza @lasley Just I try to uninstall and it fail

File "/opt/odoo/sources/odoo/odoo/modules/loading.py", line 389, in load_modules
getattr(py_module, uninstall_hook)(cr, registry)
AttributeError: 'module' object has no attribute 'uninstall_hook'

@pedrobaeza
Copy link
Member

hehe, that why I was asking. It seems anyway something easy to fix.

@lasley
Copy link
Author

lasley commented Mar 20, 2017

Hahahah this is the PR that just keeps on giving- I'll fix it up, thanks for the catch guys!

@lasley
Copy link
Author

lasley commented Mar 28, 2017

@pedrobaeza @angelmoya - I added the import to the uninstall hook into the init file, which cleared up the uninstall issue in local.

def uninstall_hook(cr, registry):
"""Remove multi images for models that no longer use them."""
uninstall_hook_for_submodules(cr, registry, "product.template")
uninstall_hook_for_submodules(cr, registry, "product.product")
Copy link
Member

Choose a reason for hiding this comment

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

You still need to restore main image for products/templates here, before calling the base_multi_image hook, or you will lose them on uninstallation.

Copy link
Author

Choose a reason for hiding this comment

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

Ah yes good call. Any idea how we would go about that with the DB modifications still in place? The fields in the product will still be overridden as related, so any changes made to those will simply update the underlying image record instead of the binary field.

Copy link
Member

Choose a reason for hiding this comment

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

My best bet would be to create the column in SQL, and copy data to this column also in SQL. ORM wouldn't interfere in that, and when the field definition with the compute dissapears, Odoo will look again to this column for getting the image.

@thomaspaulb
Copy link

@pedrobaeza Since this was superseded by #359, can you close this?

@pedrobaeza
Copy link
Member

Yeah, closing.

@pedrobaeza pedrobaeza closed this Oct 1, 2018
ernestotejeda pushed a commit to Tecnativa/product-attribute that referenced this pull request Aug 22, 2019
…irm website sale order (OCA#201)

* [FIX] product_pack: Do not reset packs components when confirm sale order.

If a sale order is updated from the website whrn confirm the order we do
not expand the pack, we usit as it is.

* [ADD] product_pack: Allow modify pack from backend/website

Now we can choose if the product can be modified in the only int he backend or
if can be modified also in the frontend by the customers.

* [FIX] lint
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.

6 participants