Skip to content

Commit

Permalink
Merge pull request #193 from Ommo73/12.0-mail_private-internal_users_…
Browse files Browse the repository at this point in the history
…checked

commit is created by 👷‍♂️ Merge Bot: https://odoo-devops.readthedocs.io/en/latest/git/github-merge-bot.html
  • Loading branch information
itpp-bot authored Oct 10, 2019
2 parents f2c1217 + ee4c0bd commit 3678cd3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions mail_multi_website/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
:target: https://www.gnu.org/licenses/lgpl
:alt: License: LGPL-3

===========================================
Email Addresses and Templates per Website
===========================================
=====================
Multi-Brand Mailing
=====================

Mail-related stuff for multi-website support

Expand Down
2 changes: 1 addition & 1 deletion mail_multi_website/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": """Email Addresses and Templates per Website""",
"name": """Multi-Brand Mailing""",
"summary": """Use single Backend to manage several Websites""",
"category": "Discuss",
# "live_test_url": "http://apps.it-projects.info/shop/product/website-multi-company?version=11.0",
Expand Down
6 changes: 3 additions & 3 deletions mail_multi_website/doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===========================================
Email Addresses and Templates per Website
===========================================
=====================
Multi-Brand Mailing
=====================

Installation
============
Expand Down
3 changes: 1 addition & 2 deletions mail_multi_website/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan" style="color:#875A7B;">Email Addresses and Templates per Website
</h2>
<h2 class="oe_slogan" style="color:#875A7B;">Multi-Brand Mailing</h2>
<h3 class="oe_slogan">Use single Backend to manage several Websites</h3>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion mail_private/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"category": "Discuss",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=12.0",
"images": [],
"version": "12.0.1.1.0",
"version": "12.0.1.1.1",
"application": False,

"author": "IT-Projects LLC, Pavel Romanchenko",
Expand Down
5 changes: 5 additions & 0 deletions mail_private/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`1.1.1`
-------

- **Improvement:** refactoring code

`1.1.0`
-------

Expand Down
7 changes: 1 addition & 6 deletions mail_private/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ def send_recepients_for_internal_message(self, model, domain):
result = []
default_resource = self.env[model].search(domain)
follower_ids = default_resource.message_follower_ids
internal_ids = self.get_internal_users_ids()

recipient_ids = [r.partner_id for r in follower_ids if r.partner_id]
# channel_ids = [c.channel_id for c in follower_ids if c.channel_id]

for recipient in recipient_ids:
result.append({
'checked': recipient.user_ids.id in internal_ids,
'checked': recipient.user_ids.id and not any(recipient.user_ids.mapped('share')),
'partner_id': recipient.id,
'full_name': recipient.name,
'name': recipient.name,
Expand Down Expand Up @@ -62,7 +61,3 @@ def _notify_compute_internal_recipients(self, record, msg_vals):
pids = [x[1] for x in msg_vals.get('partner_ids')] if 'partner_ids' in msg_vals else self.sudo().partner_ids.ids
recipient_data['partners'] = [i for i in recipient_data['partners'] if i['id'] in pids]
return recipient_data

def get_internal_users_ids(self):
internal_users_ids = self.env['res.users'].search([('share', '=', False)]).ids
return internal_users_ids
2 changes: 1 addition & 1 deletion mail_private/static/src/xml/mail_private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<t t-extend="mail.chatter.Buttons">
<t t-jquery="button[title='Send a message']" t-operation="after">
<button class="btn btn-link oe_compose_post_private" title="Send a message to specified recipients only">Send internal message</button>
<button t-if="newMessageButton" class="btn btn-link oe_compose_post_private" title="Send a message to specified recipients only">Send internal message</button>
</t>
</t>

Expand Down

0 comments on commit 3678cd3

Please sign in to comment.