From 5ff3ae203439dbd1d101cad5c88a298889ddf2c6 Mon Sep 17 00:00:00 2001 From: Phil Frost Date: Thu, 3 Jan 2013 18:10:05 -0500 Subject: [PATCH 001/215] kill the executable bit on things that are clearly not executables or scripts bzr revid: pfrost@openerpdev-20130103231005-56pglti6uss0jsm5 --- addons/account_asset/i18n/ca.po | 0 addons/account_asset/i18n/de.po | 0 addons/account_asset/i18n/es.po | 0 addons/account_asset/i18n/es_CR.po | 0 addons/account_asset/i18n/fr.po | 0 addons/account_asset/i18n/fr_BE.po | 0 addons/account_asset/i18n/pl.po | 0 addons/account_asset/i18n/pt.po | 0 addons/account_asset/i18n/sv.po | 0 addons/account_asset/security/ir.model.access.csv | 0 addons/account_asset/wizard/__init__.py | 0 .../wizard/account_asset_change_duration.py | 0 addons/account_asset/wizard/wizard_asset_compute.py | 0 .../lib/zocial/css/zocial-regular-webfont.eot | Bin .../lib/zocial/css/zocial-regular-webfont.svg | 0 .../lib/zocial/css/zocial-regular-webfont.ttf | Bin .../lib/zocial/css/zocial-regular-webfont.woff | Bin addons/base_import/static/lib/select2/README.md | 0 addons/base_import/static/lib/select2/select2.css | 0 addons/base_import/static/lib/select2/select2.js | 0 addons/base_import/static/lib/select2/spinner.gif | Bin addons/l10n_fr/l10n_fr_view.xml | 0 addons/l10n_fr_hr_payroll/__init__.py | 0 addons/l10n_fr_hr_payroll/__openerp__.py | 0 .../l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml | 0 .../l10n_fr_hr_payroll/l10n_fr_hr_payroll_view.xml | 0 addons/l10n_hr/l10n_hr_chart_template.xml | 0 addons/l10n_ro/res_partner.py | 0 addons/mail/static/src/img/email_icon.png | Bin .../static/thunderbird_plugin/install.sh | 1 + .../lib/mousewheel/jquery.mousewheel-3.0.6.js | 0 addons/portal_event/portal_event_view.xml | 0 .../test/purchase_double_validation_test.yml | 0 .../test/purchase_requisition_demo.yml | 0 34 files changed, 1 insertion(+) mode change 100755 => 100644 addons/account_asset/i18n/ca.po mode change 100755 => 100644 addons/account_asset/i18n/de.po mode change 100755 => 100644 addons/account_asset/i18n/es.po mode change 100755 => 100644 addons/account_asset/i18n/es_CR.po mode change 100755 => 100644 addons/account_asset/i18n/fr.po mode change 100755 => 100644 addons/account_asset/i18n/fr_BE.po mode change 100755 => 100644 addons/account_asset/i18n/pl.po mode change 100755 => 100644 addons/account_asset/i18n/pt.po mode change 100755 => 100644 addons/account_asset/i18n/sv.po mode change 100755 => 100644 addons/account_asset/security/ir.model.access.csv mode change 100755 => 100644 addons/account_asset/wizard/__init__.py mode change 100755 => 100644 addons/account_asset/wizard/account_asset_change_duration.py mode change 100755 => 100644 addons/account_asset/wizard/wizard_asset_compute.py mode change 100755 => 100644 addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.eot mode change 100755 => 100644 addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.svg mode change 100755 => 100644 addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.ttf mode change 100755 => 100644 addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.woff mode change 100755 => 100644 addons/base_import/static/lib/select2/README.md mode change 100755 => 100644 addons/base_import/static/lib/select2/select2.css mode change 100755 => 100644 addons/base_import/static/lib/select2/select2.js mode change 100755 => 100644 addons/base_import/static/lib/select2/spinner.gif mode change 100755 => 100644 addons/l10n_fr/l10n_fr_view.xml mode change 100755 => 100644 addons/l10n_fr_hr_payroll/__init__.py mode change 100755 => 100644 addons/l10n_fr_hr_payroll/__openerp__.py mode change 100755 => 100644 addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml mode change 100755 => 100644 addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_view.xml mode change 100755 => 100644 addons/l10n_hr/l10n_hr_chart_template.xml mode change 100755 => 100644 addons/l10n_ro/res_partner.py mode change 100755 => 100644 addons/mail/static/src/img/email_icon.png mode change 100755 => 100644 addons/point_of_sale/static/lib/mousewheel/jquery.mousewheel-3.0.6.js mode change 100755 => 100644 addons/portal_event/portal_event_view.xml mode change 100755 => 100644 addons/purchase_double_validation/test/purchase_double_validation_test.yml mode change 100755 => 100644 addons/purchase_requisition/test/purchase_requisition_demo.yml diff --git a/addons/account_asset/i18n/ca.po b/addons/account_asset/i18n/ca.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/de.po b/addons/account_asset/i18n/de.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/es.po b/addons/account_asset/i18n/es.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/es_CR.po b/addons/account_asset/i18n/es_CR.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/fr.po b/addons/account_asset/i18n/fr.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/fr_BE.po b/addons/account_asset/i18n/fr_BE.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/pl.po b/addons/account_asset/i18n/pl.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/pt.po b/addons/account_asset/i18n/pt.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/i18n/sv.po b/addons/account_asset/i18n/sv.po old mode 100755 new mode 100644 diff --git a/addons/account_asset/security/ir.model.access.csv b/addons/account_asset/security/ir.model.access.csv old mode 100755 new mode 100644 diff --git a/addons/account_asset/wizard/__init__.py b/addons/account_asset/wizard/__init__.py old mode 100755 new mode 100644 diff --git a/addons/account_asset/wizard/account_asset_change_duration.py b/addons/account_asset/wizard/account_asset_change_duration.py old mode 100755 new mode 100644 diff --git a/addons/account_asset/wizard/wizard_asset_compute.py b/addons/account_asset/wizard/wizard_asset_compute.py old mode 100755 new mode 100644 diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.eot b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.eot old mode 100755 new mode 100644 diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.svg b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.svg old mode 100755 new mode 100644 diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.ttf b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.ttf old mode 100755 new mode 100644 diff --git a/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.woff b/addons/auth_oauth/static/lib/zocial/css/zocial-regular-webfont.woff old mode 100755 new mode 100644 diff --git a/addons/base_import/static/lib/select2/README.md b/addons/base_import/static/lib/select2/README.md old mode 100755 new mode 100644 diff --git a/addons/base_import/static/lib/select2/select2.css b/addons/base_import/static/lib/select2/select2.css old mode 100755 new mode 100644 diff --git a/addons/base_import/static/lib/select2/select2.js b/addons/base_import/static/lib/select2/select2.js old mode 100755 new mode 100644 diff --git a/addons/base_import/static/lib/select2/spinner.gif b/addons/base_import/static/lib/select2/spinner.gif old mode 100755 new mode 100644 diff --git a/addons/l10n_fr/l10n_fr_view.xml b/addons/l10n_fr/l10n_fr_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_fr_hr_payroll/__init__.py b/addons/l10n_fr_hr_payroll/__init__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_fr_hr_payroll/__openerp__.py b/addons/l10n_fr_hr_payroll/__openerp__.py old mode 100755 new mode 100644 diff --git a/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_data.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_view.xml b/addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll_view.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_hr/l10n_hr_chart_template.xml b/addons/l10n_hr/l10n_hr_chart_template.xml old mode 100755 new mode 100644 diff --git a/addons/l10n_ro/res_partner.py b/addons/l10n_ro/res_partner.py old mode 100755 new mode 100644 diff --git a/addons/mail/static/src/img/email_icon.png b/addons/mail/static/src/img/email_icon.png old mode 100755 new mode 100644 diff --git a/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh b/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh index e1103b30acf..5ca7a5a934a 100755 --- a/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh +++ b/addons/plugin_thunderbird/static/thunderbird_plugin/install.sh @@ -1,3 +1,4 @@ +#!/bin/sh make clean make cp ../openerp_plugin.xpi /home/openerp/ diff --git a/addons/point_of_sale/static/lib/mousewheel/jquery.mousewheel-3.0.6.js b/addons/point_of_sale/static/lib/mousewheel/jquery.mousewheel-3.0.6.js old mode 100755 new mode 100644 diff --git a/addons/portal_event/portal_event_view.xml b/addons/portal_event/portal_event_view.xml old mode 100755 new mode 100644 diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml old mode 100755 new mode 100644 diff --git a/addons/purchase_requisition/test/purchase_requisition_demo.yml b/addons/purchase_requisition/test/purchase_requisition_demo.yml old mode 100755 new mode 100644 From 62a44180f64b19f1d428e9a47982be6edd0e573e Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Thu, 10 Jan 2013 18:18:16 +0530 Subject: [PATCH 002/215] [Fix]Fixed the space isuue in product label report lp bug: https://launchpad.net/bugs/1064691 fixed bzr revid: ggh@tinyerp.com-20130110124816-4xmp05eqgs00n3ef --- addons/product/report/product_label.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/report/product_label.xsl b/addons/product/report/product_label.xsl index 641db73ea7d..5dbb2d64a28 100644 --- a/addons/product/report/product_label.xsl +++ b/addons/product/report/product_label.xsl @@ -67,7 +67,7 @@ - + From c9c5f4b7859cb414d37d99f25297f4175c7df74f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 24 Jan 2013 19:28:08 +0100 Subject: [PATCH 003/215] [FIX] res.config.installer: correct module installing bzr revid: chs@openerp.com-20130124182808-5xvdc0mqst0h2970 --- openerp/addons/base/res/res_config.py | 90 ++++++++++++++++----------- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index a2368a9f508..4c59180acc3 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -21,14 +21,47 @@ import logging from operator import attrgetter -import openerp -from openerp import pooler from openerp.osv import osv, fields from openerp.tools import ustr from openerp.tools.translate import _ _logger = logging.getLogger(__name__) + +class res_config_module_installation_mixin(object): + def _install_modules(self, cr, uid, modules, context): + """Install the requested modules. + return the next action to execute + + modules is a list of tuples + (mod_name, browse_record | None) + """ + ir_module = self.pool.get('ir.module.module') + to_install_ids = [] + to_install_missing_names = [] + + for name, module in modules: + if not module: + to_install_missing_names.append(name) + elif module.state == 'uninstalled': + to_install_ids.append(module.id) + + if to_install_ids: + ir_module.button_immediate_install(cr, uid, to_install_ids, context=context) + + if to_install_missing_names: + return { + 'type': 'ir.actions.client', + 'tag': 'apps', + 'params': {'modules': to_install_missing_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 + + return None + class res_config_configurable(osv.osv_memory): ''' Base classes for new-style configuration items @@ -153,7 +186,7 @@ class res_config_configurable(osv.osv_memory): res_config_configurable() -class res_config_installer(osv.osv_memory): +class res_config_installer(osv.osv_memory, res_config_module_installation_mixin): """ New-style configuration base specialized for addons selection and installation. @@ -351,17 +384,18 @@ class res_config_installer(osv.osv_memory): return fields def execute(self, cr, uid, ids, context=None): - modules = self.pool.get('ir.module.module') to_install = list(self.modules_to_install( cr, uid, ids, context=context)) _logger.info('Selecting addons %s to install', to_install) - modules.state_update( - cr, uid, - modules.search(cr, uid, [('name','in',to_install)]), - 'to install', ['uninstalled'], context=context) - cr.commit() - openerp.modules.registry.RegistryManager.signal_registry_change(cr.dbname) - new_db, self.pool = pooler.restart_pool(cr.dbname, update_module=True) + + ir_module = self.pool.get('ir.module.module') + modules = [] + for name in to_install: + mod_ids = ir_module.search(cr, uid, [('name', '=', name)]) + record = ir_module.browse(cr, uid, mod_ids[0], context) if mod_ids else None + modules.append((name, record)) + + return self._install_modules(cr, uid, modules, context=context) res_config_installer() @@ -402,8 +436,7 @@ class ir_actions_configuration_wizard(osv.osv_memory): ir_actions_configuration_wizard() - -class res_config_settings(osv.osv_memory): +class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): """ Base configuration wizard for application settings. It provides support for setting default values, assigning groups to employee users, and installing modules. To make such a 'settings' wizard, define a model like:: @@ -527,37 +560,22 @@ class res_config_settings(osv.osv_memory): getattr(self, method)(cr, uid, ids, context) # module fields: install/uninstall the selected modules - to_install_missing_names = [] + to_install = [] to_uninstall_ids = [] - to_install_ids = [] lm = len('module_') for name, module in classified['module']: if config[name]: - if not module: - # missing module, will be provided by apps.openerp.com - to_install_missing_names.append(name[lm:]) - elif module.state == 'uninstalled': - # local module, to be installed - to_install_ids.append(module.id) + to_install.append((name[lm:], module)) else: if module and module.state in ('installed', 'to upgrade'): to_uninstall_ids.append(module.id) if to_uninstall_ids: ir_module.button_immediate_uninstall(cr, uid, to_uninstall_ids, context=context) - if to_install_ids: - ir_module.button_immediate_install(cr, uid, to_install_ids, context=context) - if to_install_missing_names: - return { - 'type': 'ir.actions.client', - 'tag': 'apps', - 'params': {'modules': to_install_missing_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 + action = self._install_modules(cr, uid, to_install, context=context) + if action: + return action # force client-side reload (update user menu and current view) return { @@ -572,17 +590,17 @@ class res_config_settings(osv.osv_memory): if action_ids: return act_window.read(cr, uid, action_ids[0], [], context=context) return {} - + def name_get(self, cr, uid, ids, context=None): """ Override name_get method to return an appropriate configuration wizard name, and not the generated name.""" - + if not ids: return [] # name_get may receive int id instead of an id list if isinstance(ids, (int, long)): ids = [ids] - + act_window = self.pool.get('ir.actions.act_window') action_ids = act_window.search(cr, uid, [('res_model', '=', self._name)], context=context) name = self._name From 4c89124778a1516cd3371347831bb4b6f1e60a74 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 24 Jan 2013 20:00:39 +0100 Subject: [PATCH 004/215] [IMP] account: installer get list of charts from apps bzr revid: chs@openerp.com-20130124190039-qhcyrnrgpue0rak5 --- addons/account/installer.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index d02e7196d4d..aba88975e41 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -23,10 +23,16 @@ import datetime from dateutil.relativedelta import relativedelta import logging from operator import itemgetter -from os.path import join as opj import time +import urllib2 +import urlparse -from openerp import netsvc, tools +try: + import simplejson as json +except ImportError: + import json # noqa + +from openerp.release import serie from openerp.tools.translate import _ from openerp.osv import fields, osv @@ -38,13 +44,28 @@ class account_installer(osv.osv_memory): def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') + + # try get the list on apps server + try: + apps_server = self.pool.get('ir.config_parameter').get_value(cr, uid, 'apps.server', 'https://apps.openerp.com') + + up = urlparse.urlparse(apps_server) + url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) + + j = urllib2.urlopen(url, timeout=3).read() + apps_charts = json.loads(j) + + charts = dict(apps_charts) + except Exception: + charts = dict() + # Looking for the module with the 'Account Charts' category category_name, category_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'module_category_localization_account_charts') ids = modules.search(cr, uid, [('category_id', '=', category_id)], context=context) - charts = list( - sorted(((m.name, m.shortdesc) - for m in modules.browse(cr, uid, ids, context=context)), - key=itemgetter(1))) + if ids: + charts.update((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids, context=context)) + + charts = sorted(charts.items(), key=itemgetter(1)) charts.insert(0, ('configurable', _('Custom'))) return charts From a78531df4393b3850b718865df5b748d696975e5 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 25 Jan 2013 13:11:27 +0100 Subject: [PATCH 005/215] [FIX] account: installer: call right method bzr revid: chs@openerp.com-20130125121127-j7i3rwskqojyp8nm --- addons/account/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index aba88975e41..995e3986af4 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -47,7 +47,7 @@ class account_installer(osv.osv_memory): # try get the list on apps server try: - apps_server = self.pool.get('ir.config_parameter').get_value(cr, uid, 'apps.server', 'https://apps.openerp.com') + apps_server = self.pool.get('ir.config_parameter').get_param(cr, uid, 'apps.server', 'https://apps.openerp.com') up = urlparse.urlparse(apps_server) url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) From 16289266c99096a1770fd6039539da26a0ce7c0f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 25 Jan 2013 14:34:53 +0100 Subject: [PATCH 006/215] [FIX] res.config.installer: correct module installing bzr revid: chs@openerp.com-20130125133453-aqu5eotetdyb2zpj --- openerp/addons/base/res/res_config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 4c59180acc3..1ca6fd57cfa 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -56,10 +56,6 @@ class res_config_module_installation_mixin(object): 'params': {'modules': to_install_missing_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 - return None class res_config_configurable(osv.osv_memory): @@ -577,6 +573,10 @@ class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): if action: return action + 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', From e0284cfe90a75ce815ba31d452eef15c676515ca Mon Sep 17 00:00:00 2001 From: "Ravi Gohil (OpenERP)" Date: Fri, 22 Feb 2013 11:57:54 +0530 Subject: [PATCH 007/215] [FIX] Passed context in write(...)(Courtesy: Humberto Arocha(hbto)). (Maintenance Case: 586824) lp bug: https://launchpad.net/bugs/1088086 fixed bzr revid: rgo@tinyerp.com-20130222062754-nbsp6a491xzm63kw --- openerp/addons/base/res/res_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_company.py b/openerp/addons/base/res/res_company.py index 022c9c06da0..c8ea8d7856e 100644 --- a/openerp/addons/base/res/res_company.py +++ b/openerp/addons/base/res/res_company.py @@ -97,7 +97,7 @@ class res_company(osv.osv): address_data = part_obj.address_get(cr, uid, [company.partner_id.id], adr_pref=['default']) address = address_data['default'] if address: - part_obj.write(cr, uid, [address], {name: value or False}) + part_obj.write(cr, uid, [address], {name: value or False}, context=context) else: part_obj.create(cr, uid, {name: value or False, 'parent_id': company.partner_id.id}, context=context) return True From 5cb1835e26a3868df3a0a71b3329bea17f455327 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 15 Mar 2013 15:24:03 +0100 Subject: [PATCH 008/215] [FIX] add missing context on compute call in pricelist price_get_multi context lp bug: https://launchpad.net/bugs/1155624 fixed bzr revid: yannick.vaucher@camptocamp.com-20130315142403-gz7fy7etwzls96rt --- addons/product/pricelist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 73707e39807..3a466191795 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -236,7 +236,10 @@ class product_pricelist(osv.osv): qty, context=context)[res['base_pricelist_id']] ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id uom_price_already_computed = True - price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False) + price = currency_obj.compute(cr, uid, + ptype_src, res['currency_id'], + price_tmp, round=False, + context=context) elif res['base'] == -2: # this section could be improved by moving the queries outside the loop: where = [] From 30073a2e8ff9fdda3e2f4d68bbbe2bd78b427170 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Tue, 19 Mar 2013 11:20:08 +0100 Subject: [PATCH 009/215] [FIX] race condition in session directory creation try to create the directory and handle the possible exception instead of doing an unsafe 2 step check and creation. The issues related to the naming of the directory mentionned in the bug report are not handled. lp bug: https://launchpad.net/bugs/1157102 fixed bzr revid: alexandre.fayolle@camptocamp.com-20130319102008-omtaka8dtq9v7m1l --- addons/web/http.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/web/http.py b/addons/web/http.py index e05d74e0873..d12cdfb13a1 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -20,6 +20,7 @@ import traceback import urlparse import uuid import xmlrpclib +import errno import babel.core import simplejson @@ -477,8 +478,15 @@ def session_path(): except Exception: username = "unknown" path = os.path.join(tempfile.gettempdir(), "oe-sessions-" + username) - if not os.path.exists(path): + try: os.mkdir(path, 0700) + except OSError as exc: + if exc.errno == errno.EEXIST: + # directory exists: ensure it has the correct permissions + # this will fail if the directory is not owned by the current user + os.chmod(path, 0700) + else: + raise return path class Root(object): From 8548a69f73c03fdbfeb7fdb722b95ae38363b5b5 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 27 Mar 2013 11:38:33 +0100 Subject: [PATCH 010/215] [FIX] Timesheets invoiced as expenses are and correction removed in invoiced calculation bzr revid: jco@openerp.com-20130327103833-ekjzi3e0alkpod35 --- .../account_analytic_analysis.py | 23 +++++++++++++++---- .../account_analytic_analysis_view.xml | 4 ++-- .../analytic_contract_hr_expense.py | 2 -- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index a187f9452f5..17988294861 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -211,12 +211,10 @@ class account_analytic_account(osv.osv): JOIN account_analytic_journal \ ON account_analytic_line.journal_id = account_analytic_journal.id \ WHERE account_analytic_line.account_id IN %s \ - AND account_analytic_journal.type = 'sale' \ - GROUP BY account_analytic_line.account_id", (child_ids,)) + AND account_analytic_journal.type = 'sale' \ + GROUP BY account_analytic_line.account_id", (child_ids,)) for account_id, sum in cr.fetchall(): res[account_id] = round(sum,2) - for acc in self.browse(cr, uid, res.keys(), context=context): - res[acc.id] = res[acc.id] - (acc.timesheet_ca_invoiced or 0.0) res_final = res return res_final @@ -543,6 +541,23 @@ class account_analytic_account(osv.osv): pass return result + + def hr_to_invoice_timesheets(self, cr, uid, ids, context=None): + domain = [('invoice_id','=',False),('to_invoice','!=',False), ('journal_id.type', '=', 'general'), ('account_id', 'in', ids)] + names = [record.name for record in self.browse(cr, uid, ids, context=context)] + name = _('Timesheets to Invoice of %s') % ','.join(names) + return { + 'type': 'ir.actions.act_window', + 'name': name, + 'view_type': 'form', + 'view_mode': 'tree,form', + 'domain' : domain, + 'res_model': 'account.analytic.line', + 'nodestroy': True, + } + + + class account_analytic_account_summary_user(osv.osv): _name = "account_analytic_analysis.summary.user" _description = "Hours Summary by User" diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index a9437267611..d82a1789b2b 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -98,8 +98,8 @@ -