-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11.0 mail addons merge #235
Changes from 11 commits
3e3ab4c
1ccc657
c045b3d
5a610a4
32ba6a0
ad8ea0f
e79c1e5
8e05ef8
033f248
a090316
570c37c
7d12f03
2d3c710
980effc
c04e4a0
c7f3f8a
1914b4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from . import models | ||
from . import controllers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# 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": "11.0.1.0.5", | ||
"version": "11.0.1.1.0", | ||
|
||
"author": "IT-Projects LLC, Pavel Romanchenko", | ||
"support": "[email protected]", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/* Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev> | ||
Copyright 2016 manavi <https://github.com/manawi> | ||
Copyright 2017-2018 Artyom Losev <https://github.com/ArtyomLosev> | ||
Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */ | ||
/* Copyright 2016 x620 <https://github.com/x620> | ||
Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev> | ||
Copyright 2016 manawi <https://github.com/manawi> | ||
Copyright 2017 Artyom Losev <https://github.com/ArtyomLosev> | ||
Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/> | ||
License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). */ | ||
odoo.define('mail_private', function (require) { | ||
'use strict'; | ||
|
||
|
@@ -98,7 +99,61 @@ Chatter.include({ | |
return obj.partner_id !== session.partner_id; | ||
}); | ||
}); | ||
} | ||
}, | ||
|
||
get_channels_for_internal_message: function () { | ||
var self = this; | ||
self.result = {}; | ||
return new Model(this.context.default_model).query( | ||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'Model' is not defined no-undef There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is suspicious, obsolete function for v11 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KolushovAlexandr Yep! You're right. I fixed it |
||
['message_follower_ids', 'partner_id']).filter( | ||
[['id', '=', self.context.default_res_id]]).all() | ||
.then(function (thread) { | ||
var follower_ids = thread[0].message_follower_ids; | ||
self.result[self.context.default_res_id] = []; | ||
self.customer = thread[0].partner_id; | ||
|
||
// Fetch channels ids | ||
return new Model('mail.followers').call( | ||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'Model' is not defined no-undef |
||
'read', [follower_ids, ['channel_id']]).then(function (res_channels) { | ||
// Filter result and push to array | ||
var res_channels_filtered = _.map(res_channels, function (channel) { | ||
if (channel.channel_id[0]) { | ||
return channel.channel_id[0]; | ||
} | ||
}).filter(function (channel) { | ||
return typeof channel !== 'undefined'; | ||
}); | ||
|
||
return new Model('mail.channel').call( | ||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'Model' is not defined no-undef |
||
'read', [res_channels_filtered, ['name', 'id']] | ||
).then(function (recipients) { | ||
return recipients; | ||
}); | ||
}); | ||
}); | ||
}, | ||
|
||
get_internal_users_ids: function () { | ||
var ResUser = new Model('mail.compose.message'); | ||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'Model' is not defined no-undef |
||
this.users_ids = ResUser.call('get_internal_users_ids', [[]]).then( function (users_ids) { | ||
return users_ids; | ||
}); | ||
return this.users_ids; | ||
}, | ||
|
||
get_checked_channels_ids: function () { | ||
var self = this; | ||
var checked_channels = []; | ||
this.$('.o_composer_suggested_channels input:checked').each(function() { | ||
var full_name = $(this).data('fullname').toString(); | ||
_.each(self.channels_for_internal_message, function(item) { | ||
if (full_name === item.name) { | ||
checked_channels.push(item.id); | ||
} | ||
}); | ||
}); | ||
return checked_channels; | ||
}, | ||
}); | ||
|
||
ChatterComposer.include({ | ||
|
@@ -154,6 +209,17 @@ ChatterComposer.include({ | |
this.$('.o_composer_suggested_partners input:checked').each(function() { | ||
$(this).prop('checked', false); | ||
}); | ||
this.$('.o_composer_suggested_channels input:checked').each(function() { | ||
$(this).prop('checked', false); | ||
}); | ||
}, | ||
|
||
preprocess_message: function () { | ||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var self = this; | ||
if (self.options.is_private) { | ||
self.context.is_private = true; | ||
} | ||
return this._super(); | ||
}, | ||
|
||
on_open_full_composer: function() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
# Copyright 2016 x620 <https://github.com/x620> | ||
# Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev> | ||
# Copyright 2018 Ruslan Ronzhin | ||
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/> | ||
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). | ||
{ | ||
"name": """Show message recipients""", | ||
"summary": """Allows you be sure, that all discussion participants were notified""", | ||
"category": "Discuss", | ||
"images": ['images/1.png'], | ||
"version": "11.0.1.0.1", | ||
"version": "11.0.1.1.0", | ||
|
||
"author": "IT-Projects LLC, Pavel Romanchenko", | ||
"support": "[email protected]", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
`1.1.0` | ||
------- | ||
|
||
- **New**: channels are displayed in recipients | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 checked |
||
|
||
|
||
Ommo73 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`1.0.1` | ||
------- | ||
|
||
- **FIX:** The problem with duplicating the names of recipients was solved. | ||
- **FIX**: the problem with duplicating the names of recipients was solved. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The -> the. Предлагаю обратно |
||
|
||
`1.0.0` | ||
------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import mail_message |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73/> | ||
# License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). | ||
from odoo import models, api | ||
|
||
|
||
class MailMessage(models.Model): | ||
_inherit = 'mail.message' | ||
|
||
@api.multi | ||
def message_format(self): | ||
messages_values = super(MailMessage, self).message_format() | ||
for i in messages_values: | ||
if i['channel_ids']: | ||
i['channel_names'] = self.env['mail.channel'].browse(i['channel_ids']).mapped( | ||
lambda r: [r.id, '#' + r.display_name]) | ||
|
||
return messages_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 checked