Browse Source

mail_base New: added ability to select channels for private message sending

pull/182/head
ommo73 5 years ago
parent
commit
3e3ab4cb28
No known key found for this signature in database GPG Key ID: E7E1F5C23505AFF8
  1. 2
      mail_base/README.rst
  2. 1
      mail_base/__init__.py
  3. 6
      mail_base/__manifest__.py
  4. 3
      mail_base/controllers/main.py
  5. 4
      mail_base/doc/changelog.rst
  6. 7
      mail_base/models.py
  7. 6
      mail_base/static/lib/base.js

2
mail_base/README.rst

@ -6,7 +6,7 @@ Mail Base
* fixes toggling left bar
* fixes Recipients field. Out-of-box this field could be empty.
One can say, that the module do this todo from `addons/mail/static/src/js/chat_manager.js <https://github.com/odoo/odoo/blob/9.0/addons/mail/static/src/js/chat_manager.js#L57>`__
One can say, that the module do this todo from `addons/mail/static/src/js/chat_manager.js <https://github.com/odoo/odoo/blob/10.0/addons/mail/static/src/js/chat_manager.js#L57>`__
// to do: move this to mail.utils

1
mail_base/__init__.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html)
from . import models
from . import controllers

6
mail_base/__manifest__.py

@ -1,10 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2016 x620 <https://github.com/x620>
# Copyright 2018 Ruslan Ronzhin <https://it-projects.info/team/rusllan/>
# Copyright 2016-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html)
{
"name": "Mail Base",
"summary": """Makes Mail extendable""",
"category": "Discuss",
"images": [],
"version": "10.0.1.0.5",
"version": "10.0.1.1.0",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@it-projects.info",

3
mail_base/controllers/main.py

@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2017 mikaelh <https://github.com/mikaelh>
# Copyright 2017-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html)
from openerp.http import request
from openerp.addons.bus.controllers.main import BusController

4
mail_base/doc/changelog.rst

@ -1,3 +1,7 @@
`1.1.0`
-------
- **New**: added ability to select channels for private message sending.
`1.0.5`
-------
**FIX**: polling errors on heavy server load

7
mail_base/models.py

@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2016 x620 <https://github.com/x620>
# Copyright 2017 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html)
from openerp import api, models
@ -13,8 +16,8 @@ class MailMessage(models.Model):
values['partner_ids'] = []
for triplet in values.get('needaction_partner_ids'):
if triplet[0] == 6:
for id in triplet[2]:
values['partner_ids'].append((4, id, False))
for i in triplet[2]:
values['partner_ids'].append((4, i, False))
return super(MailMessage, self).write(values)

6
mail_base/static/lib/base.js

@ -1,3 +1,6 @@
/* Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev>
Copyright 2019 Artem Rafailov <https://github.com/Ommo73>
License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('mail_base.base', function (require) {
"use strict";
@ -215,7 +218,7 @@ var MailComposer = composer.BasicComposer.extend({
var parsed_email = utils.parse_email(recipient[1]);
if (_.indexOf(email_addresses, parsed_email[1]) === -1) {
self.suggested_partners.push({
checked: true,
checked: false,
partner_id: recipient[0],
full_name: recipient[1],
name: parsed_email[0],
@ -1059,6 +1062,7 @@ chat_manager.post_message = function (data, options) {
options = options || {};
var msg = {
partner_ids: data.partner_ids,
channel_ids: data.channel_ids,
body: _.str.trim(data.content),
attachment_ids: data.attachment_ids
};

Loading…
Cancel
Save