This question has been flagged

Hi I'm struggling to add project message in project.task tree view.


But Somehow I cannot add it there please let me know.

Avatar
Discard

You can extend listview template to add a new row in tree view

Author

@Mohammed Amal Thanks for letting me know. however, How do you show the new row in selected model or view? and how do you get a field value from a model?

I've done this so far for your advise.

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

<t t-extend="ListView">

<t t-jquery="thead" t-operation="before">

<button class="oe_button oe_highlight" type="button">Custom Button</button>

</t>

</t>

</templates>

Author

I could show this to where i want with the code below.

<t t-if="options.action.res_model=='project.task'">

<button type="button" class="btn btn-sm btn-primary o_list_button_add" accesskey="C">

<t t-esc="options.action.res_model"/>

</button>

</t>

But the problem is I cannot get data from project.project model.

Is there any idea?