summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-02-11 16:39:11 +0100
committerChristophe Simonis <chs@odoo.com>2015-02-11 16:39:11 +0100
commitd73eeab5ba81759e3e98232f7171e36a4d99fe1a (patch)
tree17251a28f5b843533e29d518afdf72c67a3ab599
parent48f527b86078b53a4666693a0664dfd79428fb7d (diff)
parent9fe040e59237ebdacd4dd3c299a3e79428354651 (diff)
[MERGE] forward port of branch 7.0 up to 9fe040e
-rw-r--r--addons/account/report/account_invoice_report.py13
-rw-r--r--addons/web/static/src/js/view_list_editable.js2
2 files changed, 3 insertions, 12 deletions
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 8fecf85ee0b..22be94a9a79 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -154,17 +154,8 @@ class account_invoice_report(osv.osv):
WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text])
THEN - ai.residual
ELSE ai.residual
- END / CASE
- WHEN (( SELECT count(l.id) AS count
- FROM account_invoice_line l
- LEFT JOIN account_invoice a ON a.id = l.invoice_id
- WHERE a.id = ai.id)) <> 0
- THEN ( SELECT count(l.id) AS count
- FROM account_invoice_line l
- LEFT JOIN account_invoice a ON a.id = l.invoice_id
- WHERE a.id = ai.id)
- ELSE 1::bigint
- END::numeric AS residual,
+ END / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) *
+ count(*) AS residual,
ai.commercial_partner_id as commercial_partner_id,
partner.country_id
"""
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 159286d631a..8dc2e176613 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -649,7 +649,7 @@
var form = this.editor.form;
var last_field = _(form.fields_order).chain()
.map(function (name) { return form.fields[name]; })
- .filter(function (field) { return field.$el.is(':visible'); })
+ .filter(function (field) { return field.$el.is(':visible') && !field.get('effective_readonly'); })
.last()
.value();
// tabbed from last field in form