Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/l10n_be/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
'views/report_vatpartnerlisting.xml',
],
'demo': [],
'installable': True,
'installable': False,
'images': ['images/1_config_chart_l10n_be.jpeg','images/2_l10n_be_chart.jpeg'],
}

Expand Down
2 changes: 1 addition & 1 deletion addons/l10n_be_hr_payroll_account/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'l10n_be_hr_payroll_account_data.xml',
'data/hr.salary.rule.csv',
],
'installable': True
'installable': False
}

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
29 changes: 28 additions & 1 deletion openerp/addons/base/ir/ir_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
from openerp.tools.translate import _
from openerp.osv.orm import except_orm, browse_record, MAGIC_COLUMNS

from openerp.openupgrade import openupgrade_log, openupgrade

_logger = logging.getLogger(__name__)

MODULE_UNINSTALL_FLAG = '_force_unlink'
Expand Down Expand Up @@ -145,6 +147,11 @@ def _name_search(self, cr, uid, name='', args=None, operator='ilike', context=No

def _drop_table(self, cr, uid, ids, context=None):
for model in self.browse(cr, uid, ids, context):
# OpenUpgrade: do not run the new table cleanup
openupgrade.message(
cr, 'Unknown', False, False,
"Not dropping the table or view of model %s", model.model)
continue
model_pool = self.pool[model.model]
cr.execute('select relkind from pg_class where relname=%s', (model_pool._table,))
result = cr.fetchone()
Expand Down Expand Up @@ -304,6 +311,12 @@ def _drop_column(self, cr, uid, ids, context=None):
for field in self.browse(cr, uid, ids, context):
if field.name in MAGIC_COLUMNS:
continue
# OpenUpgrade: do not run the new column cleanup
openupgrade.message(
cr, 'Unknown', False, False,
"Not dropping the column of field %s of model %s", field.name, field.model)
continue

model = self.pool[field.model]
cr.execute('select relkind from pg_class where relname=%s', (model._table,))
result = cr.fetchone()
Expand Down Expand Up @@ -953,6 +966,10 @@ def unlink(self, cr, uid, ids, context=None):
return super(ir_model_data,self).unlink(cr, uid, ids, context=context)

def _update(self,cr, uid, model, module, values, xml_id=False, store=True, noupdate=False, mode='init', res_id=False, context=None):
#OpenUpgrade: log entry (used in csv import)
if xml_id:
openupgrade_log.log_xml_id(cr, module, xml_id)

model_obj = self.pool[model]
if not context:
context = {}
Expand Down Expand Up @@ -1179,7 +1196,17 @@ def _process_end(self, cr, uid, modules):
for (model, res_id) in to_unlink:
if model in self.pool:
_logger.info('Deleting %s@%s', res_id, model)
self.pool[model].unlink(cr, uid, [res_id])
try:
cr.execute('SAVEPOINT ir_model_data_delete');
self.pool[model].unlink(cr, uid, [res_id])
cr.execute('RELEASE SAVEPOINT ir_model_data_delete')
except Exception:
cr.execute('ROLLBACK TO SAVEPOINT ir_model_data_delete');
_logger.warning(
'Could not delete obsolete record with id: %d of model %s\n'
'Please refer to the log message right above',
res_id, model)


class wizard_model_menu(osv.osv_memory):
_name = 'wizard.ir.model.menu.create'
Expand Down
14 changes: 11 additions & 3 deletions openerp/addons/base/res/res_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,17 @@ def init(self, cr):
# we would allow duplicate "global" currencies (all having company_id == NULL)
cr.execute("""SELECT indexname FROM pg_indexes WHERE indexname = 'res_currency_unique_name_company_id_idx'""")
if not cr.fetchone():
cr.execute("""CREATE UNIQUE INDEX res_currency_unique_name_company_id_idx
ON res_currency
(name, (COALESCE(company_id,-1)))""")
try:
cr.execute('SAVEPOINT index_currency');
cr.execute("""CREATE UNIQUE INDEX res_currency_unique_name_company_id_idx
ON res_currency
(name, (COALESCE(company_id,-1)))""")
cr.execute('RELEASE SAVEPOINT index_currency');
except Exception, e:
cr.execute('ROLLBACK TO SAVEPOINT index_currency');
import logging
logging.getLogger('OpenUpgrade').debug(
'Could not create currency unique index: %s', e)

def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
res = super(res_currency, self).read(cr, user, ids, fields, context, load)
Expand Down
2 changes: 2 additions & 0 deletions openerp/addons/openupgrade_records/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import model
import lib
63 changes: 63 additions & 0 deletions openerp/addons/openupgrade_records/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module Copyright (C) 2012-2014 OpenUpgrade community
# https://launchpad.net/~openupgrade-committers
#
# Contributors:
# 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/>.
#
##############################################################################


{
'name': 'OpenUpgrade Records',
'version': '0.2',
'category': 'Normal',
'description': """Allow OpenUpgrade records to be
stored in the database and compare with other servers.

This module depends on OpenERP client lib:

easy_install openerp-client-lib

""",
'author': 'OpenUpgrade Community',
'maintainer': 'OpenUpgrade Community',
'contributors': ['Therp BV'],
'website': 'https://launchpad.net/~openupgrade-committers',
'depends': [],
'init_xml': [],
'update_xml': [
'view/openupgrade_record.xml',
'view/comparison_config.xml',
'view/analysis_wizard.xml',
'view/generate_records_wizard.xml',
'view/install_all_wizard.xml',
'security/ir.model.access.csv',
],
'demo_xml': [
],
'test': [
],
'installable': True,
'auto_install': False,
'external_dependencies': {
'python': ['openerplib'],
},
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
63 changes: 63 additions & 0 deletions openerp/addons/openupgrade_records/__terp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module Copyright (C) 2012-2014 OpenUpgrade community
# https://launchpad.net/~openupgrade-committers
#
# Contributors:
# 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/>.
#
##############################################################################


{
'name': 'OpenUpgrade Records',
'version': '0.2',
'category': 'Normal',
'description': """Allow OpenUpgrade records to be
stored in the database and compare with other servers.

This module depends on OpenERP client lib:

easy_install openerp-client-lib

""",
'author': 'OpenUpgrade Community',
'maintainer': 'OpenUpgrade Community',
'contributors': ['Therp BV'],
'website': 'https://launchpad.net/~openupgrade-committers',
'depends': [],
'init_xml': [],
'update_xml': [
'view/openupgrade_record.xml',
'view/comparison_config.xml',
'view/analysis_wizard.xml',
'view/generate_records_wizard.xml',
'view/install_all_wizard.xml',
'security/ir.model.access.csv',
],
'demo_xml': [
],
'test': [
],
'installable': True,
'auto_install': False,
'external_dependencies': {
'python': ['openerplib'],
},
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2 changes: 2 additions & 0 deletions openerp/addons/openupgrade_records/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import apriori
import compare
9 changes: 9 additions & 0 deletions openerp/addons/openupgrade_records/lib/apriori.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
""" Encode any known changes to the database here
to help the matching process
"""

renamed_modules = {
}

renamed_models = {
}
Loading