From 6a711060ae380ffcb9342579ff11b9b53aee0712 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 28 Jul 2016 11:11:34 +0200 Subject: [PATCH 1/5] [FIX] account: fiscal position in compute_refund When choosing to refund an invoice with refund method="create refund, reconcile and create a new draft invoice" , the fiscal position of the refund invoice must be kept in the new draft invoice. opw:683311 --- addons/account/wizard/account_invoice_refund.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index d309992cf97..3190e46c6a5 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -202,7 +202,8 @@ class account_invoice_refund(osv.osv_memory): 'invoice_line': invoice_lines, 'tax_line': tax_lines, 'period_id': period, - 'name': description + 'name': description, + 'fiscal_position': inv.fiscal_position.id }) for field in ('partner_id', 'account_id', 'currency_id', 'payment_term', 'journal_id'): From f57f55966df338c78e19403f0ace932c64585852 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 28 Jul 2016 13:13:00 +0200 Subject: [PATCH 2/5] [FIX] sale_stock: UoM in warning The warning message of the product packaging change does not take into account the appropriate UoM. opw-12827 Fixes #12827 --- addons/sale_stock/i18n/sale_stock.pot | 2 +- addons/sale_stock/sale_stock.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/sale_stock/i18n/sale_stock.pot b/addons/sale_stock/i18n/sale_stock.pot index db2bf052fb0..34ca26249f4 100644 --- a/addons/sale_stock/i18n/sale_stock.pot +++ b/addons/sale_stock/i18n/sale_stock.pot @@ -349,7 +349,7 @@ msgstr "" #. module: sale_stock #: code:addons/sale_stock/sale_stock.py:270 #, python-format -msgid "You selected a quantity of %d Units.\n" +msgid "You selected a quantity of %s %s.\n" "But it's not compatible with the selected packaging.\n" "Here is a proposition of quantities according to the packaging:\n" "EAN: %s Quantity: %s Type of ul: %s" diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 4c943325f6a..00585a9abb3 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -260,11 +260,12 @@ class sale_order_line(osv.osv): qty_pack = pack.qty type_ul = pack.ul if not warning_msgs: - warn_msg = _("You selected a quantity of %d Units.\n" + uom_obj = product_uom_obj.browse(cr, uid, uom, context=context) + warn_msg = _("You selected a quantity of %s %s.\n" "But it's not compatible with the selected packaging.\n" "Here is a proposition of quantities according to the packaging:\n" "EAN: %s Quantity: %s Type of ul: %s") % \ - (qty, ean, qty_pack, type_ul.name) + (qty, uom_obj.name, ean, qty_pack, type_ul.name) warning_msgs += _("Picking Information ! : ") + warn_msg + "\n\n" warning = { 'title': _('Configuration Error!'), From de2d7d9acd71e86a40aa8a0e3489d94270dac255 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 28 Jul 2016 15:06:16 +0200 Subject: [PATCH 3/5] [FIX] sale_stock: incorrect value in error message The error message has an hardcoded precision of 2 digits, which is not enough of the product precision is higher than 2. Since this error message is often used, we should avoid its modification to prevent breaking the translations. opw-683639 Fixes #12629 --- addons/sale_stock/i18n/en.po | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 addons/sale_stock/i18n/en.po diff --git a/addons/sale_stock/i18n/en.po b/addons/sale_stock/i18n/en.po new file mode 100644 index 00000000000..0f50fbd8fe9 --- /dev/null +++ b/addons/sale_stock/i18n/en.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-21 14:08+0000\n" +"PO-Revision-Date: 2015-01-21 14:08+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sale_stock +#: code:addons/sale_stock/sale_stock.py:343 +#, python-format +msgid "You plan to sell %.2f %s but you only have %.2f %s available !\n" +"The real stock is %.2f %s. (without reservations)" +msgstr "You plan to sell %s %s but you only have %s %s available !\n" +"The real stock is %s %s. (without reservations)" From c372708b01b9c1a19137b25eeddf6ec7ab2c2480 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 28 Jul 2016 17:27:46 +0200 Subject: [PATCH 4/5] [FIX] website_google_map: do not allow invalid partner prefix The only supported prefixes are the following: - /partners/ when website_partner and/or website_crm_partner_assign are installed - /customers/ when website_customer is installed --- addons/website_google_map/controllers/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/website_google_map/controllers/main.py b/addons/website_google_map/controllers/main.py index 1abc7c41397..282be8e508f 100644 --- a/addons/website_google_map/controllers/main.py +++ b/addons/website_google_map/controllers/main.py @@ -57,9 +57,14 @@ class google_map(http.Controller): 'longitude': escape(str(partner.partner_longitude)), }) + if 'customers' in post.get('partner_url', ''): + partner_url = '/customers/' + else: + partner_url = '/partners/' + # generate the map values = { - 'partner_url': post.get('partner_url'), + 'partner_url': partner_url, 'partner_data': json.dumps(partner_data) } return request.website.render("website_google_map.google_map", values) From 9fe930e6ba95a223fc56163d675e8d5a6485a6fc Mon Sep 17 00:00:00 2001 From: aetna-softwares Date: Mon, 30 May 2016 09:27:46 +0200 Subject: [PATCH 5/5] [FIX] survey: prevent saving issues of answers to multiple_choice questions, when id starts with id of other questions Fixes #11873 #12215 --- addons/survey/survey.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index a29e24e79d9..f428ba58a5d 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -1171,7 +1171,7 @@ class survey_user_input_line(osv.Model): if old_uil: self.unlink(cr, SUPERUSER_ID, old_uil, context=context) - ca = dict_keys_startswith(post, answer_tag) + ca = dict_keys_startswith(post, answer_tag+"_") comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip() if len(ca) > 0: for a in ca: @@ -1203,7 +1203,7 @@ class survey_user_input_line(osv.Model): self.unlink(cr, SUPERUSER_ID, old_uil, context=context) no_answers = True - ca = dict_keys_startswith(post, answer_tag) + ca = dict_keys_startswith(post, answer_tag+"_") comment_answer = ca.pop(("%s_%s" % (answer_tag, 'comment')), '').strip() if comment_answer: