From 0f971130d6fd15f3f5c35d81d366da0c8bcb1cb7 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 5 Apr 2019 12:56:23 +0000 Subject: [PATCH 01/17] [FIX] base: inactive lang Make sure to retrieve the lang in case it is inactive. Note that a lang cannot be deactivated if it is set on a `res.users`, but no check if performed on a `res.partner`. opw-1964655 closes odoo/odoo#32457 Signed-off-by: Nicolas Martinelli (nim) --- odoo/addons/base/models/res_currency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_currency.py b/odoo/addons/base/models/res_currency.py index e3624000a0e..c7e820eedc2 100644 --- a/odoo/addons/base/models/res_currency.py +++ b/odoo/addons/base/models/res_currency.py @@ -115,7 +115,7 @@ class Currency(models.Model): fractional_value = int(parts[2] or 0) lang_code = self.env.context.get('lang') or self.env.user.lang - lang = self.env['res.lang'].search([('code', '=', lang_code)]) + lang = self.env['res.lang'].with_context(active_test=False).search([('code', '=', lang_code)]) amount_words = tools.ustr('{amt_value} {amt_word}').format( amt_value=_num2words(integer_value, lang=lang.iso_code), amt_word=self.currency_unit_label, From 2d17baa07c771ad53bed5b457554500b0ecaa976 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 5 Apr 2019 13:19:12 +0000 Subject: [PATCH 02/17] [FIX] product: archived template When a new `product.template` is imported with `active` set to `False`, the associated `product.product` is active. This is not consistent with what happens in the UI: when a template is archived, all variants are archived. At variant creation, we keep the `active` value of the template. opw-1955116 closes odoo/odoo#32461 Signed-off-by: Nicolas Martinelli (nim) --- addons/product/models/product_template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index afe17aaadad..c4d08003561 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -503,6 +503,7 @@ class ProductTemplate(models.Model): variants_to_create.append({ 'product_tmpl_id': tmpl_id.id, 'attribute_value_ids': [(6, 0, list(value_ids))], + 'active': tmpl_id.active, }) if len(variants_to_create) > 1000: raise UserError(_( From 719b0ab6834a18f7cf9edd919922e629ae3a611b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 8 Apr 2019 10:09:10 +0000 Subject: [PATCH 03/17] [FIX] stock_account: standard price currency Oversight during forward-port of 950d0f1849bebc20bfd6b2d71bedfd97d6 closes odoo/odoo#32488 Signed-off-by: Nicolas Martinelli (nim) --- addons/stock_account/views/product_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index 2c8fdcdd4b6..4a173cdc637 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -77,7 +77,7 @@
+ widget='monetary' options="{'currency_field': 'cost_currency_id', 'field_digits': True}" class="float-left"/>