From 0eeab361d9c14081a5f4d32cfc0a2a67fc0eeead Mon Sep 17 00:00:00 2001 From: Temur Vibliani Date: Thu, 19 Feb 2015 12:56:20 +0400 Subject: [PATCH 1/6] [FIX] tools: Added Georgian Language to the installable languages --- openerp/tools/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 127cc2ab312..9812bffdfee 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -476,6 +476,7 @@ ALL_LANGUAGES = { 'id_ID': u'Indonesian / Bahasa Indonesia', 'it_IT': u'Italian / Italiano', 'ja_JP': u'Japanese / 日本語', + 'ka_GE': u'Georgian / ქართული ენა', 'ko_KP': u'Korean (KP) / 한국어 (KP)', 'ko_KR': u'Korean (KR) / 한국어 (KR)', 'lo_LA': u'Lao / ພາສາລາວ', From 166839fb461ffa6ebb3969643f9231cc8d922dba Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 17 Dec 2014 19:46:25 +0100 Subject: [PATCH 2/6] [FIX] l10n_ch: Link the taxes to the correct accounts Fixes #4288 Closes #4300 --- addons/l10n_ch/sterchi_chart/vat2011.xml | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/l10n_ch/sterchi_chart/vat2011.xml b/addons/l10n_ch/sterchi_chart/vat2011.xml index c6732a00ed4..29e84aa1c1f 100644 --- a/addons/l10n_ch/sterchi_chart/vat2011.xml +++ b/addons/l10n_ch/sterchi_chart/vat2011.xml @@ -148,8 +148,8 @@ - - + + sale @@ -169,8 +169,8 @@ purchase - - + + TVA 2.5% sur invest. et autres ch. (TR) @@ -210,8 +210,8 @@ sale - - + + TVA 3.8% sur achat B&S (TS) @@ -230,8 +230,8 @@ purchase - - + + TVA 3.8% sur invest. et autres ch. (TS) @@ -271,8 +271,8 @@ sale - - + + TVA 8.0% sur achat B&S (TN) @@ -292,8 +292,8 @@ purchase - - + + TVA 8.0% sur invest. et autres ch. (TN) @@ -330,8 +330,8 @@ sale - - + + TVA 0% exclue From 4fe0c6bd60d3d092f69a1fec213ddcb9d5eeb8a6 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 2 Jul 2015 20:59:26 +0200 Subject: [PATCH 3/6] [IMP] account: updated index to optimize _default_get of account.move.line A log analysis showed that the normalized query below was executed very often with a slow explain plan using a seq scan. ```sql SELECT move_id, date FROM account_move_line WHERE journal_id = AND period_id = AND create_uid = AND state = 'draft' ORDER BY id DESC LIMIT 0; ``` This query is called in the _default_get of account.move.line to find the last unbalanced move line. The existing index can be improved to cover this query as well, showing an impressive improvement of the explain plan as explained here: https://github.com/odoo/odoo/pull/7430#issuecomment-119521031 Closes #7430 --- addons/account/account_move_line.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 230626d0b9a..df6cd1dc8d9 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -575,7 +575,8 @@ class account_move_line(osv.osv): res = super(account_move_line, self)._auto_init(cr, context=context) cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') if not cr.fetchone(): - cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') + cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ' + 'ON account_move_line (journal_id, period_id, state, create_uid, id DESC)') cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',)) if not cr.fetchone(): cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)') From a4ef73fb096749109da46b76f6714ae7f8d92005 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 9 Jul 2015 09:53:37 +0200 Subject: [PATCH 4/6] [FIX] mrp: merge lines where products to consume are identical Method action_produce does not support the case where the same product appears on multiple lines. We do this to avoid major changes in a stable version. opw-644093 --- addons/mrp/mrp.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index a85dd7316ae..32c0114b16b 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -381,6 +381,40 @@ class mrp_bom(osv.osv): res = self._bom_explode(cr, uid, bom2, factor, properties, addthis=True, level=level+10) result = result + res[0] result2 = result2 + res[1] + + # We merge the results for the same product. The reason is that action_produce does not + # support the case where the same product appears on multiple lines. To avoid major changes + # in a stable version, we do this simple hack at this point. + # Only for v7.0, do not use in v8.0 + result_dict = {} + result_dup = False + for product_detail in result: + key = ( + product_detail['name'], + product_detail['product_id'], + product_detail['product_uom'], + product_detail['product_uos_qty'], + product_detail['product_uos'] + ) + if key in result_dict: + result_dict[key] += product_detail['product_qty'] + result_dup = True + else: + result_dict[key] = product_detail['product_qty'] + + if result_dup: + result = [] + for key in result_dict.keys(): + result.append( + { + 'name': key[0], + 'product_id': key[1], + 'product_qty': result_dict[key], + 'product_uom': key[2], + 'product_uos_qty': key[3], + 'product_uos': key[4], + }) + return result, result2 def copy_data(self, cr, uid, id, default=None, context=None): From 23cb6ef7dfd4ef73a1a5458cc0561988a3f47ef0 Mon Sep 17 00:00:00 2001 From: "Jose J. Duran" Date: Fri, 3 Jul 2015 10:26:06 +0200 Subject: [PATCH 5/6] [FIX] account_asset: missing named arguments in signature Otherwise the context of original method is lost. --- addons/account_asset/account_asset_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_asset/account_asset_invoice.py b/addons/account_asset/account_asset_invoice.py index 7e2f24f0d0a..4b235c874c3 100644 --- a/addons/account_asset/account_asset_invoice.py +++ b/addons/account_asset/account_asset_invoice.py @@ -24,8 +24,8 @@ from openerp.osv import fields, osv class account_invoice(osv.osv): _inherit = 'account.invoice' - def action_number(self, cr, uid, ids, *args): - result = super(account_invoice, self).action_number(cr, uid, ids, *args) + def action_number(self, cr, uid, ids, *args, **kargs): + result = super(account_invoice, self).action_number(cr, uid, ids, *args, **kargs) for inv in self.browse(cr, uid, ids): self.pool.get('account.invoice.line').asset_create(cr, uid, inv.invoice_line) return result From 1d0187223bb4f91da97455640f7fad54d44a4023 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Thu, 11 Sep 2014 12:34:54 -0400 Subject: [PATCH 6/6] [FIX] auth_oauth_signup: Factor out user signup values There is no easy way to edit the values sent to newly generated users from oauth_signup. In some cases, the mapping from an oauth provider can be different. * ex: login is something other than email In other cases, there are additional fields in res_users added by a module * ex: firstname and last name in `partner_firstname` This factorization allows modules inheriting from `auth_oauth_signup` to alter values sent to the copy of Template User. This means smaller changes to the default behaviour and the ability to properly inherit (multiple times if needed) this module without losing needed behaviour. Closes #2355 --- addons/auth_oauth_signup/res_users.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/addons/auth_oauth_signup/res_users.py b/addons/auth_oauth_signup/res_users.py index a06968fa46f..3f011aa14db 100644 --- a/addons/auth_oauth_signup/res_users.py +++ b/addons/auth_oauth_signup/res_users.py @@ -31,6 +31,20 @@ _logger = logging.getLogger(__name__) class res_users(osv.Model): _inherit = 'res.users' + def _generate_signup_values(self, cr, uid, provider, validation, params, context=None): + oauth_uid = validation['user_id'] + email = validation.get('email', 'provider_%s_user_%s' % (provider, oauth_uid)) + name = validation.get('name', email) + return { + 'name': name, + 'login': email, + 'email': email, + 'oauth_provider_id': provider, + 'oauth_uid': oauth_uid, + 'oauth_access_token': params['access_token'], + 'active': True, + } + def _auth_oauth_signin(self, cr, uid, provider, validation, params, context=None): # overridden to use signup method if regular oauth signin fails try: @@ -41,18 +55,7 @@ class res_users(osv.Model): return None state = simplejson.loads(params['state']) token = state.get('t') - oauth_uid = validation['user_id'] - email = validation.get('email', 'provider_%s_user_%s' % (provider, oauth_uid)) - name = validation.get('name', email) - values = { - 'name': name, - 'login': email, - 'email': email, - 'oauth_provider_id': provider, - 'oauth_uid': oauth_uid, - 'oauth_access_token': params['access_token'], - 'active': True, - } + values = self._generate_signup_values(cr, uid, provider, validation, params, context=context) try: _, login, _ = self.signup(cr, uid, values, token, context=context) except SignupError: