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

[11.0] [MIG] web_tree_image #1006

Merged
merged 21 commits into from
Sep 20, 2018
Merged

Conversation

nikul-serpentcs
Copy link
Member

Display images and icons in tree view

This module defines a tree image widget, to be used with either binary fields or (function) fields of type character. Use widget='image' in your view definition. Optionally, set a height attribute. Default height is 16px.

Stefan Rijnhart and others added 18 commits July 31, 2018 12:33
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
set resize="<width>,<height>" in the field tag definition to
make the server return a resized version of the image.
Useful for saving bandwidth when dealing with large images and to
have uniform image sizes (aspect ratio is mantained by filling
emtpy areas with transparent background)
* Stefan Rijnhart
* Leonardo Donelli <donelli@webmonks.it>
* Jay Vora <jay.vora@serpentcs.com>
* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove Jay and Meet names ; Replace by Serpent Consulting Services Pvt. Ltd. support@serpentcs.com

Copy link
Member

Choose a reason for hiding this comment

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

Well, here it's supposed to have real persons. Your company is in the author list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, @nikul-serpentcs Add yours, dont remove any.

@nikul-serpentcs nikul-serpentcs mentioned this pull request Jul 31, 2018
68 tasks
@nikul-serpentcs nikul-serpentcs force-pushed the 11-mig-web_tree_image branch 2 times, most recently from 3dff926 to 0272bcc Compare July 31, 2018 11:01
@nikul-serpentcs
Copy link
Member Author

  • Before, install web_tree_image module tree view look like

customers odoo

and then after installed

customers odoo 1

@Tardo
Copy link
Member

Tardo commented Aug 2, 2018

Perhaps can be interesting show the image, in something like a tooltip, with real size when mouse is over the image.

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Aug 2, 2018

Perhaps can be interesting show the image, in something like a tooltip, with real size when mouse is over the image.

@OCA/web-maintainers Could you please confirm this, So I will work on it.

CC @Tardo

@pedrobaeza
Copy link
Member

Yeah, that option is very interesting, but still limited the tooltip to a maximum size (based on a percentage of screen size for example), for avoiding overflowing the view when presenting the tooltip on very large images.

@@ -0,0 +1,55 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg

Choose a reason for hiding this comment

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

missing the target

* Meet Dholakia <m.dholakia.serpentcs@gmail.com>
* Nikul Chaudhary <nikul.chaudhary.serpentcs@gmail.com>

Maintainer

Choose a reason for hiding this comment

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

Standard footers or better the new fragmented README

Copy link
Member Author

Choose a reason for hiding this comment

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

@elicoidal Improved Standard footer.


{
'name': 'Show images in tree views',
'version': '11.0.1.1.0',

Choose a reason for hiding this comment

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

if first version then 11.0.1.0.0

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

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

I don't think it works without Javascript. Did you forget to commit it?


This module defines a tree image widget, to be used with either binary fields
or (function) fields of type character. Use ``widget='image'`` in your view
definition. Optionally, set a ``height`` attribute. Default height is 16px.
Copy link
Member

Choose a reason for hiding this comment

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

I think the default height is 30px (in the less file)


Set the attribute ``widget=image`` in a ``field`` tag in a tree view.
You can also set ``height=<height>`` to set the height the image will have.
Note that this just sets the CSS ``max-height`` attribute,
Copy link
Member

Choose a reason for hiding this comment

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

Is this still the case without the Javascript?

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Aug 9, 2018

Yes @tarteo, In V11 added a widget for an image but height and width are not proper, so no need to Javascript for a particular widget. The only CSS we have a used and added a width in here

And those things are described in already #1006 (comment).

Thanks.

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Sep 4, 2018

@pedrobaeza @Tardo @JayVora-SerpentCS

Added a tooltip as per #1006 (comment)

  • Added mouse over event in image section then appeared Tooltip

screenshot from 2018 09 04 13 06 41

screenshot from 2018 09 04 13 09 42

events: _.extend({}, ListRenderer.prototype.events, {
'mouseover tbody tr td .o_field_image': '_onHoverRecord_img',
}),
_onHoverRecord_img: function (event) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you make the indentation straight?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Tardo Done

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

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

Thanks. The tooltip is great!

@nikul-serpentcs
Copy link
Member Author

@tarteo Thanks to you too 😃

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Sep 5, 2018

@OCA/web-maintainers If Code & functional Review is done then move forward.

@nikul-serpentcs
Copy link
Member Author

@pedrobaeza @Tardo Waiting for your replay, If Done then merged.

Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

👍 Functional test

@Tardo
Copy link
Member

Tardo commented Sep 10, 2018

Functional OK but for me can be improved if tooltip shows with less delay... and scale image respecting proportions.. perhaps using 'image cropping'...

👍

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Sep 11, 2018

@Tardo In the image, I used responsive classes and I checked in mobile view its work Good. In Code, I tried to reduce the maximum delay problems.

@nikul-serpentcs
Copy link
Member Author

@pedrobaeza @OCA/web-maintainers Waiting for your replay, If Done then move forward.

@pedrobaeza
Copy link
Member

It lacks this comment: "Functional OK but for me can be improved if tooltip shows with less delay.."

@nikul-serpentcs
Copy link
Member Author

nikul-serpentcs commented Sep 19, 2018

@pedrobaeza I added a delay parameter with less delay issue, Could you please review it?

CC @Tardo

111111111

@yvaucher yvaucher merged commit a5893f5 into OCA:11.0 Sep 20, 2018
@JayVora-SerpentCS
Copy link
Contributor

Thanks @yvaucher

@JDSalcedo
Copy link

Hi @nikul-serpentcs thanks for your awesome work, I got a questions: if the property height=<height> is not longer available, why keep its usage in README file? or this behavior is in development stage?

@nikul-serpentcs
Copy link
Member Author

Hi @nikul-serpentcs thanks for your awesome work, I got a questions: if the property height=<height> is not longer available, why keep its usage in README file? or this behavior is in development stage?

@JDSalcedo I already improved in v12 #1100 . If you have any doubts in v11 then you can Improve code and put change request (PR).

@nikul-serpentcs nikul-serpentcs deleted the 11-mig-web_tree_image branch November 4, 2020 12:58
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.