summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-10-23 11:33:24 +0200
committerDenis Ledoux <dle@odoo.com>2015-10-23 11:33:24 +0200
commit3db7cc4673826d2cfedf92da202e7cb83cd3e82f (patch)
treee405e68fb70fae62cdf604ed680db9bb2df7d6fd
parent6a306a03beceec46c4b9a4d5890212789b6d8c3b (diff)
parentf2bc45f91fa33680d519a267fa41ece7cf5b821e (diff)
[MERGE] forward port of branch 8.0 up to f2bc45f
-rw-r--r--MANIFEST.in1
-rw-r--r--addons/account_asset/report/account_asset_report.py7
-rw-r--r--addons/google_spreadsheet/google_spreadsheet_view.xml2
-rw-r--r--addons/stock_account/wizard/stock_valuation_history.py44
-rw-r--r--addons/website/views/website_templates.xml2
5 files changed, 31 insertions, 25 deletions
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
diff --git a/addons/account_asset/report/account_asset_report.py b/addons/account_asset/report/account_asset_report.py
index 938da73efd5..1cafe349079 100644
--- a/addons/account_asset/report/account_asset_report.py
+++ b/addons/account_asset/report/account_asset_report.py
@@ -33,9 +33,7 @@ class AssetAssetReport(models.Model):
dl.name as name,
dl.depreciation_date as depreciation_date,
a.date as 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.value
ELSE 0
END) as gross_value,
@@ -59,8 +57,9 @@ class AssetAssetReport(models.Model):
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.date, dl.move_check, a.state, a.category_id, a.partner_id, a.company_id,
- a.value, a.id, a.salvage_value
+ a.value, a.id, a.salvage_value, dlmin.id
)""")
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 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
- <field name="domain">[('url', 'like', '/spreadsheet/')]</field>
+ <field name="domain">[('url', '=ilike', '%google%/spreadsheet%')]</field>
<field name="help">Google Spreadsheets</field>
</record>
diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py
index b213c44c295..343278ba3dd 100644
--- a/addons/stock_account/wizard/stock_valuation_history.py
+++ b/addons/stock_account/wizard/stock_valuation_history.py
@@ -129,8 +129,7 @@ class stock_history(osv.osv):
source
FROM
((SELECT
- stock_move.id::text || '-' || quant.id::text AS id,
- quant.id AS quant_id,
+ stock_move.id AS id,
stock_move.id AS move_id,
dest_location.id AS location_id,
dest_location.company_id AS company_id,
@@ -141,25 +140,28 @@ 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
source_location.usage not in ('internal', 'transit'))
- ) UNION
+ ) UNION ALL
(SELECT
- '-' || stock_move.id::text || '-' || quant.id::text AS id,
- quant.id AS quant_id,
+ (-1) * stock_move.id AS 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
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index c223a40ff50..dd3f90c95c1 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -142,7 +142,7 @@
</li>
<li t-if="submenu.child_id" t-attf-class="dropdown #{
(submenu.url and submenu.url != '/' and any([request.httprequest.path == child.url.replace('/page/website.', '/page/') for child in submenu.child_id]) or
- request.httprequest.path == submenu.url.replace('/page/website.', '/page/')) and 'active'
+ (submenu.url and request.httprequest.path == submenu.url.replace('/page/website.', '/page/'))) and 'active'
}">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<span t-field="submenu.name"/> <span class="caret" t-ignore="true"></span>