Commit Graph
6 Commits
Author SHA1 Message Date
Samuel Degueldre a39c90fd6d [FIX] web_unsplash: unsplash images added on website break on products
Before this commit, selecting an unsplash image on website, then going
on a product page and selecting that same image in the media-dialog
would not work, and upon saving, the image would be the image
placeholder.

A previous fix in odoo/odoo#31328 added handling so that you could
choose unsplash images for a product, but it failed to account for
unsplash images that had already been added on a public view (for
example on a website page), which the user can choose in the
media-dialog.

This was caused by the fix only searching for the unsplash attachment on
the current model, and not among public attachments, resulting in an
empty search result.

This commit fixes that by adding that the attachment we are looking for
should either be on the current model, or be a public attachment.

closes odoo/odoo#49937

X-original-commit: 196d6b1630fa443bc1d143f76f62f7a719ca4930
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-22 08:55:32 +00:00
fw-bot a561e4cb56 [FIX] web_unsplash: traceback on saving the product
before this commit:
when creating a product from frontend and editing the product and
delete image, it doesn't get any url thus generating the traceback.

after this commit: if url is not defined then return None from
ir.qweb.field.image field converter

task-2063293

closes odoo/odoo#40866

X-original-commit: 2efad751e66931fd25a41c1b7d46865bccbc774a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-22 09:19:35 +00:00
912996fe90 [REF] web_editor, website: adapt wysiwyg to 12.0 editor
The wysiwyg abstraction layer was introduced in saas-12.2 by
commit f2969923. Its goal was to provide an external interface
for other modules that wanted to use the editor feature such
that the editor core itself could be changed without requiring
extensive changes in the other modules.

This commit is adapting the wysiwyg interface to instantiate
the 12.0 editor below it rather than the saas-12.2 one, thus
reverting the "new editor" part of f2969923 itself.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 19:11:31 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Lucas Perais (lpe) 6fc08a88ae [FIX] web_unsplash: save image for res_model
Go on the website, create a new product from there
Click on the image to change it, select an unsplash image

Save your product.

Beforer this commit, the image wasn't saved because the qweb field image
did not know what to do with /unsplash/ urls

After this commit, the image is saved on the product (or any object...)

OPW 1936191

closes odoo/odoo#31328
2019-02-22 08:14:10 +00:00
Romain Derie 732702d5e2 [ADD] web_unsplash: Find free high-resolution images from Unsplash
Move module from enterprise to community

Work of @dep-odoo and @rdeodoo
2018-08-13 20:38:38 +02:00