summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-19 16:16:57 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-19 16:16:57 +0200
commitf07ca36b9b8ea47c62cf1aec0428f4fa251b0e40 (patch)
treea1de08423c1163cc22511fc077e0331d41dfc0b2
parentf081f19fb84869181e9abb0066519c39db61b0d5 (diff)
parent41433debdbb1f9828e81115e6bc76eb35ddfa693 (diff)
[MERGE] forward port branch 9.0 up to 41433debdbb
-rw-r--r--addons/account/models/company.py10
-rw-r--r--addons/website_quote/static/src/js/website_quotation.js6
2 files changed, 14 insertions, 2 deletions
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index 6259a318557..4e1823c23ee 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -57,10 +57,16 @@ Best Regards,''')
if (date.month < last_month or (date.month == last_month and date.day <= last_day)):
date = date.replace(month=last_month, day=last_day)
else:
- date = date.replace(month=last_month, day=last_day, year=date.year + 1)
+ if last_month == 2 and last_day == 29 and (date.year + 1) % 4 != 0:
+ date = date.replace(month=last_month, day=28, year=date.year + 1)
+ else:
+ date = date.replace(month=last_month, day=last_day, year=date.year + 1)
date_to = date
date_from = date + timedelta(days=1)
- date_from = date_from.replace(year=date_from.year - 1)
+ if date_from.month == 2 and date_from.day == 29:
+ date_from = date_from.replace(day=28, year=date_from.year - 1)
+ else:
+ date_from = date_from.replace(year=date_from.year - 1)
return {'date_from': date_from, 'date_to': date_to}
def get_new_account_code(self, current_code, old_prefix, new_prefix, digits):
diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js
index 798b1ec5a76..fc490e03f63 100644
--- a/addons/website_quote/static/src/js/website_quotation.js
+++ b/addons/website_quote/static/src/js/website_quotation.js
@@ -135,12 +135,18 @@ if(!$('.o_website_quote').length) {
case "h1":
var id = self.setElementId('quote_header_', el);
var text = self.extractText($(el));
+ if (!text) {
+ break;
+ }
last_li = $("<li>").append($('<a href="#'+id+'"/>').text(text)).appendTo(self.$el);
last_ul = false;
break;
case "h2":
var id = self.setElementId('quote_', el);
var text = self.extractText($(el));
+ if (!text) {
+ break;
+ }
if (last_li) {
if (!last_ul) {
last_ul = $("<ul class='nav'>").appendTo(last_li);