diff --git a/doc/test-framework.rst b/doc/test-framework.rst index 56951b1a8e1..17a7b480640 100644 --- a/doc/test-framework.rst +++ b/doc/test-framework.rst @@ -87,9 +87,9 @@ In addition to the above possibilities, when invoked with a non-existing module sub-modules. Depending on the unittest2_ class that is used to write the tests (see -``openerp.tests.common`` for some helper classes that you can re-use), a database -may be created before the test is run, and the module providing the test will -be installed on that database. +:mod:`openerp.tests.common` for some helper classes that you can re-use), a +database may be created before the test is run, and the module providing the +test will be installed on that database. Because creating a database, installing modules, and then dropping it is expensive, it is possible to interleave the run of the ``fast_suite`` tests @@ -98,3 +98,20 @@ each requested module is installed, its fast_suite tests are run. The database is thus created and dropped (and the modules installed) only once. .. _unittest2: http://pypi.python.org/pypi/unittest2 + +TestCase subclasses +------------------- + +.. automodule:: openerp.tests.common + :members: + +.. note:: + + The `setUp` and `tearDown` methods are not part of the tests. Uncaught + exceptions in those methods are errors, not test failures. In particular, + a failing `setUp` will not be followed by a `tearDown` causing any + allocated resource in the `setUp` to not be released by the `tearDown`. + + In the :py:class:`openerp.tests.common.TransactionCase` and + :py:class:`openerp.tests.common.SingleTransactionCase`, this means the + test suite can hang because of unclosed cursors. diff --git a/openerp-server b/openerp-server index d834b7cf7ec..c1991992011 100755 --- a/openerp-server +++ b/openerp-server @@ -101,6 +101,7 @@ def preload_registry(dbname): def run_test_file(dbname, test_file): """ Preload a registry, possibly run a test file, and start the cron.""" try: + config = openerp.tools.config db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False) cr = db.cursor() _logger.info('loading test file %s', test_file) diff --git a/openerp/addons/base/i18n/ru.po b/openerp/addons/base/i18n/ru.po index 0e97644b80e..7969b36fc35 100644 --- a/openerp/addons/base/i18n/ru.po +++ b/openerp/addons/base/i18n/ru.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2012-02-08 00:44+0000\n" -"PO-Revision-Date: 2012-10-23 18:39+0000\n" +"PO-Revision-Date: 2012-10-25 07:14+0000\n" "Last-Translator: Chertykov Denis \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n" -"X-Generator: Launchpad (build 16179)\n" +"X-Launchpad-Export-Date: 2012-10-26 04:55+0000\n" +"X-Generator: Launchpad (build 16194)\n" #. module: base #: model:res.country,name:base.sh @@ -4520,7 +4520,7 @@ msgstr "Португалия" #. module: base #: model:ir.module.module,shortdesc:base.module_share msgid "Share any Document" -msgstr "Совместный доступ r любым документам" +msgstr "Совместный доступ к любым документам" #. module: base #: field:ir.module.module,certificate:0 diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 4978378f22a..730df212b4c 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -57,7 +57,7 @@ class ir_attachment(osv.osv): def _search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None): ids = super(ir_attachment, self)._search(cr, uid, args, offset=offset, limit=limit, order=order, - context=context, count=count, + context=context, count=False, access_rights_uid=access_rights_uid) if not ids: if count: diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index 5ab546cb554..43ece8c0868 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -132,20 +132,29 @@ class ir_ui_menu(osv.osv): return len(result) return result - def _get_full_name(self, cr, uid, ids, name, args, context): - res = {} - for m in self.browse(cr, uid, ids, context=context): - res[m.id] = self._get_one_full_name(m) + def name_get(self, cr, uid, ids, context=None): + res = [] + for id in ids: + elmt = self.browse(cr, uid, id, context=context) + res.append((id, self._get_one_full_name(elmt))) return res - def _get_one_full_name(self, menu, level=6): + def _get_full_name(self, cr, uid, ids, name=None, args=None, context=None): + if context == None: + context = {} + res = {} + for elmt in self.browse(cr, uid, ids, context=context): + res[elmt.id] = self._get_one_full_name(elmt) + return res + + def _get_one_full_name(self, elmt, level=6): if level<=0: return '...' - if menu.parent_id: - parent_path = self._get_one_full_name(menu.parent_id, level-1) + "/" + if elmt.parent_id: + parent_path = self._get_one_full_name(elmt.parent_id, level-1) + "/" else: parent_path = '' - return parent_path + menu.name + return parent_path + elmt.name def create(self, *args, **kwargs): self.clear_cache() @@ -282,7 +291,7 @@ class ir_ui_menu(osv.osv): 'groups_id': fields.many2many('res.groups', 'ir_ui_menu_group_rel', 'menu_id', 'gid', 'Groups', help="If you have groups, the visibility of this menu will be based on these groups. "\ "If this field is empty, OpenERP will compute visibility based on the related object's read access."), - 'complete_name': fields.function(_get_full_name, + 'complete_name': fields.function(_get_full_name, string='Full Path', type='char', size=128), 'icon': fields.selection(tools.icons, 'Icon', size=64), 'icon_pict': fields.function(_get_icon_pict, type='char', size=32), diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml index 101e4094dea..3ed09940c8f 100644 --- a/openerp/addons/base/module/module_view.xml +++ b/openerp/addons/base/module/module_view.xml @@ -120,7 +120,7 @@ ir.module.module.form ir.module.module -
+
diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 93afe1acade..055781ccd42 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -361,6 +361,7 @@ class res_config_installer(osv.osv_memory): 'to install', ['uninstalled'], context=context) cr.commit() #TOFIX: after remove this statement, installation wizard is fail new_db, self.pool = pooler.restart_pool(cr.dbname, update_module=True) + res_config_installer() DEPRECATION_MESSAGE = 'You are using an addon using old-style configuration '\ @@ -546,6 +547,10 @@ class res_config_settings(osv.osv_memory): 'params': {'modules': to_install_names}, } + config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} + if config.get('type') not in ('ir.actions.act_window_close',): + return config + # force client-side reload (update user menu and current view) return { 'type': 'ir.actions.client', diff --git a/openerp/addons/base/res/res_country.py b/openerp/addons/base/res/res_country.py index 35fb2a29ea7..98a3b769a11 100644 --- a/openerp/addons/base/res/res_country.py +++ b/openerp/addons/base/res/res_country.py @@ -47,7 +47,7 @@ class Country(osv.osv): help='The full name of the country.', required=True, translate=True), 'code': fields.char('Country Code', size=2, help='The ISO country code in two chars.\n' - 'You can use this field for quick search.', required=True), + 'You can use this field for quick search.'), 'address_format': fields.text('Address Format', help="""You can state here the usual format to use for the \ addresses belonging to this country.\n\nYou can use the python-style string patern with all the field of the address \ (for example, use '%(street)s' to display the field 'street') plus diff --git a/openerp/addons/base/res/res_country_view.xml b/openerp/addons/base/res/res_country_view.xml index 47b665426f9..8f64d330440 100644 --- a/openerp/addons/base/res/res_country_view.xml +++ b/openerp/addons/base/res/res_country_view.xml @@ -31,8 +31,7 @@ -