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

[IMP] Change display of m2o link #1041

Closed
wants to merge 2 commits into from

Conversation

apollet
Copy link

@apollet apollet commented Sep 19, 2018

Change display of m2o link in order to not have a full clickable link but just an icon next to it.
The icon shows up only when cursor is on the value.

It prevents from opening the many2one form by accident.
m2o_clickable

@oca-clabot
Copy link

Hey @apollet, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

  • Alexandre Pollet (no github login found)

Appreciation of efforts,
OCA CLAbot

@apollet
Copy link
Author

apollet commented Sep 19, 2018

ping @gurneyalex
Je fais parti d'Akretion maintenant, peux tu valider ma CLA s'il te plait ?
Merci beaucoup

@pedrobaeza
Copy link
Member

This is a good improvement, but it has several flaws:

  • Starting of, this is not working on runbot, giving an error on sales orders for example:
TypeError: src.replace is not a function

http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_widget_text_markdown/static/lib/marked/marked.js:136
Traceback:
Lexer.prototype.lex@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_widget_text_markdown/static/lib/marked/marked.js:136:9
Lexer.lex@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_widget_text_markdown/static/lib/marked/marked.js:128:10
marked@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_widget_text_markdown/static/lib/marked/marked.js:1207:25
_format@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:125:33
_format@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1951:16
OdooClass.extend/</prototype[name]</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/framework/class.js:89:35
format@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1784:17
render_cell@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1111:16
render_cell@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1121:32
anonymous/<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js line 464 > Function:65:11
foreach@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:180:25
anonymous@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js line 464 > Function:45:2
_render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:453:24
render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:445:21
_render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:475:24
call@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:154:20
anonymous/<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js line 464 > Function:10:10
foreach@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:180:25
foreach@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:187:21
anonymous@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js line 464 > Function:8:25
_render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:453:24
render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:445:21
_render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:475:24
render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/qweb/qweb2.js:445:21
render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1119:13
render@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js:80:22
OdooClass.extend/Class.include/</prototype[name]</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/framework/class.js:122:35
render_dataset/</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/src/js/views/list_view.js:1498:17
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3276:86
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3321:33
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
add@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3165:49
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3278:73
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3321:33
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3276:86
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3283:73
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
Deferred/</deferred[tuple[0]]@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3321:33
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3283:73
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
then/</</<@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3283:73
fire@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3119:38
fireWith@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:3231:49
done@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:9275:33
callback@http://3338777-1041-14c5a4.runbot2.odoo-community.org/web/static/lib/jquery/jquery.js:9685:57

  • You put the icon of showing a popup, so if the icon does that, it's changing the behavior, because before it was shown on same target, which also follows normal behavior when you are on read mode. If not, please change the icon to a more indicative one.
  • On contrary, on edit mode, it would be great to have popup edition instead of same target. If this can be contextual to that mode.
  • A middle way is to have both buttons (popup or inline) and let decide the user to click on each, but it's not very convenient due to the space used.

@bealdav
Copy link
Member

bealdav commented Sep 19, 2018

@pedro you have the same issue on v10 branch

https://travis-ci.org/OCA/web/jobs/422002544

on web_widget_slick

but you're right it's broken in runbot

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 really like this change. With the suggestions of @pedrobaeza it will be even better. For the icon I guess https://fontawesome.com/icons/edit?style=regular is a little better (if it opens in the same target).
Can you update the README and up the version in the manifest, please?

I couldn't test the functionality in Runbot.

@bealdav
Copy link
Member

bealdav commented Sep 20, 2018

@apollet could you have a look on this bug. You can test in sale.order for example. Thanks

@apollet
Copy link
Author

apollet commented Sep 21, 2018

I changed the icon.
m2o_clickable

The suggestions of @pedrobaeza are waaay too hard to do for me :) and i think it's not the original purpose of this module.

For the bug on sale order I think it's not part of my few changes....the OCA/web last build throw the same error...

@bealdav
Copy link
Member

bealdav commented Sep 21, 2018

Thanks a lot @apollet.

Nice improvement

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 tested it on runbot. When I activate the widget I get this error:

TypeError: src.replace is not a function
Please report this to https://github.com/chjj/marked.
    at Lexer.lex (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:10926:146)
    at Function.Lexer.lex (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:10926:93)
    at marked (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:11047:72)
    at Class._format (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:11123:802)
    at Class.format (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:2110:12)
    at Class.render_cell (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:2075:15)
    at Object.render_cell (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/535-1462354/web.assets_backend.js:2075:237)
    at eval (eval at _render (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/400-57aa053/web.assets_common.js:2950:73), <anonymous>:65:30)
    at Object.foreach (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/400-57aa053/web.assets_common.js:2920:18)
    at Engine.eval (eval at _render (http://3339022-1041-272f7f.runbot1.odoo-community.org/web/content/400-57aa053/web.assets_common.js:2950:73), <anonymous>:45:23)

@bealdav
Copy link
Member

bealdav commented Sep 21, 2018

I tried the module from there
https://github.com/OCA/web/tree/10.0/web_tree_many2one_clickable
and I get this error

Branch v10 is red without this update

TypeError: src.replace is not a function
http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:10936
Traceback:
Lexer.prototype.lex@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:10936:142
Lexer.lex@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:10936:87
marked@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:11057:66
_format@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:11133:802
_format@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:2117:8
OdooClass.extend/</prototype[name]</<@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/400-0b9e04f/web.assets_common.js:3015:556
format@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:2110:7
render_cell@http://3338881-10-0-3ce13b.runbot1.odoo-community.org/web/content/554-2f76bbe/web.assets_backend.js:2075:8

@apollet apollet closed this Oct 18, 2018
@apollet apollet reopened this Oct 18, 2018
@bealdav
Copy link
Member

bealdav commented Oct 18, 2018

It's now works !

ping @tarteo

@tarteo
Copy link
Member

tarteo commented Oct 18, 2018

@bealdav I still get the error.

@apollet
Copy link
Author

apollet commented Oct 19, 2018

@tarteo
Have you tried to test this PR outside the OCA Runbot ?
It's not a good thing to install all modules of the branch...if one module break something you can't test other modules.

@pedrobaeza
Copy link
Member

For me the icon is still not good, as current one is indicating the edition of the record, while it should go to the record, but on read mode. A better icon is IMO https://fontawesome.com/icons/angle-double-right?style=solid

If you change it, I'll try the PR outside runbot and push this PR for being merged and forward-ported.

@pedrobaeza pedrobaeza added this to the 10.0 milestone May 9, 2019
@github-actions
Copy link

github-actions bot commented Dec 4, 2022

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 4, 2022
@bealdav
Copy link
Member

bealdav commented Dec 5, 2022

@apollet could you close please ?
Thanks

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 11, 2022
@github-actions
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 16, 2023
@github-actions github-actions bot closed this May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants