__openerp__.py 3.5 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
# -*- encoding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
    "name": "Database Upgrade",
    "version": "0.1",
    "depends": ["web"],
    "author": "Smile",
    "license": 'AGPL-3',
    "description": """Smile Upgrade

Features

    * Allow to upgrade automatically database after code update and server restarting

Execution

    openerp-server -c <config_file> -d <db_name> --load=web,smile_upgrade

Configuration

    * Upgrades structure
        <project_directory>
        `-- upgrades
            |-- 1.1
            |   |-- __init__.py
            |   |-- __upgrade__.py
            |   |-- *.sql
            |   |-- *.yml                   # only for post-load
            |   |-- *.csv                   # only for post-load
            |   `-- *.xml                   # only for post-load
            |-- 1.2
            |   |-- __init__.py
            |   |-- __upgrade__.py
            |   `-- *.sql
            `-- upgrade.conf

    * Upgrades configuration -- upgrade.conf
        [options]
        version=1.2

    * Upgrade configuration -- __upgrade__.py
        Content: dictonary with the following keys:
            * version
            * databases: let's empty if valid for all databases
            * description
            * modules_to_install_at_creation: modules list to install at database creation
            * modules_to_upgrade: modules list to update or install
            * pre-load: list of .sql files
            * post-load: list with .sql, .yml, .csv and .xml files
                         with path .../filename (depending upgrades_path)
                         or module_name/.../filename

    * OpenERP server configuration -- rcfile=~/.openerp_serverrc
        [options]
        server_wide_modules = web,smile_upgrade
        upgrades_path = <project_directory>
        stop_after_upgrades = True if you want to stop server after upgrades else False

Additional features

    * In post-load, you can replace filename string by tuple
      (filename, 'rollback_and_continue' or 'not_rollback_and_continue' or 'raise') -- default value = 'raise'
    * In .yml files, add context['store_in_secure_mode'] = True
      if you want to compute fields.function (_store_set_values)
      by catching errors and logging them {record_id: error}

Suggestions & Feedback to: corentin.pouhet-brunerie@smile.fr
    """,
    "summary": "",
    "website": "http://www.smile.fr",
    "category": 'Hidden',
    "sequence": 20,
    "data": [
        "views/webclient_templates.xml",
    ],
    "qweb": [
        "static/src/xml/code_version.xml",
    ],
    "auto_install": True,
    "installable": True,
    "application": False,
}