From af95efcfd686d29e34826b94a1feacce6f83cdef Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Sat, 9 Feb 2019 17:06:23 +0000 Subject: [PATCH 01/11] [CLA] signature for naglis closes odoo/odoo#30978 --- doc/cla/individual/naglis.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/naglis.md diff --git a/doc/cla/individual/naglis.md b/doc/cla/individual/naglis.md new file mode 100644 index 00000000000..dde081dfaa1 --- /dev/null +++ b/doc/cla/individual/naglis.md @@ -0,0 +1,11 @@ +Lithuania, 2019-02-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, + +Naglis Jonaitis naglis@mailbox.org https://github.com/naglis From f221936f8b9e64d371c2593210797b36ef6d032c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 8 Feb 2019 12:16:52 +0000 Subject: [PATCH 02/11] [FIX] stock: location company Force the location and destination location's company to match with the picking and picking type company. This is to prevent users to move products between companies without using a transit location, since stock valuation is not supported. The record rule `stock_location_comp_rule` gives access to children companies. The domain added in the view is more restrictive, and allows, for a company A, transfers from locations: Company A -> Company A Company A -> No Company No Company -> Company A opw-1893276 closes odoo/odoo#30952 --- addons/stock/views/stock_picking_views.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 7ed81ba0050..4cf829796d4 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -55,8 +55,8 @@ - - + + @@ -229,8 +229,8 @@ - - + + From 5ebcd188f3c6f2e5bf39c7eb6594ec5c9398bb5f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 13 Feb 2019 12:39:40 +0000 Subject: [PATCH 03/11] [FIX] stock: improve performance of product quantity search Calling `search` on `product.product` without specifying an order will sort the products by name. As the product name is a translatable field, it requires to make a join on the translation table to sort the product by their translated name. This join is costly, and in this case it was completely irelevant to do it, as the goal was simply to compute a domain with only a list of product ids, for which the order simply did not matter. By forcing the order on the id, we avoid the sort on the product name, and therefore the join on the translation. The performance is therefore improved. opw-1930010 closes odoo/odoo#31066 --- addons/stock/models/product.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 3d19c83be64..09408f6c694 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -262,7 +262,9 @@ class Product(models.Model): # TODO: Still optimization possible when searching virtual quantities ids = [] - for product in self.search([]): + # Order the search on `id` to prevent the default order on the product name which slows + # down the search because of the join on the translation table to get the translated names. + for product in self.search([], order='id'): if OPERATORS[operator](product[field], value): ids.append(product.id) return [('id', 'in', ids)] From 7dea5c418b358824a64dea2c2f5f4b2f19a5abe4 Mon Sep 17 00:00:00 2001 From: Moens Alexandre Date: Wed, 13 Feb 2019 09:32:10 +0000 Subject: [PATCH 04/11] [IMP] base_import_module: tell user what they actually can import This commits adds a message to the module import wizard to make it more clear what kind of modules can be imported through the front end. project : RD feedback task : [base_import_module] what it is not for. opw-1939967 closes odoo/odoo#31057 --- addons/base_import_module/i18n/base_import_module.pot | 5 +++++ addons/base_import_module/views/base_import_module_view.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/addons/base_import_module/i18n/base_import_module.pot b/addons/base_import_module/i18n/base_import_module.pot index f4bc3971229..9b6f59e003f 100644 --- a/addons/base_import_module/i18n/base_import_module.pot +++ b/addons/base_import_module/i18n/base_import_module.pot @@ -132,6 +132,11 @@ msgstr "" msgid "No file sent." msgstr "" +#. module: base_import_module +#: model:ir.ui.view,arch_db:base_import_module.view_base_module_import +msgid "Note: you can only import data modules (.xml files and static assets)" +msgstr "" + #. module: base_import_module #: code:addons/base_import_module/controllers/main.py:25 #, python-format diff --git a/addons/base_import_module/views/base_import_module_view.xml b/addons/base_import_module/views/base_import_module_view.xml index 60af0d3fc61..b132c7f3a83 100644 --- a/addons/base_import_module/views/base_import_module_view.xml +++ b/addons/base_import_module/views/base_import_module_view.xml @@ -8,6 +8,7 @@
+

Note: you can only import data modules (.xml files and static assets)