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>
If there was a way to purge transaction and master file data, I believe that would do what you are looking for. That way you could take and existing company, and use it as a template for other setups. I have seen other systems that do this, and I found it extremely helpful. Is that what you are look
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