Skip to content

Commit

Permalink
Merge pull request #218 from StefanRijnhart/add/14.0/upgrade_path__ap…
Browse files Browse the repository at this point in the history
…riori_json

[ADD] Support for --upgrade-path
  • Loading branch information
pedrobaeza authored Dec 10, 2020
2 parents 01e27a9 + 6ae6148 commit 519a093
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 34 deletions.
51 changes: 39 additions & 12 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,48 @@ Development Lead
Contributors
------------

* Stefan Rijnhart
* David Béal
* Sylvain LE GAL
* Holger Brunn
* Sandy Carter
* Alexandre Fayolle
* Alexis de Lattre
* Arthur Vuillard
* Florent Xicluna
* Benoit Guillot
* Paulius Sladkevičius
* Bogdan Stanciu
* Christoph Giesel
* Daniel Reis
* David Arnold
* David Béal
* David Vidal
* Dimitrios T. Tanis
* Dmytro Katyukha
* Ernesto Tejeda
* Florent Xicluna
* Florian Dacosta
* Alexandre Fayolle
* Pedro M. Baeza
* Graeme Gellatly
* Hector Villarreal Ortega
* Hervé Martinet
* Holger Brunn
* Ivàn Todorovich
* Jairo Llopis
* Jordi Riera
* Juan Pablo Arias
* Julien Coux
* Katherine Zaoral
* Kay Häusler
* Manuel Vázquez Acosta
* Miku Laitinen
* Christoph Giesel
* Jordi Riera

* Miquel Raich
* Moisés López
* Paulius Sladkevičius
* Pedro M. Baeza
* Petar Najman
* Robert Rübner
* Ronald Portier
* Sandy Carter
* Sebastien Alix
* Silvija Butko
* Stefan Rijnhart
* Stephane Le Cornec
* Stéphane Bidoul
* Sylvain LE GAL
* Tom Blauwendraat
* Yann Bongiovanni
* Yuri Quintana
37 changes: 15 additions & 22 deletions openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2011-2013 Therp BV (<http://therp.nl>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright (C) 2011-2013 Therp BV (<http://therp.nl>)
# Copyright Odoo Community Association (OCA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import sys
import os
Expand Down Expand Up @@ -269,7 +252,7 @@ def load_data(cr, module_name, filename, idref=None, mode='init'):
:param module_name: the name of the module
:param filename: the path to the filename, relative to the module \
directory.
directory. This may also be the module directory relative to --upgrade-path
:param idref: optional hash with ?id mapping cache?
:param mode:
one of 'init', 'update', 'demo', 'init_no_create'.
Expand All @@ -288,7 +271,17 @@ def load_data(cr, module_name, filename, idref=None, mode='init'):
logger.info('%s: loading %s' % (module_name, filename))
_, ext = os.path.splitext(filename)
pathname = os.path.join(module_name, filename)
fp = tools.file_open(pathname)

try:
fp = tools.file_open(pathname)
except OSError:
if tools.config.get('upgrade_path'):
pathname = os.path.join(
tools.config['upgrade_path'], module_name, filename)
fp = open(pathname)
else:
raise

try:
if ext == '.csv':
noupdate = True
Expand Down

0 comments on commit 519a093

Please sign in to comment.