From 8feabe46cdc4e7cea11d13ae36fe8015cf728bba Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 21 Oct 2015 13:45:37 +0200 Subject: [PATCH 1/6] [FIX] packaging: include favicon missing .ico files Fixes #7745 --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index f0f27169c12..75f71dc16ad 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ recursive-include openerp *.css recursive-include openerp *.csv recursive-include openerp *.gif recursive-include openerp *.html +recursive-include openerp *.ico recursive-include openerp *.jpeg recursive-include openerp *.jpg recursive-include openerp *.js From 8f6caf978598612f2d0592b857dc8f433ece147c Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 22 Oct 2015 10:06:46 +0200 Subject: [PATCH 2/6] [FIX] google_spreadsheet: Spreadsheets list The URL for the Google Spreadsheets slightly changed It's now `docs.google.com/spreadsheets/`, and no longer `docs.odoo.com/spreadsheet/` The domain is therefore changed to support both cases opw-651847 --- addons/google_spreadsheet/google_spreadsheet_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_spreadsheet/google_spreadsheet_view.xml b/addons/google_spreadsheet/google_spreadsheet_view.xml index 1f014edb8be..60284478c5e 100644 --- a/addons/google_spreadsheet/google_spreadsheet_view.xml +++ b/addons/google_spreadsheet/google_spreadsheet_view.xml @@ -42,7 +42,7 @@ form tree,form {} - [('url', 'like', '/spreadsheet/')] + [('url', '=ilike', '%google%/spreadsheet%')] Google Spreadsheets From 29bd62252158803cdad351a2966af6eeac4cca74 Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Thu, 22 Oct 2015 14:56:13 +0200 Subject: [PATCH 3/6] [FIX] stock_account: stock history performance Using BIGINT id instead of Text - This doesn't change the behavior, just the variable type, while being much more efficient. Using `UNION ALL` instead of simple `UNION` - This doesn't change the behavior either, as the ids of each sub select cannot collide Closes #9197 opw-650598 --- addons/stock_account/wizard/stock_valuation_history.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index b86173ba3b1..e6218dbf036 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -129,7 +129,7 @@ class stock_history(osv.osv): source FROM ((SELECT - stock_move.id::text || '-' || quant.id::text AS id, + stock_move.id AS id, quant.id AS quant_id, stock_move.id AS move_id, dest_location.id AS location_id, @@ -156,9 +156,9 @@ class stock_history(osv.osv): (source_location.company_id is not null and dest_location.company_id is null) or source_location.company_id != dest_location.company_id or source_location.usage not in ('internal', 'transit')) - ) UNION + ) UNION ALL (SELECT - '-' || stock_move.id::text || '-' || quant.id::text AS id, + (-1) * stock_move.id AS id, quant.id AS quant_id, stock_move.id AS move_id, source_location.id AS location_id, From 5c9897a83f79834b5c54a79b944262556e3f87ee Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Thu, 22 Oct 2015 15:37:06 +0200 Subject: [PATCH 4/6] [IMP] stock_account: rework on stock_history view joins - Replace `LEFT JOIN` by simple `JOIN` for required fields - Use `JOIN ... ON (...)` syntax instead of implicit join `A.X = B.Y` - Remove of unused column quant_id Closes #9197 opw-650598 --- .../wizard/stock_valuation_history.py | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index e6218dbf036..71ff9950a2d 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -130,7 +130,6 @@ class stock_history(osv.osv): FROM ((SELECT stock_move.id AS id, - quant.id AS quant_id, stock_move.id AS move_id, dest_location.id AS location_id, dest_location.company_id AS company_id, @@ -141,17 +140,21 @@ class stock_history(osv.osv): quant.cost as price_unit_on_quant, stock_move.origin AS source FROM - stock_quant as quant, stock_quant_move_rel, stock_move - LEFT JOIN + stock_move + JOIN + stock_quant_move_rel on stock_quant_move_rel.move_id = stock_move.id + JOIN + stock_quant as quant on stock_quant_move_rel.quant_id = quant.id + JOIN stock_location dest_location ON stock_move.location_dest_id = dest_location.id - LEFT JOIN + JOIN stock_location source_location ON stock_move.location_id = source_location.id - LEFT JOIN + JOIN product_product ON product_product.id = stock_move.product_id - LEFT JOIN + JOIN product_template ON product_template.id = product_product.product_tmpl_id - WHERE quant.qty>0 AND stock_move.state = 'done' AND dest_location.usage in ('internal', 'transit') AND stock_quant_move_rel.quant_id = quant.id - AND stock_quant_move_rel.move_id = stock_move.id AND ( + WHERE quant.qty>0 AND stock_move.state = 'done' AND dest_location.usage in ('internal', 'transit') + AND ( (source_location.company_id is null and dest_location.company_id is not null) or (source_location.company_id is not null and dest_location.company_id is null) or source_location.company_id != dest_location.company_id or @@ -159,7 +162,6 @@ class stock_history(osv.osv): ) UNION ALL (SELECT (-1) * stock_move.id AS id, - quant.id AS quant_id, stock_move.id AS move_id, source_location.id AS location_id, source_location.company_id AS company_id, @@ -170,17 +172,21 @@ class stock_history(osv.osv): quant.cost as price_unit_on_quant, stock_move.origin AS source FROM - stock_quant as quant, stock_quant_move_rel, stock_move - LEFT JOIN + stock_move + JOIN + stock_quant_move_rel on stock_quant_move_rel.move_id = stock_move.id + JOIN + stock_quant as quant on stock_quant_move_rel.quant_id = quant.id + JOIN stock_location source_location ON stock_move.location_id = source_location.id - LEFT JOIN + JOIN stock_location dest_location ON stock_move.location_dest_id = dest_location.id - LEFT JOIN + JOIN product_product ON product_product.id = stock_move.product_id - LEFT JOIN + JOIN product_template ON product_template.id = product_product.product_tmpl_id - WHERE quant.qty>0 AND stock_move.state = 'done' AND source_location.usage in ('internal', 'transit') AND stock_quant_move_rel.quant_id = quant.id - AND stock_quant_move_rel.move_id = stock_move.id AND ( + WHERE quant.qty>0 AND stock_move.state = 'done' AND source_location.usage in ('internal', 'transit') + AND ( (dest_location.company_id is null and source_location.company_id is not null) or (dest_location.company_id is not null and source_location.company_id is null) or dest_location.company_id != source_location.company_id or From 8c4877ff0d8793927a5c7b146dad1d48eccfde4a Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Mon, 19 Oct 2015 11:43:44 +0200 Subject: [PATCH 5/6] [FIX] account_asset: Assets Analysis performance In a real environment with a big dataset, the query reponse time decreased from 750s to 6s, by using a join on the sub-select instead of redoing the select for each line. Fixes #8812 Closes #9128 --- addons/account_asset/report/account_asset_report.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/account_asset/report/account_asset_report.py b/addons/account_asset/report/account_asset_report.py index 254eef720a3..fda00ffa308 100644 --- a/addons/account_asset/report/account_asset_report.py +++ b/addons/account_asset/report/account_asset_report.py @@ -52,9 +52,7 @@ class asset_asset_report(osv.osv): dl.name as name, dl.depreciation_date as depreciation_date, a.purchase_date as purchase_date, - (CASE WHEN (select min(d.id) from account_asset_depreciation_line as d - left join account_asset_asset as ac ON (ac.id=d.asset_id) - where a.id=ac.id) = min(dl.id) + (CASE WHEN dlmin.id = min(dl.id) THEN a.purchase_value ELSE 0 END) as gross_value, @@ -76,10 +74,11 @@ class asset_asset_report(osv.osv): a.company_id as company_id from account_asset_depreciation_line dl left join account_asset_asset a on (dl.asset_id=a.id) + left join (select min(d.id) as id,ac.id as ac_id from account_asset_depreciation_line as d inner join account_asset_asset as ac ON (ac.id=d.asset_id) group by ac_id) as dlmin on dlmin.ac_id=a.id group by dl.amount,dl.asset_id,dl.depreciation_date,dl.name, a.purchase_date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id, - a.purchase_value, a.id, a.salvage_value + a.purchase_value, a.id, a.salvage_value, dlmin.id )""") From f2bc45f91fa33680d519a267fa41ece7cf5b821e Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 23 Oct 2015 11:09:40 +0200 Subject: [PATCH 6/6] [FIX] website: submenu without url This is not impossible to have a submenu without URL. The condition to set the menu item as active or not must therefore take that into account. opw-652688 --- addons/website/views/website_templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 6febb78f87e..2c24ed98d31 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -41,7 +41,7 @@