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

Create a setup module for OpenERP 7

By
SLO BY
on 11/26/14, 9:38 AM 773 views

Hi there!

I'm trying to create a custom module that's basically sets up the configuration for a company that i'm working for. 

  • Should I even make a custom module for this or execute some kind of python script? I'm aiming for the one that is the best regarding conventions/maintainability
  • How can I execute a one-time script upon module installation? Is it feasible to execute just 1 method instead of creating a throwaway class?
  • I know data creation/removal can be done via xml too but how can I modify some existing data?

Let's say my goal is to change just the name of the current company to 'ABC'. How can I do that?

 

1
Julien Laloux
On 11/26/14, 10:06 AM

What you describe is a "profile module".

You can create a module that depends on the module you have to install and with xml file, you can override existing record. for example, you can change the company name by putting this xml record:

<record id="base.main_company" model="res.company">

      <field name="name">My super company</field>

</record>

This will override the name of the company because the XML ID is identical to an existing one and so it will just update it

 

In your XML file, i suggest you to put

<data noupdate="1">

and like that, it will just create/update your data's when you install your module. So you can change the value in the interface and when you'll make an update of your module, it will not override the value given trough the interface

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: 11/26/14, 9:38 AM
Seen: 773 times
Last updated: 3/16/15, 8:10 AM