Odoo Help

Welcome!

This community 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.

1

Auto-refresh graph

By
Walid Berrad
on 5/20/15, 11:54 AM 572 views

I have a graph which displays data from the database. An external application injects data into some of the database tables, I need to refresh it automatically so the graph should contains the latest inserted data, is there a way to do it using JavaScript or anything else ?

here is my view xml code :


<!-- rate graph views -->

<record model="ir.ui.view" id="id_view_tauxExtractSemoule">
    <field name="name">moulin.graph.view1</field>
    <field name="model">tdb_moulin</field>
    <field name="type">graph</field>
    <field name="arch" type="xml">
<graph string="moulin" type="line" >
            <field name="num"/>
    <field name="tauxExtractionSemoule"/>
</graph>
    </field>
</record>


<!-- action extraction semoule-->

<record model="ir.actions.act_window" id="id_action_tauxExtractSemoule">
    <field name="name">Taux d'extraction de semoule</field>
    <field name="res_model">tdb_moulin</field>
    <field name="view_type">form</field>
    <field name="view_mode">graph,form,tree</field>
    <field name="help" type="html">
        <p class="oe_view_nocontent_create" Some text here for help
</p>
</field>
    <field name="view_id" ref="id_view_tauxExtractSemoule"/>
</record>


and then I declared menuitems and associated the action id to them

0
Khatri Jeenit
On 7/18/16, 8:54 AM

You can create a JavaScript function to reload graph and just need to call

self.do_reload();

Hope It helps you.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/20/15, 11:54 AM
Seen: 572 times
Last updated: 7/18/16, 8:54 AM