Skip to Content
Menu
This question has been flagged
1 Reply
3330 Views

Hello, I am using Odoo Community edition version 12 and I am currently trying to implement the timeline view from the web_timeline module, available here:

https://odoo-community.org/shop/product/web-timeline-2812?maturity=production%2Fstable

I have installed it, along with the Project timeline module:

https://odoo-community.org/shop/product/project-timeline-2093?search=project+timeline

The project timeline module works correctly, so since it depends on web_timeline, I am assuming that web_timeline was installed correctly.


I tried to add the timeline view to my own module, but this error pops up whenever I try to upgrade it:

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 758, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 663, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3893, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3807, in _load_records_create
    return self.create(values)
  File "<decorator-gen-32>", line 2, in create
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 462, in _model_create_multi
    return create(self, arg)
  File "/home/wojdob/odoo-dev/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 462, in _model_create_multi
    return create(self, arg)
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3588, in create
    records = self._create(data_list)
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3674, in _create
    col_val = field.convert_to_column(val, self, stored)
  File "/home/wojdob/odoo-dev/odoo/odoo/fields.py", line 2016, in convert_to_column
    value = self.convert_to_cache(value, record)
  File "/home/wojdob/odoo-dev/odoo/odoo/fields.py", line 2028, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for ir.ui.view.type: 'timeline'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/wojdob/odoo-dev/odoo/odoo/service/model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/home/wojdob/odoo-dev/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/home/wojdob/odoo-dev/odoo/addons/web/controllers/main.py", line 966, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/wojdob/odoo-dev/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-67>", line 2, in button_immediate_upgrade
  File "/home/wojdob/odoo-dev/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
    return method(self, *args, **kwargs)
  File "/home/wojdob/odoo-dev/odoo/odoo/addons/base/models/ir_module.py", line 627, in button_immediate_upgrade
    return self._button_immediate_function(type(self).button_upgrade)
  File "/home/wojdob/odoo-dev/odoo/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/home/wojdob/odoo-dev/odoo/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/wojdob/odoo-dev/odoo/odoo/modules/loading.py", line 415, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/home/wojdob/odoo-dev/odoo/odoo/modules/loading.py", line 311, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/home/wojdob/odoo-dev/odoo/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/home/wojdob/odoo-dev/odoo/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 802, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 865, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 761, in parse
    pycompat.reraise(
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 758, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/home/wojdob/odoo-dev/odoo/odoo/tools/convert.py", line 663, in _tag_record
    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3893, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3807, in _load_records_create
    return self.create(values)
  File "<decorator-gen-32>", line 2, in create
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 462, in _model_create_multi
    return create(self, arg)
  File "/home/wojdob/odoo-dev/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/home/wojdob/odoo-dev/odoo/odoo/api.py", line 462, in _model_create_multi
    return create(self, arg)
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3588, in create
    records = self._create(data_list)
  File "/home/wojdob/odoo-dev/odoo/odoo/models.py", line 3674, in _create
    col_val = field.convert_to_column(val, self, stored)
  File "/home/wojdob/odoo-dev/odoo/odoo/fields.py", line 2016, in convert_to_column
    value = self.convert_to_cache(value, record)
  File "/home/wojdob/odoo-dev/odoo/odoo/fields.py", line 2028, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
odoo.tools.convert.ParseError: "Wrong value for ir.ui.view.type: 'timeline'" while parsing /home/wojdob/odoo-dev/local-addons/proofofconcept/views/views.xml:53, near
<record id="tms_order_view_timeline" model="ir.ui.view">
        <field name="model">tms.order</field>
        <field name="type">timeline</field>
        <field name="arch" type="xml">
            <data><timeline date_start="start_date" date_stop="end_date" string="Orders" default_group_by="driver">
            </timeline>
            <field name="driver"/>
                <templates>
                    <div t-name="timeline-item">
                        <div t-esc="record.start_date"/>
                        Assigned to:
                        <span t-esc="record.driver[1]"/>
                    </div>
                </templates>
            </data></field>
    </record>

Here is my full views.xml file:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id='tms_order_action' model='ir.actions.act_window'>
<field name="name">Orders</field>
<field name="res_model">tms.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,timeline</field>
</record>

<menuitem name="TMS" id="tms_base_menu" />
<menuitem name="Orders" id="tms_order_menu" parent="tms_base_menu" action="tms_order_action"/>



<!-- Form View -->
<record id="tms_order_view_form" model="ir.ui.view">
<field name="name">Order Form</field>
<field name="model">tms.order</field>
<field name="arch" type="xml">
<form>
<group>
<group>
<field name="company_id"/>
<field name="start_date"/>
<field name="start_location"/>
<field name="end_date"/>
<field name="end_location"/>
</group>
<group>
<field name="driver"/>
<field name="vehicle"/>
<field name="description"/>
</group>
</group>
</form>
</field>
</record>

<!-- Tree(list) View -->
<record id="tms_order_view_tree" model="ir.ui.view">
<field name="name">Orders List</field>
<field name="model">tms.order</field>
<field name="arch" type="xml">
<tree>
<field name="company_id"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>
</field>
</record>

<!-- Timeline View -->
<record id="tms_order_view_timeline" model="ir.ui.view">
<field name="model">tms.order</field>
<field name="type">timeline</field>
<field name="arch" type="xml">
<timeline date_start="start_date"
date_stop="end_date"
string="Orders"
default_group_by="driver">
</timeline>
<field name="driver"/>
<templates>
<div t-name="timeline-item">
<div t-esc="record.start_date"/>
Assigned to:
<span t-esc="record.driver[1]"/>
</div>
</templates>
</field>
</record>

<!-- Search View -->
<record id="tms_order_view_search" model="ir.ui.view">
<field name="name">Order Search</field>
<field name="model">tms.order</field>
<field name="arch" type="xml">
<search>
<field name="company_id"/>
</search>
</field>
</record>
</odoo>


And the model that I'm trying to set into the timeline:

from odoo import models, fields, api

class Order(models.Model):
_name = 'tms.order'

company_id = fields.Many2one('res.company',string = 'Client')
description = fields.Text()
start_date = fields.Date('Start Date')
end_date = fields.Date('End Date')
start_location = fields.Char()
end_location = fields.Char()
driver = fields.Many2one('hr.employee',string = 'Driver')
vehicle = fields.Many2one('fleet.vehicle')


I noticed that in the error message, there's a <data> tag somehow put in automatically by Odoo, it's right under the "arch" field tag. Can this be the cause of the problem? I can't seem to find the solution. Thank you for your help!
Avatar
Discard
Author Best Answer

Oops, I forgot to add web_timeline to dependencies in the manifest dependencies. It works now.

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 23
820
1
Jan 21
6990
0
Mar 16
2367
0
Mar 15
2588
1
Mar 19
3232