Merge lp:~aristobulo/web-addons/web-addons into lp:~webaddons-core-editors/web-addons/7.0

Proposed by Aristóbulo Meneses
Status: Needs review
Proposed branch: lp:~aristobulo/web-addons/web-addons
Merge into: lp:~webaddons-core-editors/web-addons/7.0
Diff against target: 52 lines (+35/-0)
2 files modified
web_hide_duplicate/__openerp__.py (+19/-0)
web_hide_duplicate/static/src/js/duplicate.js (+16/-0)
To merge this branch: bzr merge lp:~aristobulo/web-addons/web-addons
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Needs Resubmitting
Pedro Manuel Baeza code review Needs Fixing
Review via email: mp+217277@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Aristóbulo Meneses (aristobulo) wrote :

Tested on:

[7.0]
server: revno 5285
web: revno 4178
addons: 9997

[trunk]
server: revno 5191
web: revno 3986
addons: revno 9377

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

I think you should remove #30.

And is #36 really necessary?

review: Needs Fixing (code review)
lp:~aristobulo/web-addons/web-addons updated
31. By Aristóbulo Meneses

Removing unnecesary code lines.

Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Aristóbulo, thanks for the contribution.

I didn't get to work. Is there something special to do apart from installing the module?

I have designed an icon for the module if you like:

https://www.dropbox.com/s/3gupycgxtfowhw7/icon.png

Regards.

review: Needs Fixing (test)
Revision history for this message
Aristóbulo Meneses (aristobulo) wrote :

Pedro,
Just install the module and add duplicate="false" to the definition of the
view that you want you modify.

Thanks for the icon.

2014-05-15 19:35 GMT-04:30 Pedro Manuel Baeza <email address hidden>:

> Review: Needs Fixing test
>
> Hi, Aristóbulo, thanks for the contribution.
>
> I didn't get to work. Is there something special to do apart from
> installing the module?
>
> I have designed an icon for the module if you like:
>
> https://www.dropbox.com/s/3gupycgxtfowhw7/icon.png
>
> Regards.
> --
> https://code.launchpad.net/~aristobulo/web-addons/web-addons/+merge/217277
> You are the owner of lp:~aristobulo/web-addons/web-addons.
>

--
La experiencia es la más dura maestra;
primero pone la prueba, luego dá la explicación...
-------------------------------------------------------------------------

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

Please include then this info on module description, and a example of usage.

Regards.

review: Needs Fixing (code review)
lp:~aristobulo/web-addons/web-addons updated
32. By Aristóbulo Meneses

Added HOWTO in module description.
Added module icon (Thank you Pedro)

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

Unmerged revisions

32. By Aristóbulo Meneses

Added HOWTO in module description.
Added module icon (Thank you Pedro)

31. By Aristóbulo Meneses

Removing unnecesary code lines.

30. By Aristóbulo Meneses

[ADD] web_hide_duplicate: adds support for duplicate=false
in <form> declaration to hide 'Duplicate' action from
'More' menu.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'web_hide_duplicate'
2=== added file 'web_hide_duplicate/__init__.py'
3=== added file 'web_hide_duplicate/__openerp__.py'
4--- web_hide_duplicate/__openerp__.py 1970-01-01 00:00:00 +0000
5+++ web_hide_duplicate/__openerp__.py 2014-05-20 21:20:09 +0000
6@@ -0,0 +1,19 @@
7+{
8+ 'name': 'Hide duplicate',
9+ 'author': 'Aristobulo Meneses',
10+ 'description': '''
11+Allows to hide duplicate button under <More> section
12+================================================================================
13+
14+HOW-TO:
15+
16+Go to desired form view definition and duplicate="false" attribute.
17+
18+Example:
19+
20+<form string="Users" version="7.0" duplicate="false">
21+ ''',
22+ 'category': 'web',
23+ 'depends': ['web', ],
24+ 'js': ['static/src/js/duplicate.js', ],
25+}
26
27=== added directory 'web_hide_duplicate/static'
28=== added directory 'web_hide_duplicate/static/src'
29=== added directory 'web_hide_duplicate/static/src/img'
30=== added file 'web_hide_duplicate/static/src/img/icon.png'
31Binary files web_hide_duplicate/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_hide_duplicate/static/src/img/icon.png 2014-05-20 21:20:09 +0000 differ
32=== added directory 'web_hide_duplicate/static/src/js'
33=== added file 'web_hide_duplicate/static/src/js/duplicate.js'
34--- web_hide_duplicate/static/src/js/duplicate.js 1970-01-01 00:00:00 +0000
35+++ web_hide_duplicate/static/src/js/duplicate.js 2014-05-20 21:20:09 +0000
36@@ -0,0 +1,16 @@
37+openerp.web_hide_duplicate = function (instance) {
38+ var _t = instance.web._t;
39+
40+ instance.web.FormView.include({
41+ load_form: function(data) {
42+ this._super(data);
43+ // Now lets delete duplicate button from <More> section.
44+ if (!this.is_action_enabled('duplicate')) {
45+ var no_dup = _.reject(this.sidebar.items.other, function (item) {
46+ return item.label === _t('Duplicate');
47+ });
48+ this.sidebar.items.other = no_dup;
49+ }
50+ }
51+ });
52+};

Subscribers

People subscribed via source and target branches