Merge lp:~therp-nl/server-env-tools/decouple_oe_sa into lp:~server-env-tools-core-editors/server-env-tools/7.0

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 47
Proposed branch: lp:~therp-nl/server-env-tools/decouple_oe_sa
Merge into: lp:~server-env-tools-core-editors/server-env-tools/7.0
Diff against target: 194 lines (+151/-0)
7 files modified
disable_openerp_online/__init__.py (+24/-0)
disable_openerp_online/__openerp__.py (+55/-0)
disable_openerp_online/data/ir_cron.xml (+8/-0)
disable_openerp_online/data/ir_ui_menu.xml (+7/-0)
disable_openerp_online/model/__init__.py (+21/-0)
disable_openerp_online/model/publisher_warranty_contract.py (+28/-0)
disable_openerp_online/static/src/xml/base.xml (+8/-0)
To merge this branch: bzr merge lp:~therp-nl/server-env-tools/decouple_oe_sa
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) test, code review Approve
Guewen Baconnier @ Camptocamp code review, no test Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) lgtm, no test Approve
Ronald Portier (Therp) (community) Approve
Review via email: mp+179892@code.launchpad.net

Description of the change

This module deactivates all bindings to openerp.com that come with the standard code:
    - update notifier code is deactivated and the function is overwritten
    - apps and updates menu items in settings are removed
    - help and account menu items in user menu are removed

To post a comment you must log in.
45. By Holger Brunn (Therp)

[FIX] actually override update_notification

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

Thanks! Works like a charm. The module name sounds a little unclear to me. How about 'disable_openerp_online'?

Also, there is still a suspicious class "upload_data_thread" in openerp/tools/misc.py that refers to an OpenERP submission page in its 'run' method. I can't find any place where it is called, but maybe you could disarm this method by way of monkeypatching, just for the sake of completeness (if not paranoia)?

review: Needs Information
46. By Holger Brunn (Therp)

[IMP] renamed to disable_openerp_online
[ADD] icon curtesy to
http://commons.wikimedia.org/wiki/File:Oxygen480-actions-network-disconnect.svg
[IMP] disarmed openerp.tools.misc.upload_data_thread

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

Thanks for your suggestions! I also rst-fied the description and added an icon

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

Tested and worked without flaw.

Code review: looks good to me.

