Merge lp:~therp-nl/therp-addons/6.1-web_mode_visibility_separator_use_override into lp:~therp-nl/therp-addons/6.1-web_mode_visibility_separator

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 86
Proposed branch: lp:~therp-nl/therp-addons/6.1-web_mode_visibility_separator_use_override
Merge into: lp:~therp-nl/therp-addons/6.1-web_mode_visibility_separator
Diff against target: 129 lines (+21/-70)
5 files modified
web_mode_visibility_separator/__init__.py (+5/-1)
web_mode_visibility_separator/__openerp__.py (+1/-21)
web_mode_visibility_separator/model/__init__.py (+0/-1)
web_mode_visibility_separator/model/ir_ui_view.py (+0/-47)
web_mode_visibility_separator/view.rng.xsl (+15/-0)
To merge this branch: bzr merge lp:~therp-nl/therp-addons/6.1-web_mode_visibility_separator_use_override
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Approve
Review via email: mp+191221@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

lgtm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'web_mode_visibility_separator/__init__.py'
--- web_mode_visibility_separator/__init__.py 2013-05-16 09:33:02 +0000
+++ web_mode_visibility_separator/__init__.py 2013-10-15 15:16:18 +0000
@@ -1,1 +1,5 @@
1import model1try:
2 from openerp.addons.override_import_xml_schema import overrides_view
3 overrides_view.append('web_mode_visibility_separator/view.rng.xsl')
4except:
5 pass
26
=== modified file 'web_mode_visibility_separator/__openerp__.py'
--- web_mode_visibility_separator/__openerp__.py 2013-05-16 09:33:02 +0000
+++ web_mode_visibility_separator/__openerp__.py 2013-10-15 15:16:18 +0000
@@ -24,7 +24,7 @@
24 "version": "6.1.1.0r1",24 "version": "6.1.1.0r1",
25 "author": "Therp BV",25 "author": "Therp BV",
26 "category": "Tools",26 "category": "Tools",
27 "depends": ['web_mode_visibility'],27 "depends": ['web_mode_visibility', 'override_import_xml_schema'],
28 "description": """28 "description": """
29Use the following options keys on separator tags and other form widget29Use the following options keys on separator tags and other form widget
30to hide them in either page or form mode:30to hide them in either page or form mode:
@@ -32,26 +32,6 @@
32- page_invisible32- page_invisible
33- form_invisible33- form_invisible
3434
35Please note that you need to allow the use of the options dictionary
36on separators in openobject-server/openerp/addons/base/rng/view.rng,
37or you will get view validation errors in modules that try to use
38this functionality:
39
40--- openerp/addons/base/rng/view.rng2012-02-13 10:17:58 +0000
41+++ openerp/addons/base/rng/view.rng2013-05-07 09:40:10 +0000
42@@ -442,6 +442,7 @@
43 <rng:optional><rng:attribute name="col"/></rng:optional>
44 <rng:optional><rng:attribute name="select"/></rng:optional>
45 <rng:optional><rng:attribute name="orientation"/></rng:optional>
46+ <rng:optional><rng:attribute name="options"/></rng:optional>
47 <rng:zeroOrMore>
48 <rng:choice>
49 <rng:ref name="separator"/>
50
51You do not need this module to simply hide fields. This can be
52done solely with the 'web_mode_visibility' module, without changes to the
53rng file.
54
55This module is compatible with OpenERP 6.1.35This module is compatible with OpenERP 6.1.
56 """,36 """,
57 'js': [37 'js': [
5838
=== removed directory 'web_mode_visibility_separator/model'
=== removed file 'web_mode_visibility_separator/model/__init__.py'
--- web_mode_visibility_separator/model/__init__.py 2013-05-16 09:33:02 +0000
+++ web_mode_visibility_separator/model/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1import ir_ui_view
20
=== removed file 'web_mode_visibility_separator/model/ir_ui_view.py'
--- web_mode_visibility_separator/model/ir_ui_view.py 2013-05-16 09:33:02 +0000
+++ web_mode_visibility_separator/model/ir_ui_view.py 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import os
23from lxml import etree
24from openerp.osv import orm
25from openerp.tools import file_open
26from openerp.tools.translate import _
27from openerp.modules import get_module_path
28
29class ir_ui_view(orm.Model):
30 _inherit = 'ir.ui.view'
31
32 def _auto_init(self, cr, context=None):
33 """ Check for the necessary intervention in the rng file """
34 relaxng_doc = etree.parse(
35 file_open(os.path.join(
36 get_module_path('base'),'rng','view.rng')))
37 if not relaxng_doc.xpath(
38 '//rng:define[@name="separator"]'
39 '/rng:element[@name="separator"]'
40 '/rng:optional'
41 '/rng:attribute[@name="options"]',
42 namespaces={'rng': 'http://relaxng.org/ns/structure/1.0'}):
43 raise orm.except_orm(
44 _("Installation error"),
45 _("Please adapt file 'view.rng' to allow the options attribute "
46 "on separator elements"))
47 return super(ir_ui_view, self)._auto_init(cr, context=context)
480
=== added file 'web_mode_visibility_separator/view.rng.xsl'
--- web_mode_visibility_separator/view.rng.xsl 1970-01-01 00:00:00 +0000
+++ web_mode_visibility_separator/view.rng.xsl 2013-10-15 15:16:18 +0000
@@ -0,0 +1,15 @@
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:rng="http://relaxng.org/ns/structure/1.0">
4 <xsl:template match="@*|node()">
5 <xsl:copy>
6 <xsl:apply-templates select="@*|node()"/>
7 </xsl:copy>
8 </xsl:template>
9 <xsl:template match="rng:element[@name='separator']">
10 <xsl:copy>
11 <xsl:apply-templates select="@*|node()"/>
12 <rng:optional><rng:attribute name="options"/></rng:optional>
13 </xsl:copy>
14 </xsl:template>
15</xsl:stylesheet>

Subscribers

People subscribed via source and target branches

to all changes: