[16.0][IMP] web_timeline: Allow to select in action's view_ids#3440
Conversation
|
Hi @tarteo, |
|
Code review, LGTM |
|
This PR has the |
| 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': [ |
There was a problem hiding this comment.
Why do you need this extra stuff? Does this mean that this is not retro-compatible?
There was a problem hiding this comment.
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_timelinewith the updated demo data included in this PR but without the fix inir_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.
pedrobaeza
left a comment
There was a problem hiding this comment.
OK, understood. Thanks for the patch. Please fw-port it.
/ocabot merge patch
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
@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. |
|
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 :) |
|
/ocabot merge patch |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 637c28a. Thanks a lot for contributing to OCA. ❤️ |
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_timelinewith the updated demo data included in this PR but without the fix inir_actions, so the fix is automatically verified during installation.