summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-05-24 16:40:53 +0200
committerChristophe Simonis <chs@odoo.com>2016-05-24 16:40:53 +0200
commitd35d8c3fca2c240014b92a0796e22c3dfd13d824 (patch)
tree1207d2fa49c255c1abd55b818ddd825f16db28f8
parent2d66d9a63e85dada87b5c70b38bda9ec059aaaf4 (diff)
parente5c2e6e00133b8fa362df6b3479717053d0aed97 (diff)
[MERGE] forward port of branch saas-9 up to e5c2e6e
-rw-r--r--addons/account/report/account_aged_partner_balance.py1
-rw-r--r--addons/account_asset/account_asset.py8
-rw-r--r--addons/im_livechat/static/src/js/im_livechat.js4
-rw-r--r--addons/l10n_fr/plan_comptable_general.xml2
-rw-r--r--addons/project_issue/project_issue.py5
-rw-r--r--addons/website_mail/models/mail_message.py1
-rw-r--r--addons/website_mail/views/website_mail.xml2
7 files changed, 11 insertions, 12 deletions
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 7bcb8432926..df52011118d 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -128,6 +128,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
history.append(partners_amount)
for partner in partners:
+ at_least_one_amount = False
values = {}
# Query here is replaced by one query which gets the all the partners their 'after' value
after = False
diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py
index 5824c07d5c2..c189fc0203b 100644
--- a/addons/account_asset/account_asset.py
+++ b/addons/account_asset/account_asset.py
@@ -127,19 +127,15 @@ class AccountAssetAsset(models.Model):
amount = amount_to_depr / (undone_dotation_number - len(posted_depreciation_line_ids))
if self.prorata and self.category_id.type == 'purchase':
amount = amount_to_depr / self.method_number
- days = total_days - float(depreciation_date.strftime('%j'))
if sequence == 1:
+ days = (self.company_id.compute_fiscalyear_dates(depreciation_date)['date_to'] - depreciation_date).days + 1
amount = (amount_to_depr / self.method_number) / total_days * days
- elif sequence == undone_dotation_number:
- amount = (amount_to_depr / self.method_number) / total_days * (total_days - days)
elif self.method == 'degressive':
amount = residual_amount * self.method_progress_factor
if self.prorata:
- days = total_days - float(depreciation_date.strftime('%j'))
if sequence == 1:
+ days = (self.company_id.compute_fiscalyear_dates(depreciation_date)['date_to'] - depreciation_date).days + 1
amount = (residual_amount * self.method_progress_factor) / total_days * days
- elif sequence == undone_dotation_number:
- amount = (residual_amount * self.method_progress_factor) / total_days * (total_days - days)
return amount
def _compute_board_undone_dotation_nb(self, depreciation_date, total_days):
diff --git a/addons/im_livechat/static/src/js/im_livechat.js b/addons/im_livechat/static/src/js/im_livechat.js
index f29ea4ce79a..a2369f494b7 100644
--- a/addons/im_livechat/static/src/js/im_livechat.js
+++ b/addons/im_livechat/static/src/js/im_livechat.js
@@ -2,6 +2,7 @@ odoo.define('im_livechat.im_livechat', function (require) {
"use strict";
var bus = require('bus.bus').bus;
+var config = require('web.config');
var core = require('web.core');
var session = require('web.session');
var time = require('web.time');
@@ -55,10 +56,11 @@ var LivechatButton = Widget.extend({
start: function () {
this.$el.text(this.options.button_text);
+ var small_screen = config.device.size_class === config.device.SIZES.XS;
if (this.history) {
_.each(this.history.reverse(), this.add_message.bind(this));
this.open_chat();
- } else if (this.rule.action === 'auto_popup') {
+ } else if (!small_screen && this.rule.action === 'auto_popup') {
var auto_popup_cookie = utils.get_cookie('im_livechat_auto_popup');
if (!auto_popup_cookie || JSON.parse(auto_popup_cookie)) {
this.auto_popup_timeout = setTimeout(this.open_chat.bind(this), this.rule.auto_popup_timer*1000);
diff --git a/addons/l10n_fr/plan_comptable_general.xml b/addons/l10n_fr/plan_comptable_general.xml
index d16acb998d9..f846e6178a3 100644
--- a/addons/l10n_fr/plan_comptable_general.xml
+++ b/addons/l10n_fr/plan_comptable_general.xml
@@ -2053,7 +2053,7 @@
<record id="pcg_421" model="account.account.template">
<field name="name">Personnel - Rémunérations dues</field>
<field name="code">421</field>
- <field name="user_type_id" ref="account.data_account_type_current_liabilities"/>
+ <field name="user_type_id" ref="account.data_account_type_payable"/>
<field name="reconcile" eval="True"/>
<field name="chart_template_id" ref="l10n_fr_pcg_chart_template"/>
</record>
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 79941409762..b0a9dbf0b25 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -570,9 +570,10 @@ class project_project(osv.Model):
class res_partner(osv.osv):
def _issue_count(self, cr, uid, ids, field_name, arg, context=None):
Issue = self.pool['project.issue']
+ partners = {id: self.search(cr, uid, [('id', 'child_of', ids)]) for id in ids}
return {
- partner_id: Issue.search_count(cr,uid, [('partner_id', '=', partner_id)])
- for partner_id in ids
+ partner_id: Issue.search_count(cr, uid, [('partner_id', 'in', partners[partner_id])])
+ for partner_id in partners.keys()
}
""" Inherits partner and adds Issue information in the partner form """
diff --git a/addons/website_mail/models/mail_message.py b/addons/website_mail/models/mail_message.py
index e43a6eca9c0..544282fe813 100644
--- a/addons/website_mail/models/mail_message.py
+++ b/addons/website_mail/models/mail_message.py
@@ -68,4 +68,3 @@ class MailMessage(osv.Model):
if cr.fetchall():
raise AccessError(_('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation))
return super(MailMessage, self).check_access_rule(cr, uid, ids=ids, operation=operation, context=context)
-
diff --git a/addons/website_mail/views/website_mail.xml b/addons/website_mail/views/website_mail.xml
index 50192030cc2..d0df8e6b5a1 100644
--- a/addons/website_mail/views/website_mail.xml
+++ b/addons/website_mail/views/website_mail.xml
@@ -73,7 +73,7 @@
</t>
<t t-foreach="messages" t-as="message">
<t t-if="message.website_published or website.env.user.sudo(website.env.user.id).has_group('base.group_website_publisher')">
- <li class="media" t-if="message.message_type == 'comment'" t-att-id="'message-%s' % message.id">
+ <li class="media" t-if="message.message_type != 'notification'" t-att-id="'message-%s' % message.id">
<div class="media-body">
<img class="media-object pull-left img-circle" t-attf-src="/mail/#{message.model}/#{message.res_id}/avatar/#{message.author_id.id}"
style="width: 50px; margin-right: 10px;"/>