Browse Source

Merge remote-tracking branch 'upstream/8.0' into 9.0-merge-398e5ef

pull/69/head
Ivan Yelizariev 8 years ago
parent
commit
1f17fdf14d
  1. 6
      res_partner_company_messages/README.rst
  2. 2
      res_partner_company_messages/__init__.py
  3. 15
      res_partner_company_messages/__openerp__.py
  4. BIN
      res_partner_company_messages/images/child.png
  5. BIN
      res_partner_company_messages/images/parent.png
  6. 18
      res_partner_company_messages/models.py
  7. BIN
      res_partner_company_messages/static/description/icon.png
  8. 3
      res_partner_company_messages/views.xml

6
res_partner_company_messages/README.rst

@ -0,0 +1,6 @@
Aggregate messages from company's contacts
==========================================
By default, odoo displays under partner form only its own messages. The module shows under company form both their own messages and the messages of any contacts attached to that company.
Tested on Odoo 8.0 ea60fed97af1c139e4647890bf8f68224ea1665b

2
res_partner_company_messages/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

15
res_partner_company_messages/__openerp__.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
{
'name': "Aggregate messages from company's contacts",
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category': 'Custom',
'website': 'https://yelizariev.github.io',
'images': ['images/child.png', 'images/parent.png'],
'depends': ['mail'],
'data': [
'views.xml',
],
'installable': True
}

BIN
res_partner_company_messages/images/child.png

After

Width: 812  |  Height: 588  |  Size: 50 KiB

BIN
res_partner_company_messages/images/parent.png

After

Width: 811  |  Height: 583  |  Size: 67 KiB

18
res_partner_company_messages/models.py

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from openerp import api
from openerp import models
class MailMessage(models.Model):
_inherit = 'mail.message'
@api.cr_uid_context
def message_read(self, cr, uid, ids=None, domain=None, message_unload_ids=None,
thread_level=0, context=None, parent_id=False, limit=None):
if context and context.get('default_model') == 'res.partner':
partner = self.pool['res.partner'].browse(cr, uid, context.get('default_res_id'))
domain_by_id = domain and len(domain) == 1 and domain[0][0] == 'id' and domain[0][1] == '='
if partner.is_company and not domain_by_id:
ids = None
domain = [('model', '=', 'res.partner'), ('res_id', 'in', [partner.id] + partner.child_ids.ids)]
return super(MailMessage, self).message_read(cr, uid, ids, domain, message_unload_ids, thread_level, context, parent_id, limit)

BIN
res_partner_company_messages/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 3.0 KiB

3
res_partner_company_messages/views.xml

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp><data>
</data></openerp>
Loading…
Cancel
Save