[MERGE] forward port of branch 9.0 up to e69d9b8
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -565,9 +565,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 """
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;"/>
|
||||
|
||||
Reference in New Issue
Block a user