Merge lp:~therp-nl/web-addons/7.0-web_tree_many2one_clickable into lp:~webaddons-core-editors/web-addons/7.0

Proposed by Holger Brunn (Therp)
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~therp-nl/web-addons/7.0-web_tree_many2one_clickable
Merge into: lp:~webaddons-core-editors/web-addons/7.0
Diff against target: 148 lines (+127/-0)
3 files modified
web_tree_many2one_clickable/__init__.py (+20/-0)
web_tree_many2one_clickable/__openerp__.py (+52/-0)
web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js (+55/-0)
To merge this branch: bzr merge lp:~therp-nl/web-addons/7.0-web_tree_many2one_clickable
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Needs Resubmitting
Ronald Portier (Therp) (community) test Approve
Pedro Manuel Baeza code review and test Approve
Stefan Rijnhart (Opener) Needs Resubmitting
Guewen Baconnier @ Camptocamp code review Pending
Review via email: mp+217655@code.launchpad.net

This proposal supersedes a proposal from 2013-11-29.

Description of the change

This is weird: Launchpad says this was merged, but I can't see the code being added. Does anyone have an idea what went wrong here?

I simply resubmit this MP

----
A widget restoring the old behavior of many2one fields in tree views

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Posted in a previous version of this proposal

Very interesting! Seems fine
Thanks

review: Approve (code review)
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote : Posted in a previous version of this proposal

Nice !

it works perfectly.

review: Approve (functional test)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

You reused the same branch for web_ckeditor4, removing web_tree_many2one_clickable in the same commit as adding that module. When web_ckeditor4 was merged, the revisions were adopted in lp:web-addons, while the changes were reverted at the same time.

You will need to reapply the changes in a new revision.

review: Needs Resubmitting
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

To see what I mean, branch lp:web-addons and inspect using

    bzr status -r 9.2.2..13.1.1

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi,

Yes this is weird because launchpad says "Diff against target: 0 lines". Are you sure that your new MP is valid ?

Regards.

review: Needs Information (no review)
12. By Holger Brunn (Therp)

[MRG] web-addons

13. By Holger Brunn (Therp)

[ADD] readd web_tree_many2one_clickable

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Thanks for your input, now it should be okay

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Please change description to fit in correct english to:

- This addon provides a widget to allow many2one fields in a tree view to open the linked resource:

but I have tried and it works correctly, so I'm not going to block MP.

Have you considered to have another module that completely replace default many2one widget with this functionality to avoid to reprogram all views?

Regards.

review: Approve (code review and test)
14. By Holger Brunn (Therp)

[IMP] attach one handler instead of inline javascript code. This way,
we don't lose the current breadcrumb

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Thanks for your review Pedro! I basically rewrote the code, you might want to have another test.

The two colons are rst for preformatted text: http://docutils.sourceforge.net/docs/user/rst/quickref.html#literal-blocks

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Tested it and it is working

