Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][BR000275][MIG] Migrate website_event_baidu_map from 8.0 to 12.0 #248

Open
wants to merge 12 commits into
base: 12.0
Choose a base branch
from

Conversation

ruter-lyu
Copy link

@Elico-Corp/odoo-reviewers

@ruter-lyu ruter-lyu changed the title [MIG] Migrate website_event_baidu_map from 8.0 to 12.0 [12.0][BR000275][MIG] Migrate website_event_baidu_map from 8.0 to 12.0 Apr 9, 2019
Copy link
Contributor

@elicoidal elicoidal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM small details

website_event_baidu_map/README.rst Outdated Show resolved Hide resolved
website_event_baidu_map/README.rst Outdated Show resolved Hide resolved
Copy link

@JoJoJoJoJoJoJo JoJoJoJoJoJoJo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JoJoJoJoJoJoJo
Copy link

JoJoJoJoJoJoJo commented Apr 12, 2019

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/models.py", line 1108, in _validate_fields
    check(self)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 345, in _check_xml
    view_def = view.read_combined(['arch'])
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 783, in read_combined
    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 732, in apply_view_inheritance
    source = self.apply_inheritance_specs(source, specs_tree, view_id)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 710, in apply_inheritance_specs
    self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 548, in raise_view_error
    raise ValueError(message)
ValueError: Element '<xpath expr="//div[@class='card-body']/a">' cannot be located in parent view

Error context:
View `map`
[view_id: 1033, xml_id: n/a, model: n/a, parent_id: 1019]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 757, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 735, in _tag_template
    return self._tag_record(record, data_node)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 662, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3821, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/opt/odoo/sources/odoo/addons/website/models/ir_ui_view.py", line 128, in _load_records_create
    records = super(View, self)._load_records_create(values)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3735, in _load_records_create
    return self.create(values)
  File "<decorator-gen-32>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 452, in _model_create_multi
    return create(self, arg)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-99>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 433, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/opt/odoo/sources/odoo/odoo/api.py", line 433, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/opt/odoo/additional_addons/connector/component_event/models/base.py", line 95, in create
    record = super(Base, self).create(vals)
  File "<decorator-gen-3>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 451, in _model_create_multi
    return create(self, [arg])
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3552, in create
    fields[0].determine_inverse(batch_recs)
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 1097, in determine_inverse
    getattr(records, self.inverse)()
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch
    view.write(data)
  File "/opt/odoo/sources/odoo/addons/website/models/ir_ui_view.py", line 41, in write
    return super(View, self).write(vals)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 444, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/opt/odoo/additional_addons/connector/component_event/models/base.py", line 102, in write
    result = super(Base, self).write(vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3269, in write
    self._write(store_vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3413, in _write
    self._validate_fields(vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 1112, in _validate_fields
    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.exceptions.ValidationError: ('Error while validating constraint\n\nElement \'<xpath expr="//div[@class=\'card-body\']/a">\' cannot be located in parent view\n\nError context:\nView `map`\n[view_id: 1033, xml_id: n/a, model: n/a, parent_id: 1019]', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/sources/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 312, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/sources/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/odoo/sources/odoo/odoo/http.py", line 696, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 344, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 337, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 939, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/sources/odoo/odoo/http.py", line 517, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/sources/odoo/addons/web/controllers/main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "/opt/odoo/sources/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/sources/odoo/odoo/api.py", line 749, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/sources/odoo/odoo/api.py", line 736, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-61>", line 2, in button_immediate_install
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_module.py", line 73, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_module.py", line 444, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_module.py", line 553, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/opt/odoo/sources/odoo/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/sources/odoo/odoo/modules/loading.py", line 421, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/opt/odoo/sources/odoo/odoo/modules/loading.py", line 313, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/opt/odoo/sources/odoo/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/opt/odoo/sources/odoo/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 801, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 864, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 763, in parse
    exc_info[2]
  File "/opt/odoo/sources/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 757, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 735, in _tag_template
    return self._tag_record(record, data_node)
  File "/opt/odoo/sources/odoo/odoo/tools/convert.py", line 662, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3821, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/opt/odoo/sources/odoo/addons/website/models/ir_ui_view.py", line 128, in _load_records_create
    records = super(View, self)._load_records_create(values)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3735, in _load_records_create
    return self.create(values)
  File "<decorator-gen-32>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 452, in _model_create_multi
    return create(self, arg)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-99>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 433, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/opt/odoo/sources/odoo/odoo/api.py", line 433, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/opt/odoo/additional_addons/connector/component_event/models/base.py", line 95, in create
    record = super(Base, self).create(vals)
  File "<decorator-gen-3>", line 2, in create
  File "/opt/odoo/sources/odoo/odoo/api.py", line 451, in _model_create_multi
    return create(self, [arg])
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3552, in create
    fields[0].determine_inverse(batch_recs)
  File "/opt/odoo/sources/odoo/odoo/fields.py", line 1097, in determine_inverse
    getattr(records, self.inverse)()
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch
    view.write(data)
  File "/opt/odoo/sources/odoo/addons/website/models/ir_ui_view.py", line 41, in write
    return super(View, self).write(vals)
  File "/opt/odoo/sources/odoo/odoo/addons/base/models/ir_ui_view.py", line 444, in write
    return super(View, self).write(self._compute_defaults(vals))
  File "/opt/odoo/additional_addons/connector/component_event/models/base.py", line 102, in write
    result = super(Base, self).write(vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3269, in write
    self._write(store_vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 3413, in _write
    self._validate_fields(vals)
  File "/opt/odoo/sources/odoo/odoo/models.py", line 1112, in _validate_fields
    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint

Element '<xpath expr="//div[@class='card-body']/a">' cannot be located in parent view

Error context:
View `map`
[view_id: 1033, xml_id: n/a, model: n/a, parent_id: 1019]
None" while parsing None:3, near
<data name="map" inherit_id="website_event.event_description_full">
        <xpath expr="//div[@class='card-body']/a" position="replace">
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
            <style type="text/css">
                body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
                #baidu_map{width:100%;height:250px;}
                p{margin-left:5px; font-size:14px;}
            </style>
            <div id="baidu_map"/>
            <script type="text/javascript">
                var map = new BMap.Map("baidu_map");
                map.centerAndZoom(new BMap.Point(121.480237, 31.236305), 11);
                map.enableScrollWheelZoom();
                var local = new BMap.LocalSearch(map, {
                    renderOptions:{map: map, autoViewport: true}
                });
                local.search('<t t-esc="event.address_id.street"/>');
            </script>
        </xpath>
    </data>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants