diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-24 17:23:28 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-24 17:23:28 +0100 |
| commit | 4ea4f99df99e0f8d6e01b3116020cd1b525ec1fd (patch) | |
| tree | fbfb33d0552b5cab1c5ce0d9ec77647d586d8d3f | |
| parent | 2e515a61bc9da0660d906d2b2931fba1ac8793e3 (diff) | |
| parent | efd300156b8ae7dd768864b4078f9c89672b8703 (diff) | |
[MERGE] forward port branch 10.0 up to efd300156b8
| -rw-r--r-- | addons/account/models/account_invoice.py | 4 | ||||
| -rw-r--r-- | addons/account/models/account_move.py | 2 | ||||
| -rw-r--r-- | addons/website_blog/models/website_blog.py | 11 | ||||
| -rw-r--r-- | addons/website_sale/static/src/js/website_sale_validate.js | 5 |
4 files changed, 14 insertions, 8 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 1f92ac3e2be..701c00c3bd0 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1077,6 +1077,7 @@ class AccountInvoice(models.Model): values['state'] = 'draft' values['number'] = False values['origin'] = invoice.number + values['payment_term_id'] = False values['refund_invoice_id'] = invoice.id if date: @@ -1465,6 +1466,7 @@ class AccountPaymentTerm(models.Model): def compute(self, value, date_ref=False): date_ref = date_ref or fields.Date.today() amount = value + sign = value < 0 and -1 or 1 result = [] if self.env.context.get('currency_id'): currency = self.env['res.currency'].browse(self.env.context['currency_id']) @@ -1473,7 +1475,7 @@ class AccountPaymentTerm(models.Model): prec = currency.decimal_places for line in self.line_ids: if line.value == 'fixed': - amt = round(line.value_amount, prec) + amt = sign * round(line.value_amount, prec) elif line.value == 'percent': amt = round(value * (line.value_amount / 100.0), prec) elif line.value == 'balance': diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index f4d5b75cd86..86d3d244ea6 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -822,7 +822,7 @@ class AccountMoveLine(models.Model): elif self._context.get('skip_full_reconcile_check') == 'amount_currency_only': field = 'amount_residual_currency' #target the pair of move in self that are the oldest - sorted_moves = sorted(self, key=lambda a: a.date) + sorted_moves = sorted(self, key=lambda a: a.date_maturity or a.date) debit = credit = False for aml in sorted_moves: if credit and debit: diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py index cbce0e72d6e..7fc3a6cff49 100644 --- a/addons/website_blog/models/website_blog.py +++ b/addons/website_blog/models/website_blog.py @@ -207,11 +207,12 @@ class BlogPost(models.Model): @api.multi def write(self, vals): - self.ensure_one() - if 'website_published' in vals and 'published_date' not in vals: - if self.published_date <= fields.Datetime.now(): - vals['published_date'] = vals['website_published'] and fields.Datetime.now() - result = super(BlogPost, self).write(vals) + result = True + for post in self: + copy_vals = vals + if 'website_published' in vals and 'published_date' not in vals and post.published_date <= fields.Datetime.now(): + copy_vals['published_date'] = vals['website_published'] and fields.Datetime.now() or False + result &= super(BlogPost, self).write(copy_vals) self._check_for_publication(vals) return result diff --git a/addons/website_sale/static/src/js/website_sale_validate.js b/addons/website_sale/static/src/js/website_sale_validate.js index 614e8901484..3bef4bc4f9a 100644 --- a/addons/website_sale/static/src/js/website_sale_validate.js +++ b/addons/website_sale/static/src/js/website_sale_validate.js @@ -21,7 +21,10 @@ $(document).ready(function () { setTimeout(function () { payment_transaction_poll_status(); }, Math.ceil(_poll_nbr / 3) * 1000); } else { - result.message = "<i class='fa fa-warning' />"; + var $message = $(result.message); + $message.find('span:first').prepend($( + "<i title='We are waiting the confirmation of the bank or payment provider' class='fa fa-warning' style='margin-right:10px;'>")); + result.message = $message.html(); } } $('div.oe_website_sale_tx_status').html(result.message); |
