blooparksystems / website

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

Installing the website_seo module is not possible with the latest v9 #25

Closed rruebner closed 9 years ago

rruebner commented 9 years ago

Problem

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

Steps to reproduce

2015-11-12 11:07:57,399 5202 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 182, 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:
can only parse strings
None" while parsing None:5, near
<data inherit_id="website.layout" name="Head Meta Robots">
      <xpath expr="//meta[@name='keywords']" position="after">
        <t t-if="not request_query_string or request_query_string == ''">
          <meta name="robots" t-att-content="main_object and 'website_meta_robots' in main_object and main_object.website_meta_robots or website_meta_robots or 'INDEX,FOLLOW'"/>
        </t>
        <!-- <t t-if="request_query_string and request_query_string != ''">
          <meta name="robots" content="NOINDEX,FOLLOW"/>
        </t>
        <meta name="seo_url" t-att-content="main_object and 'seo_url' in main_object and main_object.seo_url or seo_url"/> -->
      </xpath>
    </data>

Expected behaviour

If you commented out the following lines in the openerp.py file you can install the website_seo module (but that is not really the solution).

    'views/header.xml',
    'views/ir_ui_view.xml',
    'views/res_lang.xml',
    'views/res_config.xml',
    'views/website_templates.xml'
rruebner commented 9 years ago

Review was fine :+1:, installation of the website_seo module is possible again