review: Approve
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (lgtm, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Sounds good to me. Thanks

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

Thanks for the changes!

review: Approve (test, code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'disable_openerp_online'
2=== added file 'disable_openerp_online/__init__.py'
3--- disable_openerp_online/__init__.py 1970-01-01 00:00:00 +0000
4+++ disable_openerp_online/__init__.py 2013-08-14 07:49:49 +0000
5@@ -0,0 +1,24 @@
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+import model
27+
28+from openerp.tools.misc import upload_data_thread
29+upload_data_thread.run = lambda x: None
30
31=== added file 'disable_openerp_online/__openerp__.py'
32--- disable_openerp_online/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ disable_openerp_online/__openerp__.py 2013-08-14 07:49:49 +0000
34@@ -0,0 +1,55 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU Affero General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU Affero General Public License for more details.
50+#
51+# You should have received a copy of the GNU Affero General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+##############################################################################
55+{
56+ "name" : "Remove openerp.com bindings",
57+ "version" : "1.0",
58+ "author" : "Therp BV",
59+ "complexity": "normal",
60+ "description": """
61+This module deactivates all bindings to openerp.com that
62+come with the standard code:
63+
64+* update notifier code is deactivated and the function is overwritten
65+* apps and updates menu items in settings are removed
66+* help and account menu items in user menu are removed
67+ """,
68+ "category" : "",
69+ "depends" : [
70+ 'base',
71+ 'mail',
72+ ],
73+ "data" : [
74+ 'data/ir_ui_menu.xml',
75+ 'data/ir_cron.xml',
76+ ],
77+ "js": [
78+ ],
79+ "css": [
80+ ],
81+ "qweb": [
82+ 'static/src/xml/base.xml',
83+ ],
84+ "auto_install": False,
85+ "installable": True,
86+ "external_dependencies" : {
87+ 'python' : [],
88+ },
89+}
90
91=== added directory 'disable_openerp_online/data'
92=== added file 'disable_openerp_online/data/ir_cron.xml'
93--- disable_openerp_online/data/ir_cron.xml 1970-01-01 00:00:00 +0000
94+++ disable_openerp_online/data/ir_cron.xml 2013-08-14 07:49:49 +0000
95@@ -0,0 +1,8 @@
96+<?xml version="1.0" encoding="UTF-8"?>
97+<openerp>
98+ <data>
99+ <record id="mail.ir_cron_module_update_notification" model="ir.cron">
100+ <field name="active" eval="False" />
101+ </record>
102+ </data>
103+</openerp>
104
105=== added file 'disable_openerp_online/data/ir_ui_menu.xml'
106--- disable_openerp_online/data/ir_ui_menu.xml 1970-01-01 00:00:00 +0000
107+++ disable_openerp_online/data/ir_ui_menu.xml 2013-08-14 07:49:49 +0000
108@@ -0,0 +1,7 @@
109+<?xml version="1.0" encoding="UTF-8"?>
110+<openerp>
111+ <data>
112+ <delete model="ir.ui.menu" id="base.module_mi" />
113+ <delete model="ir.ui.menu" id="base.menu_module_updates" />
114+ </data>
115+</openerp>
116
117=== added directory 'disable_openerp_online/model'
118=== added file 'disable_openerp_online/model/__init__.py'
119--- disable_openerp_online/model/__init__.py 1970-01-01 00:00:00 +0000
120+++ disable_openerp_online/model/__init__.py 2013-08-14 07:49:49 +0000
121@@ -0,0 +1,21 @@
122+# -*- coding: utf-8 -*-
123+##############################################################################
124+#
125+# OpenERP, Open Source Management Solution
126+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
127+#
128+# This program is free software: you can redistribute it and/or modify
129+# it under the terms of the GNU Affero General Public License as
130+# published by the Free Software Foundation, either version 3 of the
131+# License, or (at your option) any later version.
132+#
133+# This program is distributed in the hope that it will be useful,
134+# but WITHOUT ANY WARRANTY; without even the implied warranty of
135+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136+# GNU Affero General Public License for more details.
137+#
138+# You should have received a copy of the GNU Affero General Public License
139+# along with this program. If not, see <http://www.gnu.org/licenses/>.
140+#
141+##############################################################################
142+import publisher_warranty_contract
143
144=== added file 'disable_openerp_online/model/publisher_warranty_contract.py'
145--- disable_openerp_online/model/publisher_warranty_contract.py 1970-01-01 00:00:00 +0000
146+++ disable_openerp_online/model/publisher_warranty_contract.py 2013-08-14 07:49:49 +0000
147@@ -0,0 +1,28 @@
148+# -*- coding: utf-8 -*-
149+##############################################################################
150+#
151+# OpenERP, Open Source Management Solution
152+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
153+#
154+# This program is free software: you can redistribute it and/or modify
155+# it under the terms of the GNU Affero General Public License as
156+# published by the Free Software Foundation, either version 3 of the
157+# License, or (at your option) any later version.
158+#
159+# This program is distributed in the hope that it will be useful,
160+# but WITHOUT ANY WARRANTY; without even the implied warranty of
161+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
162+# GNU Affero General Public License for more details.
163+#
164+# You should have received a copy of the GNU Affero General Public License
165+# along with this program. If not, see <http://www.gnu.org/licenses/>.
166+#
167+##############################################################################
168+from openerp.osv.orm import Model
169+
170+
171+class publisher_warranty_contract(Model):
172+ _inherit = 'publisher_warranty.contract'
173+
174+ def update_notification(self, cr, uid, ids, cron_mode=True, context=None):
175+ pass
176
177=== added directory 'disable_openerp_online/static'
178=== added directory 'disable_openerp_online/static/src'
179=== added directory 'disable_openerp_online/static/src/img'
180=== added file 'disable_openerp_online/static/src/img/icon.png'
181Binary files disable_openerp_online/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and disable_openerp_online/static/src/img/icon.png 2013-08-14 07:49:49 +0000 differ
182=== added directory 'disable_openerp_online/static/src/xml'
183=== added file 'disable_openerp_online/static/src/xml/base.xml'
184--- disable_openerp_online/static/src/xml/base.xml 1970-01-01 00:00:00 +0000
185+++ disable_openerp_online/static/src/xml/base.xml 2013-08-14 07:49:49 +0000
186@@ -0,0 +1,8 @@
187+<?xml version="1.0" encoding="UTF-8"?>
188+<templates>
189+ <t t-extend="UserMenu">
190+ <t t-jquery="a[data-menu='account'], a[data-menu='help']">
191+ this.parent().remove();
192+ </t>
193+ </t>
194+</templates>