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.

0

Is there a way to automatically load data upon module install/upgrade/reload?

By
Ben Olsen
on 5/22/14, 1:32 PM 547 views

I just discovered the osv.Model init() and view_init() functions, which are really useful for some of the things I want to do. However, I'd like to be able to have my custom module come pre-loaded with some data when it's installed (or upgraded/reloaded). Is there a function that would allow this, similar to how init() lets me do things on module initialization? 

0

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
On 5/22/14, 4:52 PM

You can load data when the module is installed/upgraded/reloaded with xml files in the module itself. These files need to be declared in the __openerp__.py file, in the data section

Hope this  helps,

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/22/14, 1:32 PM
Seen: 547 times
Last updated: 3/16/15, 8:10 AM