Odoo Help


Refresh tree view after closing export dialog

Pieter Paulussen
on 4/22/16, 9:41 AM 1,123 views

When I use the export function to export records from a custom model to an excel or csv, I change a boolean field on the model and add a timestamp that the records have been exported. Now I need to refresh my tree view so the booleans and the timestamp are automatically displayed. 

(FYI: I change the values by extending the export_data function of the standard Odoo model.)

After generating and downloading the exported file I the export dialog does not close out of itself.

How do I achieve that the export dialog automatically closes after a successfull export and then reloads my existing tree view?

Pieter Paulussen
On 4/23/16, 6:07 AM

Unfortunatly I don't have enough karma to alter my original post

EDIT: Respective code:

def export_data(self, fields_to_export, raw_data=False):
    for r in self:
        r.printed = True
        r.timestamp_printed = fields.Datetime.now()
        rec_id = super(pricehistory, self).export_data(fields_to_export, raw_data=False)

After this the view returns to the export dialog. However there is no way to refresh the view from which the record export was called.


Prakash Sharma

--Prakash Sharma--
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 4/22/16, 10:06 AM

As ODOO use   XMLHttpRequest  so after the method  call the view not reload [for performance enhancement ]  by default ,but you can do it using tag reload.

try this code in the method , it will refresh/reload  the view after method called:

return {
    'type': 'ir.actions.client',
    'tag': 'reload',

Unfortunately this doesn't work either. The tree view from which the records were exported doesn't display the changes to the records after the export.

Pieter Paulussen
on 4/23/16, 5:56 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/22/16, 9:41 AM
Seen: 1123 times
Last updated: 4/23/16, 6:07 AM