Skip to content
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

Merged

Conversation

Ommo73
Copy link

@Ommo73 Ommo73 commented Mar 21, 2019

Internal users are flagged automatically. Added button "Uncheck all"

Copy link
Collaborator

@yelizariev yelizariev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`1.0.1`
-------

- Internal users are flagged automatically. Added button "Uncheck all".
Copy link
Collaborator

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

Copy link
Collaborator

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

@@ -1,6 +1,11 @@
Updates
=======
Copy link
Collaborator

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

@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from 2d8775a to e8e543d Compare March 22, 2019 10:32
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/tests/test_js.py Outdated Show resolved Hide resolved
mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
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;
Copy link

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

@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from df060be to 0df6766 Compare March 28, 2019 12:04
@Ommo73 Ommo73 changed the title ⚡8️⃣ mail_private New: internal users are flagged automatically ⚡ mail_private New: internal users are flagged automatically Apr 4, 2019
@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch 3 times, most recently from 11a6954 to a2f8f33 Compare April 10, 2019 14:01
Copy link

@KolushovAlexandr KolushovAlexandr left a 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;
}

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
=======
Copy link

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
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parsing error: Unexpected token <<

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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

}
private = fields.boolean('Send Internal Message')

def get_internal_users_ids(self, cr, uid, context=None ):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace before ')'


from openerp.osv import osv, fields

import wdb
Copy link

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
Copy link

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;
Copy link

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
Copy link

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')) {
Copy link

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)) {
Copy link

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),
Copy link

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) {
Copy link

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

mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from 74bd3b7 to 252cc82 Compare April 17, 2019 10:52
@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from bf7187e to 10ba230 Compare April 26, 2019 12:47
Copy link

@KolushovAlexandr KolushovAlexandr left a 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 = {};

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),

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) {

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?

@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from 10ba230 to 9d2a8da Compare May 14, 2019 11:51
mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
mail_private/static/src/js/mail_private.js Outdated Show resolved Hide resolved
@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch 2 times, most recently from 4e30200 to 5452873 Compare May 14, 2019 12:49
@Ommo73 Ommo73 force-pushed the 8.0-mail_private_check_internal_users branch from 5452873 to 1046814 Compare May 15, 2019 09:49
@yelizariev yelizariev merged commit bb296f0 into itpp-labs:8.0 May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants