From 6df317c54629e5c222e8db511b38ada767ec60af Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 24 Feb 2014 11:32:35 +0100 Subject: [PATCH 1/6] [FIX] website's translation problems on multiple inheritance bzr revid: fme@openerp.com-20140224103235-2s9de5k71xfa2qko --- openerp/addons/base/ir/ir_ui_view.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index aafce29b7eb..d4655bf8b9c 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -316,14 +316,14 @@ class view(osv.osv): return node return None - def inherit_branding(self, specs_tree, view_id, source_id): + def inherit_branding(self, specs_tree, view_id, root_id): for node in specs_tree.iterchildren(tag=etree.Element): xpath = node.getroottree().getpath(node) if node.tag == 'data' or node.tag == 'xpath': - self.inherit_branding(node, view_id, source_id) + self.inherit_branding(node, view_id, root_id) else: node.set('data-oe-id', str(view_id)) - node.set('data-oe-source-id', str(source_id)) + node.set('data-oe-source-id', str(root_id)) node.set('data-oe-xpath', xpath) node.set('data-oe-model', 'ir.ui.view') node.set('data-oe-field', 'arch') @@ -397,7 +397,7 @@ class view(osv.osv): return source - def apply_view_inheritance(self, cr, uid, source, source_id, model, context=None): + def apply_view_inheritance(self, cr, uid, source, source_id, model, root_id=None, context=None): """ Apply all the (directly and indirectly) inheriting views. :param source: a parent architecture to modify (with parent modifications already applied) @@ -408,13 +408,15 @@ class view(osv.osv): :return: a modified source where all the modifying architecture are applied """ if context is None: context = {} + if root_id is None: + root_id = source_id sql_inherit = self.pool.get('ir.ui.view').get_inheriting_views_arch(cr, uid, source_id, model, context=context) for (specs, view_id) in sql_inherit: specs_tree = etree.fromstring(specs.encode('utf-8')) if context.get('inherit_branding'): - self.inherit_branding(specs_tree, view_id, source_id) + self.inherit_branding(specs_tree, view_id, root_id) source = self.apply_inheritance_specs(cr, uid, source, specs_tree, view_id, context=context) - source = self.apply_view_inheritance(cr, uid, source, view_id, model, context=context) + source = self.apply_view_inheritance(cr, uid, source, view_id, model, root_id=root_id, context=context) return source def read_combined(self, cr, uid, view_id, fields=None, context=None): From 2d0db5a8bfaff1ccd4ca485faef25cb0a13a076b Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 24 Feb 2014 12:01:48 +0100 Subject: [PATCH 2/6] [IMP] 3 cols to respect icon and make it easier for new users to start with bzr revid: fp@tinyerp.com-20140224110148-12lndtuaztxypgmw --- .../static/src/js/website.tour.banner.js | 4 +- addons/website/views/snippets.xml | 214 +++++++++--------- 2 files changed, 107 insertions(+), 111 deletions(-) diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 53489b1737c..1d4a0c0f752 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -69,10 +69,10 @@ popover: { fixed: true }, }, { - snippet: 'three-columns', + snippet: 'features', placement: 'bottom', title: _t("Drag & Drop This Block"), - content: _t("Drag the 'Three Columns' block and drop it below the banner."), + content: _t("Drag the 'Features' block and drop it below the banner."), popover: { fixed: true }, }, { diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index 968d4683449..f43c1c1bb80 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -23,7 +23,7 @@
- Banner + Banner
@@ -183,11 +183,41 @@ +
+
+ + Features +
+
+
+
+
+ +

First Feature

+
Tell what's the value for the
+
customer for this feature.
+
+
+ +

Second Feature

+
Write what the customer would like to know,
+
not what you want to show.
+
+
+ +

Third Feature

+
A small explanation of this great
+
feature, in clear words.
+
+
+
+
+
- Big Picture + Big Picture
@@ -216,11 +246,10 @@
-
- Three Columns + Three Columns
@@ -258,66 +287,6 @@
-
-
  • -
  • - Add Slide -
  • -
  • - Remove Slide -
  • -
    - - Quotes Slider -
    - -
    -
    @@ -335,7 +304,7 @@
    -
    +
    Quote
    @@ -369,7 +338,7 @@
    - Separator + Separator

    @@ -414,7 +383,7 @@
    - Image Gallery + Image Gallery
    @@ -467,7 +436,7 @@
    - +

    Beginner

    @@ -479,7 +448,7 @@

    per month
    - +
    • Battery: 8 hours
    • Screen: 2.5 inch
    • @@ -496,7 +465,7 @@
    - +

    Professional

    @@ -508,7 +477,7 @@

    per month
    - +
    • Battery: 12 hours
    • Screen: 2.8 inch
    • @@ -525,7 +494,7 @@
    - +

    Expert

    @@ -537,7 +506,7 @@

    per month
    - +
    • Battery: 20 hours
    • Screen: 2.8 inch
    • @@ -579,7 +548,7 @@
      - FAQ + FAQ
      @@ -626,7 +595,7 @@
      - References + References
      @@ -677,37 +646,64 @@
      -
      +
      +
    • +
    • + Add Slide +
    • +
    • + Remove Slide +
    • - - Features + + Quotes Slider
      -
      -
      -
      -
      - -

      First Feature

      -
      Tell what's the value for the customer for this feature.
      -
      -
      - -

      Second Feature

      -
      Write what the customer would like to know, not what you want to show.
      -
      -
      - -

      Third Feature

      -
      A small explanation of this great feature, in clear words.
      -
      -
      - -

      Fourth Feature

      -
      A small explanation of this great feature on two lines.
      +
      +
      @@ -773,7 +769,7 @@
      - Parallax + Parallax