[MERGE] forward port of branch 7.0 up to 9fe040e

This commit is contained in:
Christophe Simonis 2015-02-11 16:39:11 +01:00
commit d73eeab5ba
2 changed files with 3 additions and 12 deletions

View File

@ -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
"""

View File

@ -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