From c7beb9994f2b3aecef3f03aa81e0240e0d3eaf71 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Tue, 23 Jul 2019 10:09:47 +0000 Subject: [PATCH 001/110] [FIX] stock: raise a warning if the user deactivates 'lot & serial numbers' settings while products use it The "lots & serial numbers" feature can be deactivated at any point. If there are active products that are tracked, either by lot or serial number, it can be confusing since deactivating it will hide the relevant fields. Therefore we raise a warning at onchange if there are tracked active products. opw 2036173 closes odoo/odoo#35108 Signed-off-by: Nans Lefebvre (len) --- addons/stock/i18n/stock.pot | 7 +++++++ addons/stock/models/res_config_settings.py | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 5faad4e2547..09ce03e4859 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6495,6 +6495,13 @@ msgstr "" msgid "You need to supply a Lot/Serial number for product %s." msgstr "" +#. module: stock +#: code:addons/stock/models/res_config_settings.py:70 +#, python-format +msgid "You should not remove the 'lots and serial numbers' option while the following products are still tracked by lot or serial number:\n" +" %s" +msgstr "" + #. module: stock #: code:addons/stock/models/product.py:394 #: code:addons/stock/models/product.py:538 diff --git a/addons/stock/models/res_config_settings.py b/addons/stock/models/res_config_settings.py index ebf7d339d39..b39b1a6beaa 100644 --- a/addons/stock/models/res_config_settings.py +++ b/addons/stock/models/res_config_settings.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models +from odoo import api, fields, models, _ +from odoo.exceptions import UserError class ResConfigSettings(models.TransientModel): @@ -64,6 +65,13 @@ class ResConfigSettings(models.TransientModel): def _onchange_group_stock_production_lot(self): if not self.group_stock_production_lot: self.group_lot_on_delivery_slip = False + tracked_products = self.env['product.template'].search([('tracking', 'in', ['lot', 'serial']),]) + if not self.group_stock_production_lot and tracked_products: + names = ", ".join(tracked_products.mapped('display_name') if len(tracked_products) <= 10 + else tracked_products[:10].mapped('display_name') + ["..."]) + raise UserError(_("You should not remove the 'lots and serial numbers' " + "option while the following products are still tracked by lot " + "or serial number:\n %s") % names) @api.onchange('group_stock_adv_location') def onchange_adv_location(self): From 44e8fd3b18352b60e6e2f9f63a590bce2abdbd3d Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Thu, 25 Jul 2019 09:19:14 +0000 Subject: [PATCH 002/110] [FIX] sale: price_unit in portal decimal precision Before this commit, the unit price in the so's portal, had the same decimal precision as the currency and not the one specified for the unit prices. Now, the portal shows the unit prices with their specific decimal precision. related to : a1e6a0f0c5ca56efd1b7c0f29f794fa1fcf5f8e3 opw-2042089 closes odoo/odoo#35171 Signed-off-by: Nans Lefebvre (len) --- addons/sale/views/sale_portal_templates.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/sale/views/sale_portal_templates.xml b/addons/sale/views/sale_portal_templates.xml index 8c794f50866..77b0ac748ce 100644 --- a/addons/sale/views/sale_portal_templates.xml +++ b/addons/sale/views/sale_portal_templates.xml @@ -468,12 +468,11 @@
- +
From c9a061b9c063fe3425941e20e573691e84645c2e Mon Sep 17 00:00:00 2001 From: Baskhuu Lodoikhuu Date: Mon, 8 Jul 2019 16:09:03 +0000 Subject: [PATCH 003/110] [FIX] l10n_mn: update author As the Mongolia localisation was written by BumanIT closes odoo/odoo#34671 Signed-off-by: Martin Trigaux (mat) --- addons/l10n_mn/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_mn/__manifest__.py b/addons/l10n_mn/__manifest__.py index ea075cbdc3e..4cec4749d94 100644 --- a/addons/l10n_mn/__manifest__.py +++ b/addons/l10n_mn/__manifest__.py @@ -5,6 +5,7 @@ "name" : "Mongolia - Accounting", "version" : "1.0", 'category': 'Localization', + "author" : "BumanIT LLC, Odoo S.A", "description": """ This is the module to manage the accounting chart for Mongolia. =============================================================== From f97b766013b1e759d39437b0472260154ccd0d2e Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Fri, 26 Jul 2019 08:27:51 +0000 Subject: [PATCH 004/110] [FIX] mrp: update MO quantity when there are more than one move per line The production.move_raw_ids usually contains only one move per bom_line_id; it might not always be the case, as ccbd6712f6f used move[0] to get a singleton. The following calls to _get_document_iterate_key, _log_activity_get_documents, also require move to be a singleton, so we use replace move by move[0]. opw 2042099 closes odoo/odoo#35206 Signed-off-by: Arnold Moyaux --- addons/mrp/wizard/change_production_qty.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index ff7439f3d12..376a6c8390e 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -56,7 +56,8 @@ class ChangeProductionQty(models.TransientModel): for line, line_data in lines: move = production.move_raw_ids.filtered(lambda x: x.bom_line_id.id == line.id and x.state not in ('done', 'cancel')) if move: - old_qty = move[0].product_uom_qty + move = move[0] + old_qty = move.product_uom_qty else: old_qty = 0 iterate_key = production._get_document_iterate_key(move) From 30a9120346e6b51f759c8d40de81e53bb2d13418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Mon, 1 Jul 2019 00:58:47 +0000 Subject: [PATCH 005/110] [FIX] l10n_mx: Set 'reconcile=True' for stock_account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126 raise the following error using anglo-saxon: ```bash File stock_account/models/account_invoice.py, line 60, in invoice_validate File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation File 10n_mx_edi/models/account_move.py, line 12, in reconcile File account/models/account_move.py, line 957, in reconcile File account/models/account_move.py, line 948, in _check_reconcile_validity odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '') ``` closes odoo/odoo#34463 Signed-off-by: Josse Colpaert --- addons/l10n_mx/data/account.account.template.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_mx/data/account.account.template.csv b/addons/l10n_mx/data/account.account.template.csv index b9cd4a41d36..316cab62337 100644 --- a/addons/l10n_mx/data/account.account.template.csv +++ b/addons/l10n_mx/data/account.account.template.csv @@ -8,7 +8,7 @@ "cuenta115_02","Materia prima y materiales","115.02.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_02","False" "cuenta115_03","Producción en proceso","115.03.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_03","False" "cuenta115_04","Productos terminados","115.04.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_04","False" -"cuenta115_05","Mercancías en tránsito","115.05.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_05","False" +"cuenta115_05","Mercancías en tránsito","115.05.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_05","True" "cuenta115_06","Mercancías en poder de terceros","115.06.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_115_06","False" "cuenta118_01","IVA acreditable pagado","118.01.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_118_01","False" "cuenta119_01","IVA pendiente de pago","119.01.01","account.data_account_type_current_assets","l10n_mx.mx_coa","l10n_mx.account_tag_119_01","False" From 53ef25284fa12bb98e76a390a24137a0a9729a6f Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 25 Jul 2019 15:47:34 +0000 Subject: [PATCH 006/110] [FIX] web_editor: enter at A edge no dup link In the editor, when you write a letter at the end or beginning of a link it is written outside the link. But if you press "Enter", we get on a newline with an empty link duplicated on the new line. This is caused by the custom code handling "Enter" keypress. With this changeset, in this situation we place the range just before the beginning or after the end of a link. opw-1724606 opw-2042097 closes #35188 Signed-off-by: Nicolas Lempereur (nle) --- .../web_editor/static/src/js/editor/summernote.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index bc7f5e7ff9f..e0968ecdb58 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -1181,6 +1181,20 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) { var br = $("
")[0]; + // set selection outside of A if range is at beginning or end + var elem = dom.isBR(elem) ? elem.parentNode : dom.node(r.sc); + if (elem.tagName === "A") { + if (r.so === 0 && dom.firstChild(elem) === r.sc) { + r.ec = r.sc = dom.hasContentBefore(elem) || $(dom.createText('')).insertBefore(elem)[0]; + r.eo = r.so = dom.nodeLength(r.sc); + r.select(); + } else if (dom.nodeLength(r.sc) === r.so && dom.lastChild(elem) === r.sc) { + r.ec = r.sc = dom.hasContentAfter(elem) || dom.insertAfter(dom.createText(''), elem); + r.eo = r.so = 0; + r.select(); + } + } + var node; var $node; var $clone; From 467ac9843d345ebc8bfb30bd95446bc772381b4e Mon Sep 17 00:00:00 2001 From: Cas Vissers Date: Mon, 1 Jul 2019 09:04:37 +0000 Subject: [PATCH 007/110] [FIX] hr_holidays: fix leaves count domain In active leave types should not be considered. closes odoo/odoo#34475 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_holidays/models/hr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/models/hr.py b/addons/hr_holidays/models/hr.py index d878f11457c..12d45b1ccae 100644 --- a/addons/hr_holidays/models/hr.py +++ b/addons/hr_holidays/models/hr.py @@ -146,6 +146,7 @@ class Employee(models.Model): all_leaves = self.env['hr.leave.report'].read_group([ ('employee_id', 'in', self.ids), ('holiday_status_id.allocation_type', '!=', 'no'), + ('holiday_status_id.active', '=', 'True'), ('state', '=', 'validate') ], fields=['number_of_days', 'employee_id'], groupby=['employee_id']) mapping = dict([(leave['employee_id'][0], leave['number_of_days']) for leave in all_leaves]) From 324268a9763d9ba223f66326ff0e2d2731617e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Fontaine?= Date: Thu, 6 Jun 2019 13:51:07 +0000 Subject: [PATCH 008/110] [FIX] mail: translate model description Do not use model._description as this is a static string that is untransalted Retrieve the value on the ir.model record which has a translated field Fixes odoo/odoo#28481 closes odoo/odoo#33957 Signed-off-by: Martin Trigaux (mat) --- addons/mail/views/mail_templates.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/views/mail_templates.xml b/addons/mail/views/mail_templates.xml index 5463d2afd13..f67b202284b 100644 --- a/addons/mail/views/mail_templates.xml +++ b/addons/mail/views/mail_templates.xml @@ -55,7 +55,7 @@