-
-
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
⚡ mail_private New: internal users are flagged automatically #183
⚡ mail_private New: internal users are flagged automatically #183
Conversation
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.
You don't need to use 8️⃣ here. See https://gitlab.com/itpp/handbook/blob/master/documenting-updates.md#version-tags
mail_private/doc/changelog.rst
Outdated
`1.0.1` | ||
------- | ||
|
||
- Internal users are flagged automatically. Added button "Uncheck all". |
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.
For new feature you need to change version differently. Check documentation about it https://odoo-development.readthedocs.io/en/latest/dev/docs/__manifest__.py.html#version
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.
One line per update. Use Version tags. See at the bottom of this doc: https://gitlab.com/itpp/handbook/blob/master/documenting-updates.md#changelog-tags
mail_private/doc/changelog.rst
Outdated
@@ -1,6 +1,11 @@ | |||
Updates | |||
======= |
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.
It's obsolete format. Please remove
2d8775a
to
e8e543d
Compare
openerp.mail_private = function(instance){ | ||
|
||
var mail = instance.mail; | ||
|
||
instance.mail.ThreadComposeMessage.include({ | ||
init: function (parent, datasets, options) { | ||
this._super.apply(this, arguments); | ||
self = this; |
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.
Implicit global variable, assign as global property instead no-implicit-globals
Read-only global 'self' should not be modified no-native-reassign
df060be
to
0df6766
Compare
11a6954
to
a2f8f33
Compare
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.
1 Non-internal users are selected too
2 this Lint:
mail_private/models.py:7: [W0402(deprecated-module), ] Uses of a deprecated module 'openerp.osv'
} | ||
.oe_mail .oe_msg_composer .oe_msg_content .oe_recipients { | ||
margin-left: 0px; | ||
} |
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.
No new line at end of file
this.private = false; | ||
<<<<<<< HEAD | ||
======= |
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.
Expected an identifier and instead saw '==='.
Misleading line break before '==='; readers may interpret this as an expression boundary.
Unrecoverable syntax error. (6% scanned).
this.private = false; | ||
<<<<<<< HEAD |
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.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw '<<'.
Expected an operator and instead saw '<'.
Expected an operator and instead saw '<<'.
Missing semicolon.
this.private = false; | ||
<<<<<<< HEAD |
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.
Parsing error: Unexpected token <<
mail_private/models.py
Outdated
private = fields.boolean('Send Internal Message') | ||
|
||
def get_internal_users_ids(self, cr, uid, context=None ): | ||
return self.pool['res.users'].search(cr, uid, [('share','=',False)], context=context) |
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.
missing whitespace after ','
mail_private/models.py
Outdated
} | ||
private = fields.boolean('Send Internal Message') | ||
|
||
def get_internal_users_ids(self, cr, uid, context=None ): |
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.
whitespace before ')'
mail_private/models.py
Outdated
|
||
from openerp.osv import osv, fields | ||
|
||
import wdb |
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.
'wdb' imported but unused
this.users_ids = ResUser.call('get_internal_users_ids', [[]]).then( function (users_ids) { | ||
return users_ids; | ||
}); | ||
return this.users_ids |
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.
Missing semicolon.
$(this).prop('checked', false); | ||
}); | ||
_.each(self.recipients, function(res) { | ||
res["checked"] = false; |
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'] is better written in dot notation.
this.users_ids = ResUser.call('get_internal_users_ids', [[]]).then( function (users_ids) { | ||
return users_ids; | ||
}); | ||
return this.users_ids |
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.
Missing semicolon semi
self.show_composer = !self.show_composer || self.stay_open; | ||
self.reinit(); | ||
} | ||
if (!self.stay_open && self.show_composer && (!event || event.type != 'blur')) { |
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.
Expected '!==' and instead saw '!=' eqeqeq
|
||
// when call for suggested partners finished: re-render the widget | ||
$.when(suggested_partners).pipe(function (additional_recipients) { | ||
if ((!self.stay_open || (event && event.type == 'click')) && (!self.show_composer || !self.$('textarea:not(.oe_compact)').val().match(/\S+/) && !self.attachment_ids.length)) { |
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.
Expected '===' and instead saw '==' eqeqeq
Unexpected mix of '||' and '&&' no-mixed-operators
var parsed_email = mail.ChatterUtils.parse_email(recipient[1]); | ||
if (_.indexOf(email_addresses, parsed_email[1]) == -1) { | ||
self.recipients.push({ | ||
'checked': (self.internal_users_ids.indexOf( recipient[3][0] ) != -1), |
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.
Expected '!==' and instead saw '!=' eqeqeq
var thread_recipients = additional_recipients[self.context.default_res_id]; | ||
_.each(thread_recipients, function (recipient) { | ||
var parsed_email = mail.ChatterUtils.parse_email(recipient[1]); | ||
if (_.indexOf(email_addresses, parsed_email[1]) == -1) { |
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.
Expected '===' and instead saw '==' eqeqeq
74bd3b7
to
252cc82
Compare
bf7187e
to
10ba230
Compare
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.
instance.mail.Thread.include({ | ||
get_recipients_for_internal_message: function(ids, context){ | ||
var self = this; | ||
self.result = {}; | ||
self.res_users = {}; |
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.
excessive
var parsed_email = mail.ChatterUtils.parse_email(recipient[1]); | ||
if (_.indexOf(email_addresses, parsed_email[1]) === -1) { | ||
self.recipients.push({ | ||
'checked': (self.internal_users_ids.indexOf( recipient[3][0] ) !== -1), |
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.
you check only the first id from ids, so the rest users might be internal.
}, | ||
get_internal_users_ids: function () { | ||
var ResUser = new instance.web.Model('mail.compose.message'); | ||
this.users_ids = ResUser.call('get_internal_users_ids', [[]]).then( function (users_ids) { |
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.
I think it would be better to keep this deferred variable as local for function than assign for a more global object. Is there any use of that?
10ba230
to
9d2a8da
Compare
4e30200
to
5452873
Compare
…utton "Uncheck all"
5452873
to
1046814
Compare
Internal users are flagged automatically. Added button "Uncheck all"