-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[8.0][base_multi_image] Base module for models with multiple images (a gallery) #374
Conversation
Thanks |
It's easy to refresh the image to make it look when selected? |
Please @pedrobaeza @antespi @dreispt could you take a look here? |
|
||
class MyOwner(models.Model): | ||
_name = "mymodule.name" | ||
_inherit = "base_multi_image.owner" |
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 most common example will inherit from an existing model and this abstract one, so I think it's better to put it here:
class ...:
_name = "name"
_inherit = ["base_multi_image.owner", "base_model"]
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.
+1
LGTM 👍 |
* Sharoon Thomas | ||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> | ||
* Rafael Blasco <rafabn@antiun.com> | ||
* Jairo Llopis <yajo.sk8@gmail.com> |
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.
No one from Akretion?
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.
Akretion has nothing to do with this. Why do you say that?
I'm thinking that is interesting to have a controller that allows to retrieve these images via a URL, so that you can link them in any other site. |
return False | ||
|
||
@api.multi | ||
def _get_image_from_url(self): |
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.
Should we consider using api cache here?
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.
That was desirable, but for now, there's no cache mechanism. Do you know any quick mechanism?
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.
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.
Fixed
Nice feature, smart implementation, well done! |
All should be fixed. |
@yajo following discussion above, it would be nice to add to the README Roadmap, the idea of adding a "attachment" storage mode. Maybe someone contributes that in the future. |
@pedrobaeza I think that should go on the website companion module. I think @yajo also isolated that in a module. |
@dreispt, I thought about putting on website module, but it's something similar to report, that has a controller for getting reports even without website installed. |
LGTM 👍 |
@pedrobaeza OK. My concern in only to avoid pushing the website dependency. That could be added now ot put in the roadmap. |
@dreispt, you don't need website for making a controller. See the report example. |
Thanks! 👍 the first piece |
@yajo, can you add the missing features commented to the Known issues section? |
Which known issues @pedrobaeza ? |
It has been discussed all over the PR: store as attachment and so on |
Yes, hold on. |
There you have the known issues. About the controller, Odoo already includes This should be ready to merge then. |
[8.0][base_multi_image] Base module for models with multiple images (a gallery)
🎉 |
Following what was discussed in OCA/product-attribute#112, this is the base part of the module stack, without website dependencies.
This module allows other submodules to implement multiple images in very few steps.
@rafaelbn