summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-11-22 17:35:59 +0100
committerChristophe Simonis <chs@odoo.com>2016-11-22 17:35:59 +0100
commit2633bb48533ea1e45c57ea26aeafce8526ceacfb (patch)
tree6c875fccc8b46c20e41bb0b4a6398a022aba543c
parentdcf50bf2422b242c96d6b1ff33236fa0e56335ae (diff)
parentc7b17125924ad4339eb653353600317d7648d6bf (diff)
[MERGE] forward port branch 9.0 up to c7b1712
-rw-r--r--addons/account/models/account_move.py2
-rw-r--r--addons/account_tax_cash_basis/tax_cash_basis.py10
-rw-r--r--addons/web_tip/static/src/js/tip.js2
-rw-r--r--addons/website/models/website.py8
4 files changed, 12 insertions, 10 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 21881e22e9f..117597b8fd2 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -54,7 +54,7 @@ class AccountMove(models.Model):
total_amount += amount
for partial_line in (line.matched_debit_ids + line.matched_credit_ids):
total_reconciled += partial_line.amount
- if total_amount == 0.0:
+ if float_is_zero(total_amount, precision_rounding=move.currency_id.rounding):
move.matched_percentage = 1.0
else:
move.matched_percentage = total_reconciled / total_amount
diff --git a/addons/account_tax_cash_basis/tax_cash_basis.py b/addons/account_tax_cash_basis/tax_cash_basis.py
index b68e348c59e..242356f4967 100644
--- a/addons/account_tax_cash_basis/tax_cash_basis.py
+++ b/addons/account_tax_cash_basis/tax_cash_basis.py
@@ -53,7 +53,7 @@ class AccountPartialReconcileCashBasis(models.Model):
#create reporting issues. Not sure of the behavior to implement in that case, though.
# amount to write is the current cash_basis amount minus the one before the reconciliation
matched_percentage = value_before_reconciliation[move.id]
- amount = (line.credit_cash_basis - line.debit_cash_basis) - (line.credit - line.debit) * matched_percentage
+ amount = line.currency_id.round((line.credit_cash_basis - line.debit_cash_basis) - (line.credit - line.debit) * matched_percentage)
if not self._check_tax_exigible(line):
if line.tax_line_id and line.tax_line_id.use_cash_basis:
# group by line account
@@ -73,15 +73,15 @@ class AccountPartialReconcileCashBasis(models.Model):
for tax in line.tax_ids:
line_to_create.append((0, 0, {
'name': '/',
- 'debit': line.debit_cash_basis - line.debit * matched_percentage,
- 'credit': line.credit_cash_basis - line.credit * matched_percentage,
+ 'debit': line.currency_id.round(line.debit_cash_basis - line.debit * matched_percentage),
+ 'credit': line.currency_id.round(line.credit_cash_basis - line.credit * matched_percentage),
'account_id': line.account_id.id,
'tax_ids': [(6, 0, [tax.id])],
}))
line_to_create.append((0, 0, {
'name': '/',
- 'credit': line.debit_cash_basis - line.debit * matched_percentage,
- 'debit': line.credit_cash_basis - line.credit * matched_percentage,
+ 'credit': line.currency_id.round(line.debit_cash_basis - line.debit * matched_percentage),
+ 'debit': line.currency_id.round(line.credit_cash_basis - line.credit * matched_percentage),
'account_id': line.account_id.id,
}))
diff --git a/addons/web_tip/static/src/js/tip.js b/addons/web_tip/static/src/js/tip.js
index 3f4d908b1eb..416598277ba 100644
--- a/addons/web_tip/static/src/js/tip.js
+++ b/addons/web_tip/static/src/js/tip.js
@@ -300,6 +300,8 @@ var Tip = Class.extend({
if (this.$element) {
this.$element.popover('destroy');
this.$element.removeClass('oe_tip_show_element');
+ }
+ if (this.$breathing) {
this.$breathing.off().remove();
}
if (this.$helper) {
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index fd3904406ce..8d2177b2d2b 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -564,12 +564,12 @@ class website(osv.osv):
def search_pages(self, cr, uid, ids, needle=None, limit=None, context=None):
name = re.sub(r"^/p(a(g(e(/(w(e(b(s(i(t(e(\.)?)?)?)?)?)?)?)?)?)?)?)?", "", needle or "")
+ name = slugify(name, max_length=50)
res = []
for page in self.enumerate_pages(cr, uid, ids, query_string=name, context=context):
- if needle in page['loc']:
- res.append(page)
- if len(res) == limit:
- break
+ res.append(page)
+ if len(res) == limit:
+ break
return res
def image_url(self, cr, uid, record, field, size=None, context=None):