Odoo Help

3

8
17 Answers
12
Avatar

Mohammad Alhashash Egypt

--Mohammad Alhashash--
2103
| 6 5 10
October City, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash Egypt
2/9/13, 4:48 PM

You can create a module that configures the system as you need using XML files. I do not think creating a backup of a database and using it as a template is a good option as it will get out-of-date when modules are updated.

In the module's __openerp__.py, You may add required default modules to 'depends': []. Also, you can set 'auto_install': True to have this module installed for all new databases.

Here is a an example that sets some defaults:

<?xml version="1.0" encoding="utf-8"?>
<openerp><data>
  <!-- Activate Technical Features for Admin -->
  <record id="base.user_root" model="res.users">
    <field name="groups_id" eval="[(4, ref('base.group_no_one'))]"/>
  </record>

  <!-- Some configuration settings -->
  <record id="base.group_user" model="res.groups">
    <field name="implied_ids" eval="[(4, ref('base.group_multi_currency')),
                                     (4, ref('product.group_sale_pricelist')),
                                     (4, ref('product.group_purchase_pricelist')),
                                     (4, ref('product.group_uom')),
                                     (4, ref('stock.group_production_lot')),
                                     (4, ref('stock.group_inventory_valuation')),
                                     (4, ref('sale_stock.group_invoice_deli_orders')),
                                     (4, ref('analytic.group_analytic_accounting')),
                                     (4, ref('sale.group_analytic_accounting')),
                                     (4, ref('purchase.group_analytic_accounting'))]"/>
  </record>

  <!-- Set sales and purchase invoice based on picking by default -->
  <function model="ir.values" name="set_default">
    <value>purchase.order</value>
    <value>invoice_method</value>
    <value>picking</value>
  </function>
  <function model="ir.values" name="set_default">
    <value>sale.order</value>
    <value>order_policy</value>
    <value>picking</value>
  </function>
</data></openerp>
6 Comments
Frédéric RAMANDANIARIVO Madagascar
2/10/13, 12:50 AM

have to give it a try.

WANTELLET Sylvain France
2/11/13, 11:25 AM

Thank you, it works like i wanted to.

Mind & Go, Mind And Go France
10/27/13, 7:41 PM

Hy, I'm sorry but I don't understand the structure you use for setting default values. You use many times the <value> tag and in the model you only have onece.

Savoir-Faire Linux, Sandy Carter Canada
2/19/14, 6:04 PM

'auto_install': True wont install it automatically with each new database. It means the module will install itself automatically when all its dependencies are satisfied.

Michael Karrer Austria
8/11/14, 10:38 AM

Hello Mohammad! Thank you very much for the explanation! Very helpfull! Would you mind to add an example to your XML File that shows how we can set configuration variables like: stock.config.settings -> group_stock_packaging to true also? Would be very nice and completes the example ;)

Michael Karrer Austria
8/11/14, 10:40 AM

Sorry - it is already there i simply overlooked it :)

2
Mind And Go France
10/11/13, 5:00 PM

Personnaly, this ressource seems to be also an excellent one : http://anybox.fr/blog/openerp-7-how-to-load-a-language-from-a-module It explains how to deal with transient models

0
Rui Franco Portugal
11/10/15, 11:26 AM

Great! But how can we set a many2one value?


<function model="ir.values" name="set_default">

<value>res.partner</value>

<value>country_id</value>

<value ref='base.pt'/>

</function>


will cause an error

0
Abner Galeno Jr. Philippines
2/8/13, 12:03 PM

I'm not sure if my answer is even close, but I'll give it a shot..

On the log-in page, there is a Manage Databases link and when the link opens, there is a Backup Menu on the left pane. I think this could be one way to backup the database. However, I was never actually able to use that feature, because I always have the error "Access Denied" but maybe, it might work for you.

The other alternative is to install pgadmin, right click the database and click backup.. as described on this old thread: http://forum.openerp.com/forum/topic27824.html

5 Comments
Frédéric RAMANDANIARIVO Madagascar
2/10/13, 12:51 AM

When you finished installing and configuring same modules it's important to create a backup of the database. After, you can go back to it in case of problem.

Jibin India
2/11/13, 4:28 AM

@Abner Galeno Jr. did you give the proper super admin password (default 'admin') ?

Abner Galeno Jr. Philippines
2/11/13, 11:16 AM

yes, i used the default admin password 'admin'. I can drop the databases using the password 'admin' but cant backup using the same password. I have read version 6.xx has this bug too, although it should have been solved already. A fresh openerp server running on a virtual machine behaves the same.

WANTELLET Sylvain France
2/11/13, 11:20 AM

@Abner Galeno Jr. Maybe the pg_dump command from Postgresql is not installed.

Abner Galeno Jr. Philippines
2/11/13, 11:30 AM

I just ran a backup using pgadmin 3 and pgdump seems to be working fine. The command it generated is C:\Program Files\pgAdmin III\1.16\pgdump.exe --host localhost --port 5432 ...

0
Jan Pompe Netherlands
2/9/13, 10:11 PM

I have V7.0 on VMPlayer and did some basic settings. In Win7 I made a copy of the Virtual Machine and renamed it. When I need the template copy I start it from VMPlayer and in OpenERP click on settings-updates and than on the button "Update All" in the upper right corner, which updates all modules. You can also make a copy as a backup.

Ask a Question
Keep Informed
4 follower(s)
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.

Register
Odoo Training Center

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

Test it now