blooparksystems / website

Odoo Website builder related addons
GNU Affero General Public License v3.0
10 stars 33 forks source link

Installing the website_seo_blog module is not possible with the latest v9 #29

Closed rruebner closed 8 years ago

rruebner commented 9 years ago

Problem

You can't install the website_seo_blog module with the latest v9. You will get a parse error.

Steps to reproduce

2015-11-13 12:54:07,804 6712 INFO master openerp.addons.base.ir.ir_ui_view: Element '<xpath expr="//div[@id='main_column']/div/a">' cannot be located in parent view

Error context:
View `Blog Posts`
[view_id: 497, xml_id: n/a, model: n/a, parent_id: 396]
2015-11-13 12:54:07,807 6712 ERROR master openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/var/www/openerp/http.py", line 599, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/var/www/openerp/http.py", line 636, in dispatch
    result = self._call_function(**self.params)
  File "/var/www/openerp/http.py", line 315, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/var/www/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/var/www/openerp/http.py", line 308, in checked_call
    result = self.endpoint(*a, **kw)
  File "/var/www/openerp/http.py", line 887, in __call__
    return self.method(*args, **kw)
  File "/var/www/openerp/http.py", line 465, in response_wrap
    response = f(*args, **kw)
  File "/var/www/addons/web/controllers/main.py", line 975, in call_button
    action = self._call_kw(model, method, args, {})
  File "/var/www/addons/web/controllers/main.py", line 963, in _call_kw
    return checked_call(request.db, *args, **kwargs)
  File "/var/www/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/var/www/addons/web/controllers/main.py", line 962, in checked_call
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/var/www/openerp/api.py", line 223, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/www/openerp/addons/base/module/module.py", line 459, in button_immediate_install
    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
  File "/var/www/openerp/api.py", line 223, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/www/openerp/addons/base/module/module.py", line 533, in _button_immediate_function
    registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)
  File "/var/www/openerp/modules/registry.py", line 385, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/var/www/openerp/modules/loading.py", line 337, in load_modules
    loaded_modules, update_module)
  File "/var/www/openerp/modules/loading.py", line 237, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/var/www/openerp/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/var/www/openerp/modules/loading.py", line 98, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/var/www/openerp/tools/convert.py", line 852, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/var/www/openerp/tools/convert.py", line 939, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/var/www/openerp/tools/convert.py", line 802, in parse
    self.parse(rec, mode)
  File "/var/www/openerp/tools/convert.py", line 805, in parse
    self._tags[rec.tag](self.cr, rec, de, mode=mode)
  File "/var/www/openerp/tools/convert.py", line 778, in _tag_template
    return self._tag_record(cr, record, data_node)
  File "/var/www/openerp/tools/convert.py", line 709, in _tag_record
    id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/var/www/openerp/api.py", line 223, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/www/openerp/addons/base/ir/ir_model.py", line 1105, in _update
    res_id = model_obj.create(cr, uid, values, context=context)
  File "/var/www/openerp/api.py", line 223, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/www/openerp/addons/base/ir/ir_ui_view.py", line 351, in create
    context=context)
  File "/var/www/openerp/api.py", line 223, in wrapper
    return old_api(self, *args, **kwargs)
  File "/var/www/openerp/api.py", line 318, in old_api
    result = method(recs, *args, **kwargs)
  File "/var/www/addons_bloopark/website_seo/models/website.py", line 180, in create
    return super(WebsiteSeoMetadata, self).create(vals)
  File "/var/www/openerp/api.py", line 221, in wrapper
    return new_api(self, *args, **kwargs)
  File "/var/www/openerp/models.py", line 4114, in create
    record = self.browse(self._create(old_vals))
  File "/var/www/openerp/api.py", line 221, in wrapper
    return new_api(self, *args, **kwargs)
  File "/var/www/openerp/api.py", line 454, in new_api
    result = method(self._model, cr, uid, *args, **kwargs)
  File "/var/www/openerp/models.py", line 4305, in _create
    recs._validate_fields(vals)
  File "/var/www/openerp/api.py", line 221, in wrapper
    return new_api(self, *args, **kwargs)
  File "/var/www/openerp/models.py", line 1267, in _validate_fields
    raise ValidationError('\n'.join(errors))
ParseError: "Invalid view definition

Error details:
Element '<xpath expr="//div[@id='main_column']/div/a">' cannot be located in parent view

Error context:
View `Blog Posts`
[view_id: 497, xml_id: n/a, model: n/a, parent_id: 396]
None" while parsing None:7, near
<data inherit_id="website_blog.blog_post_short" name="Blog Posts">
      <xpath expr="//div[@id='main_column']/div/a" position="replace">
        <a t-attf-href="/#{ slug(blog_post.blog_id) }/#{ slug(blog_post) }">
          <h2 t-field="blog_post.name" class="mb4"/>
        </a>
      </xpath>
    </data>

Expected behaviour

It seems it is a similar error like in #25. If it is true please check also the issues #26 and #27. At the end the issues #25, #26 and #27 shouldn't happen again with an installed website_seo_blog module.

kaerdsar commented 9 years ago

The fixes for issues #25 and #26 also works for this issue. Now is working.

rruebner commented 8 years ago

Nope, #25 and #26 didn't fix it. website_seo_blog can't be installed.

kaerdsar commented 8 years ago

Indeed, you get the error installing website_seo_blog in Supernova project. There is conflicts with blog views because theme_supernova creates a set of new views for blog models in website and website_seo_blog tries to inherit from webiste_blog views. When you install first theme_supernova the blog views structure changes and then website_seo_blog can't find the xpath elements in parent views.

I don't think we must fix this in Github solution, theme_supernova module is a specific case and the fix must be done in the corresponding project.

rruebner commented 8 years ago

Closed because this issue was related to a specific internal project.