Skip to content

[16.0][IMP] web_timeline: Allow to select in action's view_ids#3440

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
PyTech-SRL:16.0-imp-web_timeline-action_view_mode
Feb 26, 2026
Merged

[16.0][IMP] web_timeline: Allow to select in action's view_ids#3440
OCA-git-bot merged 1 commit intoOCA:16.0from
PyTech-SRL:16.0-imp-web_timeline-action_view_mode

Conversation

@SirPyTech
Copy link
Contributor

Otherwise an error similar to the following is raised:

ValueError: Wrong value for ir.actions.act_window.view.view_mode: 'timeline'
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 706, in _tag_root
    f(rec)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 333, in _tag_function
    _eval_xml(self, rec, env)
  File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 204, in _eval_xml
    return odoo.api.call_kw(model, method_name, args, kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 484, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 469, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_actions.py", line 56, in write
    res = super(IrActions, self).write(vals)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 3820, in write
    field.write(self, value)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 4294, in write
    return self.write_batch([(records, value)])
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 4315, in write_batch
    return self.write_real(records_commands_list, create)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 4515, in write_real
    flush()
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 4471, in flush
    comodel.create(to_create)
  File "\", line 2, in create
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 431, in _model_create_multi
    return create(self, arg)
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_fields.py", line 670, in create
    recs = super().create(vals_list)
  File "\", line 2, in create
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 431, in _model_create_multi
    return create(self, arg)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4019, in create
    records = self._create(data_list)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4177, in _create
    colval = field.convert_to_column(stored[fname], self, stored)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 2750, in convert_to_column
    value = self.convert_to_cache(value, record)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 2762, in convert_to_cache
    raise ValueError("Wrong value for %s: %r" % (self, value))
ValueError: Wrong value for ir.actions.act_window.view.view_mode: 'timeline'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 91, in load_demo
load_data(cr, idref, mode, kind='demo', package=package)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 73, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 771, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 837, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 757, in parse
self._tag_root(de)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 719, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /opt/odoo/auto/addons/web_timeline/demo/ir_cron_view.xml:12, somewhere inside
<function model="ir.actions.act_window" name="write">
<value eval="[ref('base.ir_cron_act')]"/>
<value model="ir.actions.act_window" eval="{ 'view_mode': obj().env.ref('base.ir_cron_act').view_mode + ',timeline', 'view_ids': [ Command.create({ 'view_mode': 'timeline', 'view_id': ref('ir_cron_timeline'), }), ], }"/>
</function>

The traceback comes from loading web_timeline with the updated demo data included in this PR but without the fix in ir_actions, so the fix is automatically verified during installation.

@OCA-git-bot
Copy link
Contributor

Hi @tarteo,
some modules you are maintaining are being modified, check this out!

Copy link

@quirino95 quirino95 left a comment

Choose a reason for hiding this comment

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

Code and functional review: LGTM!

@HekkiMelody
Copy link
Contributor

Code review, LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza pedrobaeza changed the title [IMP] web_timeline: Allow to select in action's view_ids [16.0][IMP] web_timeline: Allow to select in action's view_ids Feb 26, 2026
@pedrobaeza pedrobaeza added this to the 16.0 milestone Feb 26, 2026
eval="{'view_mode': obj().env.ref('base.ir_cron_act').view_mode + ',timeline'}"
eval="{
'view_mode': obj().env.ref('base.ir_cron_act').view_mode + ',timeline',
'view_ids': [
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need this extra stuff? Does this mean that this is not retro-compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for having a look! 🙏

It is not strictly needed, it is there in order to check that the fix works, as I wrote in the description:

The traceback comes from loading web_timeline with the updated demo data included in this PR but without the fix in ir_actions, so the fix is automatically verified during installation.

Before this change, a timeline view could not be listed in view_ids, after this change it can; I think there is no backward compatibility issue.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

OK, understood. Thanks for the patch. Please fw-port it.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-3440-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Feb 26, 2026
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-3440-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@SirPyTech
Copy link
Contributor Author

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-3440-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

pre-commit check fails because of the error mentioned in OCA/oca-addons-repo-template#333, the fix has been included in #3459.

@tarteo
Copy link
Member

tarteo commented Feb 26, 2026

Hi @tarteo, some modules you are maintaining are being modified, check this out!

I have no time to maintain this module, also not in the foreseeable future . Can you remove me from the maintainer list. No problem if you can't at this point. I'll just ask it in the next PR :)

@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-3440-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 428b3c1 into OCA:16.0 Feb 26, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 637c28a. Thanks a lot for contributing to OCA. ❤️

@HekkiMelody HekkiMelody deleted the 16.0-imp-web_timeline-action_view_mode branch February 27, 2026 08:57
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.

6 participants