Browse Source

[LINT]

************* Module mail_archives
mail_archives/views/templates.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
mail_archives/README.rst:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module mail_to
mail_to/static/src/js/mail_to.js:11: [W7903(javascript-lint), ] Missing semicolon.
mail_to/templates.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
mail_to/doc/changelog.rst:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module mail_move_message
mail_move_message/doc/changelog.rst:1: [E7901(rst-syntax-error), ]  Hyperlink target "changelog" is not referenced.
mail_move_message/data/mail_move_message_data.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module mail_move_message.mail_move_message_models
mail_move_message/mail_move_message_models.py:74: [C8108(method-compute), Wizard] Name of compute method should starts with "_compute_"
mail_move_message/mail_move_message_models.py:91: [W8104(api-one-deprecated), Wizard.get_can_move] api.one deprecated
mail_move_message/mail_move_message_models.py:141: [W8104(api-one-deprecated), Wizard.check_access] api.one deprecated
mail_move_message/mail_move_message_models.py:198: [W8104(api-one-deprecated), Wizard.delete] api.one deprecated
mail_move_message/mail_move_message_models.py:233: [W8104(api-one-deprecated), Wizard.read_close] api.one deprecated
mail_move_message/mail_move_message_models.py:248: [C8108(method-compute), MailMessage] Name of compute method should starts with "_compute_"
mail_move_message/mail_move_message_models.py:251: [W8104(api-one-deprecated), MailMessage._get_all_childs] api.one deprecated
mail_move_message/mail_move_message_models.py:274: [W8104(api-one-deprecated), MailMessage.move] api.one deprecated
************* Module mail_base
mail_base/static/src/js/base.js:245: [W7903(javascript-lint), ] Misleading line break before '||'; readers may interpret this as an expression boundary.
mail_base/static/src/js/base.js:1119: [W7903(javascript-lint), ] Missing semicolon.
mail_base/static/src/js/base.js:1121: [W7903(javascript-lint), ] Missing semicolon.
mail_base/views/templates.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module mail_sent
mail_sent/doc/changelog.rst:1: [E7901(rst-syntax-error), ]  Hyperlink target "changelog" is not referenced.
mail_sent/views/templates.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module mail_sent.models
mail_sent/models.py:8: [C8108(method-compute), MailMessage] Name of compute method should starts with "_compute_"
mail_sent/models.py:12: [W8104(api-one-deprecated), MailMessage._get_sent] api.one deprecated
************* Module mail_reply
mail_reply/templates.xml:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module res_partner_mails_count
res_partner_mails_count/README.rst:1: [W7908(missing-newline-extrafiles), ]  Missing newline
************* Module res_partner_mails_count.models
res_partner_mails_count/models.py:8: [C8108(method-compute), ResPartner] Name of compute method should starts with "_compute_"
res_partner_mails_count/models.py:9: [C8108(method-compute), ResPartner] Name of compute method should starts with "_compute_"
res_partner_mails_count/models.py:12: [W8104(api-one-deprecated), ResPartner._mails_to] api.one deprecated
res_partner_mails_count/models.py:17: [W8104(api-one-deprecated), ResPartner._mails_from] api.one deprecated
pull/70/head
Ivan Yelizariev 8 years ago
parent
commit
ef41d90bcd
  1. 7
      mail_base/static/src/js/base.js
  2. 4
      mail_sent/models.py
  3. 20
      res_partner_mails_count/models.py

7
mail_base/static/src/js/base.js

@ -241,8 +241,7 @@ var MailTools = core.Class.extend({
subtype_description: data.subtype_description,
is_author: data.author_id && data.author_id[0] === session.partner_id,
is_note: data.is_note,
is_system_notification: data.message_type === 'notification' && data.model === 'mail.channel'
|| data.info === 'transient_message',
is_system_notification: data.message_type === 'notification' && data.model === 'mail.channel' || data.info === 'transient_message',
attachment_ids: data.attachment_ids || [],
subject: data.subject,
email_from: data.email_from,
@ -1116,9 +1115,9 @@ function init () {
});
// unsubscribe and then subscribe to the event, to avoid duplication of new messages
bus.off('notification')
bus.off('notification');
bus.on('notification', null, function(){
chat_manager.mail_tools.on_notification.apply(chat_manager.mail_tools, arguments)
chat_manager.mail_tools.on_notification.apply(chat_manager.mail_tools, arguments);
});
return session.rpc('/mail/client_action').then(function (result) {

4
mail_sent/models.py

@ -5,11 +5,11 @@ from openerp import api, models, fields
class MailMessage(models.Model):
_inherit = 'mail.message'
sent = fields.Boolean('Sent', compute="_get_sent", help='Was message sent to someone', store=True)
sent = fields.Boolean('Sent', compute="_compute_sent", help='Was message sent to someone', store=True)
@api.one
@api.depends('author_id', 'partner_ids')
def _get_sent(self):
def _compute_sent(self):
self_sudo = self.sudo()
self_sudo.sent = len(self_sudo.partner_ids) > 1 \
or len(self_sudo.partner_ids) == 1 \

20
res_partner_mails_count/models.py

@ -5,27 +5,15 @@ from openerp import models, fields, api
class ResPartner(models.Model):
_inherit = 'res.partner'
mails_to = fields.Integer(compute="_mails_to")
mails_from = fields.Integer(compute="_mails_from")
mails_to = fields.Integer(compute="_compute_mails_to")
mails_from = fields.Integer(compute="_compute_mails_from")
@api.multi
def _mails_to(self):
for r in self:
r._mails_to_one(self)
@api.multi
def _mails_to_one(self):
self.ensure_one()
def _compute_mails_to(self):
for r in self:
r.mails_to = self.env['mail.message'].sudo().search_count([('partner_ids', 'in', r.id)])
@api.multi
def _mails_from(self):
for r in self:
r._mails_from_one(self)
@api.multi
def _mails_from_one(self):
self.ensure_one()
def _compute_mails_from(self):
for r in self:
r.mails_from = self.env['mail.message'].sudo().search_count([('author_id', '=', r.id)])
Loading…
Cancel
Save