review: Approve (test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

This project is now hosted on https://github.com/OCA/web. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi Holger,

Maybe I'm fully lost, but I thought, for the OCA project, that we had to work on Launchpad for 7.0 (with sync on Github) and on Github for 8.0 serie.

Regards.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Hi Sylvain,

no, in the end we decided to move 7.0 to github as well.

Of course, in situations like that one where reviews were already done, we'll continue from where we are (no need to duplicate reviews).

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Thanks, I did'nt know that information.

Regards.

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Unmerged revisions

14. By Holger Brunn (Therp)

[IMP] attach one handler instead of inline javascript code. This way,
we don't lose the current breadcrumb

13. By Holger Brunn (Therp)

[ADD] readd web_tree_many2one_clickable

12. By Holger Brunn (Therp)

[MRG] web-addons

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'web_tree_many2one_clickable'
2=== added file 'web_tree_many2one_clickable/__init__.py'
3--- web_tree_many2one_clickable/__init__.py 1970-01-01 00:00:00 +0000
4+++ web_tree_many2one_clickable/__init__.py 2014-06-20 07:59:50 +0000
5@@ -0,0 +1,20 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26
27=== added file 'web_tree_many2one_clickable/__openerp__.py'
28--- web_tree_many2one_clickable/__openerp__.py 1970-01-01 00:00:00 +0000
29+++ web_tree_many2one_clickable/__openerp__.py 2014-06-20 07:59:50 +0000
30@@ -0,0 +1,52 @@
31+# -*- coding: utf-8 -*-
32+##############################################################################
33+#
34+# OpenERP, Open Source Management Solution
35+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
36+#
37+# This program is free software: you can redistribute it and/or modify
38+# it under the terms of the GNU Affero General Public License as
39+# published by the Free Software Foundation, either version 3 of the
40+# License, or (at your option) any later version.
41+#
42+# This program is distributed in the hope that it will be useful,
43+# but WITHOUT ANY WARRANTY; without even the implied warranty of
44+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+# GNU Affero General Public License for more details.
46+#
47+# You should have received a copy of the GNU Affero General Public License
48+# along with this program. If not, see <http://www.gnu.org/licenses/>.
49+#
50+##############################################################################
51+{
52+ "name" : "Clickable many2one widget for tree views",
53+ "version" : "1.0",
54+ "author" : "Therp BV",
55+ "complexity": "normal",
56+ "description": """
57+This addon provides a widget to have many2one fields in a tree view open the
58+linked resource::
59+
60+<field name="partner_id" widget="many2one_clickable" />
61+
62+will open the linked partner in a form view.
63+ """,
64+ "category" : "Dependency",
65+ "depends" : [
66+ 'web',
67+ ],
68+ "data" : [
69+ ],
70+ "js": [
71+ 'static/src/js/web_tree_many2one_clickable.js',
72+ ],
73+ "css": [
74+ ],
75+ "qweb": [
76+ ],
77+ "auto_install": False,
78+ "installable": True,
79+ "external_dependencies" : {
80+ 'python' : [],
81+ },
82+}
83
84=== added directory 'web_tree_many2one_clickable/static'
85=== added directory 'web_tree_many2one_clickable/static/src'
86=== added directory 'web_tree_many2one_clickable/static/src/img'
87=== added file 'web_tree_many2one_clickable/static/src/img/icon.png'
88Binary files web_tree_many2one_clickable/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_tree_many2one_clickable/static/src/img/icon.png 2014-06-20 07:59:50 +0000 differ
89=== added directory 'web_tree_many2one_clickable/static/src/js'
90=== added file 'web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js'
91--- web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js 1970-01-01 00:00:00 +0000
92+++ web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js 2014-06-20 07:59:50 +0000
93@@ -0,0 +1,55 @@
94+//-*- coding: utf-8 -*-
95+//############################################################################
96+//
97+// OpenERP, Open Source Management Solution
98+// This module copyright (C) 2013 Therp BV (<http://therp.nl>).
99+//
100+// This program is free software: you can redistribute it and/or modify
101+// it under the terms of the GNU Affero General Public License as
102+// published by the Free Software Foundation, either version 3 of the
103+// License, or (at your option) any later version.
104+//
105+// This program is distributed in the hope that it will be useful,
106+// but WITHOUT ANY WARRANTY; without even the implied warranty of
107+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108+// GNU Affero General Public License for more details.
109+//
110+// You should have received a copy of the GNU Affero General Public License
111+// along with this program. If not, see <http://www.gnu.org/licenses/>.
112+//
113+//############################################################################
114+
115+openerp.web_tree_many2one_clickable = function(openerp)
116+{
117+ openerp.web.list.columns.add(
118+ 'field.many2one_clickable',
119+ 'instance.web_tree_many2one_clickable.Many2OneClickable');
120+ openerp.web_tree_many2one_clickable.Many2OneClickable = openerp.web.list.Column.extend({
121+ _format: function (row_data, options)
122+ {
123+ return _.str.sprintf('<a class="oe_form_uri" data-many2one-clickable-model="%s" data-many2one-clickable-id="%s">%s</a>',
124+ this.relation,
125+ row_data[this.id].value[0],
126+ _.escape(row_data[this.id].value[1] || options.value_if_empty));
127+ },
128+ });
129+
130+ openerp.web.ListView.List.include({
131+ render: function()
132+ {
133+ var result = this._super(this, arguments),
134+ self = this;
135+ this.$current.delegate('a[data-many2one-clickable-model]',
136+ 'click', function()
137+ {
138+ self.view.do_action({
139+ type: 'ir.actions.act_window',
140+ res_model: jQuery(this).data('many2one-clickable-model'),
141+ res_id: jQuery(this).data('many2one-clickable-id'),
142+ views: [[false, 'form']],
143+ });
144+ });
145+ return result;
146+ },
147+ });
148+}

Subscribers

People subscribed via source and target branches