From 0c039ce5f581cad5e55d8ca04d378be3948b838e Mon Sep 17 00:00:00 2001 From: Alejandro Santana Date: Thu, 9 Apr 2015 15:04:51 +0200 Subject: [PATCH 01/11] [CLA] Alejandro Santana --- doc/cla/individual/alejandrosantana.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/alejandrosantana.md diff --git a/doc/cla/individual/alejandrosantana.md b/doc/cla/individual/alejandrosantana.md new file mode 100644 index 00000000000..aa3517ddb2b --- /dev/null +++ b/doc/cla/individual/alejandrosantana.md @@ -0,0 +1,11 @@ +Spain, 2015-04-09 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Alejandro Santana tech@alejandrosantana.eu https://github.com/alejandrosantana From b1b70ee316d15b723166d89e96892f74e5368853 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Thu, 9 Apr 2015 16:56:41 +0300 Subject: [PATCH 02/11] [CLA] PCatinean signed CLA --- doc/cla/individual/PCatinean.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/PCatinean.md diff --git a/doc/cla/individual/PCatinean.md b/doc/cla/individual/PCatinean.md new file mode 100644 index 00000000000..4c846d97335 --- /dev/null +++ b/doc/cla/individual/PCatinean.md @@ -0,0 +1,11 @@ +Romania, 2015-04-01 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Paul Catinean paulcatinean@gmail.com https://github.com/PCatinean From 571ccec154f7effd34c563e64fce16921b811cab Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Thu, 9 Apr 2015 12:05:38 +0200 Subject: [PATCH 03/11] [CLA] Syleam --- doc/cla/corporate/syleam.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/cla/corporate/syleam.md diff --git a/doc/cla/corporate/syleam.md b/doc/cla/corporate/syleam.md new file mode 100644 index 00000000000..75ac0025efe --- /dev/null +++ b/doc/cla/corporate/syleam.md @@ -0,0 +1,17 @@ +France, 2015-04-08 + +Syleam agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Sylvain Garancher sylvain.garancher@syleam.fr https://github.com/sylvain-garancher + +List of contributors: + +Sébastien Lange sebastien.lange@syleam.fr https://github.com/alnslang +Sylvain Garancher sylvain.garancher@syleam.fr https://github.com/sylvain-garancher +Alexandre Moreau alexandre.moreau@syleam.fr https://github.com/a-moreau From eb463689c060eb392ba11b087afe3e4e8d5f1ea8 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 17 Apr 2015 12:52:25 +0200 Subject: [PATCH 04/11] [FIX] mail: get template outgoing server The outgoing server of a mail template is not used when sending a mail. This fix propagates the mail server the same way it's done for auto_delete. opw-633005 --- addons/email_template/wizard/mail_compose_message.py | 1 + addons/mail/mail_followers.py | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 11b182fba25..60b3b0d3af0 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -74,6 +74,7 @@ class mail_compose_message(osv.TransientModel): if wizard.template_id: wizard_context['mail_notify_user_signature'] = False # template user_signature is added when generating body_html wizard_context['mail_auto_delete'] = wizard.template_id.auto_delete # mass mailing: use template auto_delete value -> note, for emails mass mailing only + wizard_context['mail_server_id'] = wizard.template_id.mail_server_id.id if not wizard.attachment_ids or wizard.composition_mode == 'mass_mail' or not wizard.template_id: continue new_attachment_ids = [] diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index 9111e8a8f92..4dd48c2abe0 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -214,6 +214,7 @@ class mail_notification(osv.Model): mail_values = { 'mail_message_id': message.id, 'auto_delete': (context or {}).get('mail_auto_delete', True), + 'mail_server_id': (context or {}).get('mail_server_id', False), 'body_html': body_html, 'recipient_ids': [(4, id) for id in chunk], 'references': references, From bbcc6a8478c862271e272be499ad19df41d9b10d Mon Sep 17 00:00:00 2001 From: kevin wang Date: Thu, 19 Mar 2015 14:07:02 +0800 Subject: [PATCH 05/11] [CLA] signature for Loyal --- doc/cla/corporate/loyal.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/cla/corporate/loyal.md diff --git a/doc/cla/corporate/loyal.md b/doc/cla/corporate/loyal.md new file mode 100644 index 00000000000..d3b4fcb5da8 --- /dev/null +++ b/doc/cla/corporate/loyal.md @@ -0,0 +1,15 @@ +China, 2015-03-13 + +Loyal agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Kevin Wang kevin_327@163.com https://github.com/kevin3274 + +List of contributors: + +Kevin Wang kevin@loyal-info.com https://github.com/kevin3274 From b28bfcdb3a8752154fc1778f6410f8b83bbcf457 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 17 Apr 2015 17:32:47 +0200 Subject: [PATCH 06/11] [FIX] stock_account: real-time inventory valuation with free goods For a free purchase, the valuation amount fall-backed to the product cost price instead of the actual cost of the purchase. opw-63059 --- addons/stock_account/stock_account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index d1a66610264..cd80a630e67 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -201,9 +201,9 @@ class stock_quant(osv.osv): valuation_amount = context.get('force_valuation_amount') else: if move.product_id.cost_method == 'average': - valuation_amount = move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal' and cost or move.product_id.standard_price + valuation_amount = cost if move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal' else move.product_id.standard_price else: - valuation_amount = move.product_id.cost_method == 'real' and cost or move.product_id.standard_price + valuation_amount = cost if move.product_id.cost_method == 'real' else move.product_id.standard_price #the standard_price of the product may be in another decimal precision, or not compatible with the coinage of #the company currency... so we need to use round() before creating the accounting entries. valuation_amount = currency_obj.round(cr, uid, move.company_id.currency_id, valuation_amount * qty) From 3557fe124ad172ecd3727e31bf704f69dbca3390 Mon Sep 17 00:00:00 2001 From: Ravi Gohil Date: Wed, 29 Oct 2014 18:12:45 +0530 Subject: [PATCH 07/11] [FIX] fields: timezone aware context_timezone context_timestamp should always return a timezone aware timestamp, even when no timezone is set on the user. 7f88681 fixed the bug in old api fields (openerp/osv/fields.py) but it was not applied to new api fields (openerp/fields.py). opw 616612 --- openerp/fields.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openerp/fields.py b/openerp/fields.py index 14deaa8d601..036b5af82b9 100644 --- a/openerp/fields.py +++ b/openerp/fields.py @@ -1242,17 +1242,16 @@ class Datetime(Field): """ assert isinstance(timestamp, datetime), 'Datetime instance expected' tz_name = record._context.get('tz') or record.env.user.tz + utc_timestamp = pytz.utc.localize(timestamp, is_dst=False) # UTC = no DST if tz_name: try: - utc = pytz.timezone('UTC') context_tz = pytz.timezone(tz_name) - utc_timestamp = utc.localize(timestamp, is_dst=False) # UTC = no DST return utc_timestamp.astimezone(context_tz) except Exception: _logger.debug("failed to compute context/client-specific timestamp, " "using the UTC value", exc_info=True) - return timestamp + return utc_timestamp @staticmethod def from_string(value): From fc132665d77ec630b45b0aec808b32b6797a57dc Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 17 Apr 2015 11:46:11 +0200 Subject: [PATCH 08/11] [FIX] point of sale: Rounding method By default, the point of sale awlways uses the rounding method per line. But the accounting configuration allows to use the globally rounding method, this is why the point of sale must consider this configuration. Inspired from the compute_all of account.tax model within addons/account/account.py. opw:632537 --- addons/point_of_sale/static/src/js/models.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 13422c7f9e8..f18059905e2 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -135,7 +135,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal loaded: function(self,users){ self.user = users[0]; }, },{ model: 'res.company', - fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id'], + fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'tax_calculation_rounding_method'], ids: function(self){ return [self.user.company_id[0]] }, loaded: function(self,companies){ self.company = companies[0]; }, },{ @@ -861,6 +861,9 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal var self = this; var res = []; var currency_rounding = this.pos.currency.rounding; + if (this.pos.company.tax_calculation_rounding_method == "round_globally"){ + currency_rounding = currency_rounding * 0.00001; + } var base = price_unit; _(taxes).each(function(tax) { if (tax.price_include) { From ea4f9c4625ec8eebcf337bbd8a8b44d68c377ad7 Mon Sep 17 00:00:00 2001 From: "david.beal@akretion.com" Date: Fri, 17 Apr 2015 22:05:55 +0200 Subject: [PATCH 09/11] [FIX] call fields_view_get with named context otherwise new API bridging breaks down closes #6371 --- addons/stock/product.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index 9d5f71d733b..f0863e7ef96 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -279,7 +279,9 @@ class product_product(osv.osv): } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) + res = super(product_product, self).fields_view_get( + cr, uid, view_id=view_id, view_type=view_type, context=context, + toolbar=toolbar, submenu=submenu) if context is None: context = {} if ('location' in context) and context['location']: From 13fec4a21c169714c8e227949cfe62daf18f163c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 20 Apr 2015 11:00:09 +0200 Subject: [PATCH 10/11] [FIX] core: avoid infinite recursive loop. `function` fields are fully copied via `copy.copy()`. `copy.copy()` *do not* call `__init__` after object creation; then restore the state via `__setstate__()` or by updating `__dict__` or via `setattr()` when the object uses `__slots__`. As `__init__` is not called, the newly created object does not have any `_args` attribute. This lead to a recursive call of `__getattr__ when `copy.copy` check the existance of `__setstate__` attribute. When break this loop by forbidding explicitly by checking the attribute name accessed (We cannot check the presence of `_args` in `__dict__` because we uses `__slots__`). See http://bugs.python.org/issue5370 Fixes #6037 opw:633109 --- openerp/osv/fields.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 0ca684253b5..e9c2c38f97c 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -151,6 +151,8 @@ class _column(object): def __getattr__(self, name): """ Access a non-slot attribute. """ + if name == '_args': + raise AttributeError(name) try: return self._args[name] except KeyError: From a091de8d8da6cf6593c1a5e24de73da1df245add Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 20 Apr 2015 11:54:58 +0200 Subject: [PATCH 11/11] [FIX] core: no traceback when closing socket. Closes 5057 --- openerp/netsvc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openerp/netsvc.py b/openerp/netsvc.py index 6e477f3ea36..2763f79a6cf 100644 --- a/openerp/netsvc.py +++ b/openerp/netsvc.py @@ -57,6 +57,10 @@ def close_socket(sock): try: sock.shutdown(socket.SHUT_RDWR) except socket.error, e: + if e.errno == errno.EBADF: + # Werkzeug > 0.9.6 closes the socket itself (see commit + # https://github.com/mitsuhiko/werkzeug/commit/4d8ca089) + return # On OSX, socket shutdowns both sides if any side closes it # causing an error 57 'Socket is not connected' on shutdown # of the other side (or something), see