Browse Source

[REF] Fix lint errors

pull/47/head
x620 8 years ago
parent
commit
c489de9102
  1. 4
      mail_all/README.rst
  2. 2
      mail_check_immediately/__init__.py
  3. 1
      mail_check_immediately/__openerp__.py
  4. 1
      mail_check_immediately/models.py
  5. 10
      mail_check_immediately/static/src/js/main.js
  6. 3
      mail_delete_access_link/__init__.py
  7. 4
      mail_delete_access_link/__openerp__.py
  8. 3
      mail_delete_access_link/mail_delete_access_link.py
  9. 1
      mail_delete_odoo_footer/__openerp__.py
  10. 3
      mail_delete_sent_by_footer/__init__.py
  11. 1
      mail_delete_sent_by_footer/__openerp__.py
  12. 2
      mail_delete_sent_by_footer/mail_delete_sent_by_footer.py
  13. 3
      mail_fix_553/__init__.py
  14. 1
      mail_fix_553/__openerp__.py
  15. 10
      mail_fix_553/mail_fix_553.py
  16. 3
      mail_fix_empty_body/__init__.py
  17. 1
      mail_fix_empty_body/__openerp__.py
  18. 4
      mail_fix_empty_body/models.py
  19. 3
      mail_fix_header_from/__init__.py
  20. 1
      mail_fix_header_from/__openerp__.py
  21. 1
      mail_fix_header_from/models.py
  22. 5
      mail_move_message/__init__.py
  23. 1
      mail_move_message/__openerp__.py
  24. 3
      mail_move_message/controllers/__init__.py
  25. 3
      mail_move_message/controllers/main.py
  26. 3
      mail_move_message/mail_move_message_models.py
  27. 24
      mail_move_message/static/src/js/mail_move_message.js
  28. 3
      mail_outgoing/__init__.py
  29. 1
      mail_outgoing/__openerp__.py
  30. 3
      mail_outgoing/mail_outgoing_models.py
  31. 3
      mail_partner_lang/__init__.py
  32. 1
      mail_partner_lang/__openerp__.py
  33. 4
      mail_partner_lang/models.py
  34. 6
      mail_recovery/README.rst
  35. 6
      mail_recovery/static/src/js/mail_recovery.js
  36. 3
      mail_sent/__init__.py
  37. 1
      mail_sent/__openerp__.py
  38. 2
      mail_sent/models.py
  39. 2
      mail_todo_custom/static/src/js/mail_todo_custom.js
  40. 3
      mail_wall_custom/__init__.py
  41. 1
      mail_wall_custom/__openerp__.py
  42. 6
      mail_wall_custom/models.py
  43. 3
      mail_wall_menu/__init__.py
  44. 1
      mail_wall_menu/__openerp__.py
  45. 1
      mail_wall_menu/models.py
  46. 3
      mail_wall_widgets/__init__.py
  47. 1
      mail_wall_widgets/__openerp__.py
  48. 7
      mail_wall_widgets/models.py
  49. 26
      mail_wall_widgets/static/src/js/main.js
  50. 3
      mass_mailing_extra/__init__.py
  51. 1
      mass_mailing_extra/__openerp__.py
  52. 3
      mass_mailing_extra/models.py
  53. 2
      res_partner_mails_count/__init__.py
  54. 3
      res_partner_mails_count/tests/test_mail.py
  55. 3
      res_partner_mails_count/tests/test_phantom.py
  56. 2
      res_partner_strip_email/__init__.py
  57. 3
      res_partner_strip_email/models.py

4
mail_all/README.rst

@ -9,8 +9,8 @@ Further information
HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_all/ HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_all/
Usage instructions: `<doc/index.rst>`_
Usage instructions: `<doc/index.rst>`__
Changelog: `<doc/changelog.rst>`_
Changelog: `<doc/changelog.rst>`__
Tested on Odoo 8.0 0af32f3f84bae07b11abb8538d02e35c7369a348 Tested on Odoo 8.0 0af32f3f84bae07b11abb8538d02e35c7369a348

2
mail_check_immediately/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models
from . import models

1
mail_check_immediately/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Check mail immediately', 'name': 'Check mail immediately',
'version': '1.0.1', 'version': '1.0.1',

1
mail_check_immediately/models.py

@ -60,7 +60,6 @@ class FetchMailImmediately(models.AbstractModel):
def run_fetchmail_manually(self): def run_fetchmail_manually(self):
fetchmail_task = self.env.ref('fetchmail.ir_cron_mail_gateway_action') fetchmail_task = self.env.ref('fetchmail.ir_cron_mail_gateway_action')
fetchmail_task_id = fetchmail_task.id
fetchmail_model = self.env['fetchmail.server'].sudo() fetchmail_model = self.env['fetchmail.server'].sudo()
fetchmail_task._try_lock() fetchmail_task._try_lock()

10
mail_check_immediately/static/src/js/main.js

@ -10,7 +10,7 @@ openerp.mail_check_immediately = function(instance, local) {
this.imm_model = new instance.web.Model('fetch_mail.imm'); this.imm_model = new instance.web.Model('fetch_mail.imm');
this.events['click a.oe_fetch_new_mails'] = function(){ this.events['click a.oe_fetch_new_mails'] = function(){
_this.run_fetchmail_manually(); _this.run_fetchmail_manually();
}
};
}, },
start: function() { start: function() {
@ -22,7 +22,7 @@ openerp.mail_check_immediately = function(instance, local) {
this.get_last_fetched_time(); this.get_last_fetched_time();
this.get_time_loop = setInterval(function(){ this.get_time_loop = setInterval(function(){
_this.get_last_fetched_time()
_this.get_last_fetched_time();
}, 30000); }, 30000);
}, },
@ -31,8 +31,8 @@ openerp.mail_check_immediately = function(instance, local) {
var _this = this; var _this = this;
this.imm_model.call('run_fetchmail_manually', {context: new instance.web.CompoundContext()}).then(function(){ this.imm_model.call('run_fetchmail_manually', {context: new instance.web.CompoundContext()}).then(function(){
_this.get_last_fetched_time()
})
_this.get_last_fetched_time();
});
}, },
get_last_fetched_time: function(){ get_last_fetched_time: function(){
@ -43,7 +43,7 @@ openerp.mail_check_immediately = function(instance, local) {
value = $.timeago(res); value = $.timeago(res);
value = value || 'undefined'; value = value || 'undefined';
_this.$el.find('span.oe_view_manager_fetch_mail_imm_field').html(value); _this.$el.find('span.oe_view_manager_fetch_mail_imm_field').html(value);
})
});
}, },
destroy: function(){ destroy: function(){

3
mail_delete_access_link/__init__.py

@ -1 +1,2 @@
import mail_delete_access_link
# -*- coding: utf-8 -*-
from . import mail_delete_access_link

4
mail_delete_access_link/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Delete access link in email footer', 'name': 'Delete access link in email footer',
'version': '1.0.0', 'version': '1.0.0',
@ -8,7 +9,6 @@
'price': 9.00, 'price': 9.00,
'currency': 'EUR', 'currency': 'EUR',
'depends': ['mail'], 'depends': ['mail'],
'data':[
],
'data': [],
'installable': True 'installable': True
} }

3
mail_delete_access_link/mail_delete_access_link.py

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv from openerp.osv import osv
from openerp import tools, SUPERUSER_ID
class mail_mail(osv.Model): class mail_mail(osv.Model):
_inherit = 'mail.mail' _inherit = 'mail.mail'

1
mail_delete_odoo_footer/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Delete Odoo footer in email', 'name': 'Delete Odoo footer in email',
'version': '1.0.0', 'version': '1.0.0',

3
mail_delete_sent_by_footer/__init__.py

@ -1 +1,2 @@
import mail_delete_sent_by_footer
# -*- coding: utf-8 -*-
from . import mail_delete_sent_by_footer

1
mail_delete_sent_by_footer/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Delete "Sent by..." footer in email', 'name': 'Delete "Sent by..." footer in email',
'version': '1.0.0', 'version': '1.0.0',

2
mail_delete_sent_by_footer/mail_delete_sent_by_footer.py

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv from openerp.osv import osv
from openerp import tools, SUPERUSER_ID from openerp import tools, SUPERUSER_ID
class mail_notification(osv.Model): class mail_notification(osv.Model):
_inherit = 'mail.notification' _inherit = 'mail.notification'

3
mail_fix_553/__init__.py

@ -1 +1,2 @@
import mail_fix_553
# -*- coding: utf-8 -*-
from . import mail_fix_553

1
mail_fix_553/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
"name": "Fix mail error 553", "name": "Fix mail error 553",
"version": "0.3", "version": "0.3",

10
mail_fix_553/mail_fix_553.py

@ -2,19 +2,18 @@
import base64 import base64
import logging import logging
import re
from email.utils import formataddr from email.utils import formataddr
from urlparse import urljoin
from openerp import api, tools
from openerp import tools
from openerp import SUPERUSER_ID from openerp import SUPERUSER_ID
from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.addons.base.ir.ir_mail_server import MailDeliveryException
from openerp.osv import fields, osv
from openerp.osv import osv
from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools.translate import _ from openerp.tools.translate import _
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
import re
class mail_mail(osv.Model): class mail_mail(osv.Model):
_inherit = "mail.mail" _inherit = "mail.mail"
@ -44,7 +43,6 @@ class mail_mail(osv.Model):
correct_email_from = '@%s>?\s*$' % catchall_domain correct_email_from = '@%s>?\s*$' % catchall_domain
default_email_from = '%s@%s' % (catchall_alias, catchall_domain) default_email_from = '%s@%s' % (catchall_alias, catchall_domain)
context = dict(context or {}) context = dict(context or {})
ir_mail_server = self.pool.get('ir.mail_server') ir_mail_server = self.pool.get('ir.mail_server')
ir_attachment = self.pool['ir.attachment'] ir_attachment = self.pool['ir.attachment']
@ -146,7 +144,7 @@ class mail_mail(osv.Model):
except MemoryError: except MemoryError:
# prevent catching transient MemoryErrors, bubble up to notify user or abort cron job # prevent catching transient MemoryErrors, bubble up to notify user or abort cron job
# instead of marking the mail as failed # instead of marking the mail as failed
_logger.exception('MemoryError while processing mail with ID %r and Msg-Id %r. '\
_logger.exception('MemoryError while processing mail with ID %r and Msg-Id %r. '
'Consider raising the --limit-memory-hard startup option', 'Consider raising the --limit-memory-hard startup option',
mail.id, mail.message_id) mail.id, mail.message_id)
raise raise

3
mail_fix_empty_body/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_fix_empty_body/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Fix "False" in empty email body', 'name': 'Fix "False" in empty email body',
'version': '1.0.0', 'version': '1.0.0',

4
mail_fix_empty_body/models.py

@ -1,4 +1,6 @@
from openerp import api, models, fields, SUPERUSER_ID
# -*- coding: utf-8 -*-
from openerp import models
class mail_compose_message(models.TransientModel): class mail_compose_message(models.TransientModel):
_inherit = 'mail.compose.message' _inherit = 'mail.compose.message'

3
mail_fix_header_from/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_fix_header_from/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
"name": "Fix non-ascii header 'from' (OBSOLETE)", "name": "Fix non-ascii header 'from' (OBSOLETE)",
"version": "0.3", "version": "0.3",

1
mail_fix_header_from/models.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import re import re
from openerp.addons.base.ir import ir_mail_server from openerp.addons.base.ir import ir_mail_server

5
mail_move_message/__init__.py

@ -1,2 +1,3 @@
import controllers
import mail_move_message_models
# -*- coding: utf-8 -*-
from . import controllers
from . import mail_move_message_models

1
mail_move_message/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Mail relocation', 'name': 'Mail relocation',
'version': '1.0.4', 'version': '1.0.4',

3
mail_move_message/controllers/__init__.py

@ -1 +1,2 @@
import main
# -*- coding: utf-8 -*-
from . import main

3
mail_move_message/controllers/main.py

@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
from openerp.addons.web.controllers.main import DataSet from openerp.addons.web.controllers.main import DataSet
from openerp.tools.translate import _ from openerp.tools.translate import _
from openerp import http from openerp import http
from openerp.http import request from openerp.http import request
class DataSetCustom(DataSet): class DataSetCustom(DataSet):
def _extend_name(self, model, records): def _extend_name(self, model, records):
@ -26,7 +28,6 @@ class DataSetCustom(DataSet):
res.append((r[0], _('%s ID %s') % (r[1], r[0]))) res.append((r[0], _('%s ID %s') % (r[1], r[0])))
return res return res
@http.route('/web/dataset/call_kw/<model>/name_search', type='json', auth="user") @http.route('/web/dataset/call_kw/<model>/name_search', type='json', auth="user")
def name_search(self, model, method, args, kwargs): def name_search(self, model, method, args, kwargs):
context = kwargs.get('context') context = kwargs.get('context')

3
mail_move_message/mail_move_message_models.py

@ -1,8 +1,9 @@
from lxml import etree
# -*- coding: utf-8 -*-
from openerp import api, models, fields, SUPERUSER_ID from openerp import api, models, fields, SUPERUSER_ID
from openerp.tools import email_split from openerp.tools import email_split
from openerp.tools.translate import _ from openerp.tools.translate import _
class wizard(models.TransientModel): class wizard(models.TransientModel):
_name = 'mail_move_message.wizard' _name = 'mail_move_message.wizard'

24
mail_move_message/static/src/js/mail_move_message.js

@ -7,13 +7,13 @@ openerp.mail_move_message = function (session) {
mail.ThreadMessage.include({ mail.ThreadMessage.include({
bind_events: function(){ bind_events: function(){
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.$('.oe_move').on('click', this.on_move_message)
this.$('.oe_move').on('click', this.on_move_message);
}, },
on_move_message: function(event){ on_move_message: function(event){
var self = this; var self = this;
var context = { var context = {
'default_message_id': this.id 'default_message_id': this.id
}
};
var action = { var action = {
name: _t('Relocate Message'), name: _t('Relocate Message'),
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
@ -31,26 +31,26 @@ openerp.mail_move_message = function (session) {
} }
}); });
} }
})
});
mail.MessageCommon.include({ mail.MessageCommon.include({
init: function (parent, datasets, options) { init: function (parent, datasets, options) {
this._super(parent, datasets, options); this._super(parent, datasets, options);
this.is_moved = datasets.is_moved || false; this.is_moved = datasets.is_moved || false;
} }
})
});
session.web.form.WidgetButton.include({ session.web.form.WidgetButton.include({
on_click: function() { on_click: function() {
if(this.node.attrs.special == 'quick_create'){ if(this.node.attrs.special == 'quick_create'){
var self = this; var self = this;
var related_field = this.field_manager.fields[this.node.attrs['field']];
var related_field = this.field_manager.fields[this.node.attrs.field];
var context_built = $.Deferred(); var context_built = $.Deferred();
if(this.node.attrs.use_for_mail_move_message) { if(this.node.attrs.use_for_mail_move_message) {
var model = new session.web.Model(this.view.dataset.model); var model = new session.web.Model(this.view.dataset.model);
var partner_id = self.field_manager.fields['partner_id'].get_value();
var message_name_from = self.field_manager.fields['message_name_from'].get_value();
var message_email_from = self.field_manager.fields['message_email_from'].get_value();
var partner_id = self.field_manager.fields.partner_id.get_value();
var message_name_from = self.field_manager.fields.message_name_from.get_value();
var message_email_from = self.field_manager.fields.message_email_from.get_value();
context_built = model.call('create_partner', [self.view.dataset.context.default_message_id, context_built = model.call('create_partner', [self.view.dataset.context.default_message_id,
related_field.field.relation, partner_id, message_name_from, message_email_from]); related_field.field.relation, partner_id, message_name_from, message_email_from]);
} }
@ -59,7 +59,7 @@ openerp.mail_move_message = function (session) {
} }
$.when(context_built).pipe(function (context) { $.when(context_built).pipe(function (context) {
if(self.node.attrs.use_for_mail_move_message) { if(self.node.attrs.use_for_mail_move_message) {
self.field_manager.fields['partner_id'].set_value(context['partner_id']);
self.field_manager.fields.partner_id.set_value(context.partner_id);
} }
var pop = new session.web.form.FormOpenPopup(this); var pop = new session.web.form.FormOpenPopup(this);
pop.show_element( pop.show_element(
@ -76,8 +76,8 @@ openerp.mail_move_message = function (session) {
}); });
pop.on('create_completed', self, function(id) { pop.on('create_completed', self, function(id) {
related_field.set_value(id); related_field.set_value(id);
if(self.field_manager.fields['filter_by_partner']) {
self.field_manager.fields['filter_by_partner'].set_value(true);
if(self.field_manager.fields.filter_by_partner) {
self.field_manager.fields.filter_by_partner.set_value(true);
} }
}); });
}); });
@ -88,4 +88,4 @@ openerp.mail_move_message = function (session) {
}, },
}); });
}
};

3
mail_outgoing/__init__.py

@ -1 +1,2 @@
import mail_outgoing_models
# -*- coding: utf-8 -*-
from . import mail_outgoing_models

1
mail_outgoing/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Outgoing mails menu', 'name': 'Outgoing mails menu',
'version': '1.0.0', 'version': '1.0.0',

3
mail_outgoing/mail_outgoing_models.py

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv from openerp.osv import osv
class mail_message(osv.Model): class mail_message(osv.Model):
_inherit = 'mail.message' _inherit = 'mail.message'
@ -13,6 +15,7 @@ class mail_message(osv.Model):
return super(mail_message, self).check_access_rule(cr, uid, ids, operation, context) return super(mail_message, self).check_access_rule(cr, uid, ids, operation, context)
class mail_mail(osv.Model): class mail_mail(osv.Model):
_name = 'mail.mail' _name = 'mail.mail'
_inherit = ['mail.mail', 'ir.needaction_mixin'] _inherit = ['mail.mail', 'ir.needaction_mixin']

3
mail_partner_lang/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_partner_lang/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Use partner language in mail', 'name': 'Use partner language in mail',
'version': '1.0.0', 'version': '1.0.0',

4
mail_partner_lang/models.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp.osv import osv,fields
from openerp import SUPERUSER_ID
from openerp.osv import osv
class mail_thread(osv.Model): class mail_thread(osv.Model):
_inherit = "mail.thread" _inherit = "mail.thread"

6
mail_recovery/README.rst

@ -18,7 +18,7 @@ Contributors
Sponsors Sponsors
-------- --------
* `IT-Projects LLC <https://it-projects.info>`_
* `IT-Projects LLC <https://it-projects.info>`__
Further information Further information
=================== ===================
@ -27,8 +27,8 @@ Demo: http://runbot.it-projects.info/demo/mail-addons/8.0
HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_recovery/ HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_recovery/
Usage instructions: `<doc/index.rst>`_
Usage instructions: `<doc/index.rst>`__
Changelog: `<doc/changelog.rst>`_
Changelog: `<doc/changelog.rst>`__
Tested on Odoo 8.0 17a130428516d9dd8105f90e8c9a65a0b4e8901b Tested on Odoo 8.0 17a130428516d9dd8105f90e8c9a65a0b4e8901b

6
mail_recovery/static/src/js/mail_recovery.js

@ -11,14 +11,14 @@ openerp.mail_recovery = function (session) {
on_focus_textarea: function(event) { on_focus_textarea: function(event) {
var $input = $(event.target); var $input = $(event.target);
if (!$input.val()) { if (!$input.val()) {
$input.val(window.localStorage['message_storage']);
$input.val(window.localStorage.message_storage);
} }
}, },
on_keyup_textarea: function(event) { on_keyup_textarea: function(event) {
window.localStorage['message_storage'] = $(event.target).val();
window.localStorage.message_storage = $(event.target).val();
}, },
on_message_post: function (event) { on_message_post: function (event) {
window.localStorage['message_storage'] = '';
window.localStorage.message_storage = '';
return this._super(event); return this._super(event);
}, },
}); });

3
mail_sent/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_sent/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Sentbox', 'name': 'Sentbox',
'version': '1.0.2', 'version': '1.0.2',

2
mail_sent/models.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from openerp import api, models, fields from openerp import api, models, fields
@ -25,4 +26,3 @@ class mail_compose_message(models.TransientModel):
_inherit = 'mail.compose.message' _inherit = 'mail.compose.message'
sent = fields.Boolean('Sent', help='dummy field to fix inherit error') sent = fields.Boolean('Sent', help='dummy field to fix inherit error')

2
mail_todo_custom/static/src/js/mail_todo_custom.js

@ -41,4 +41,4 @@ openerp.mail_todo_custom = function(session) {
}, },
}); });
}
};

3
mail_wall_custom/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_wall_custom/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Custom mail wall', 'name': 'Custom mail wall',
'version': '1.0.0', 'version': '1.0.0',

6
mail_wall_custom/models.py

@ -1,5 +1,7 @@
from openerp import api,models,fields
from openerp.osv import fields as old_fields
# -*- coding: utf-8 -*-
from openerp import fields
from openerp import models
class hr_employee(models.Model): class hr_employee(models.Model):
_inherit = 'hr.employee' _inherit = 'hr.employee'

3
mail_wall_menu/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_wall_menu/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Menu for widgets at Messaging section', 'name': 'Menu for widgets at Messaging section',
'version': '1.0.0', 'version': '1.0.0',

1
mail_wall_menu/models.py

@ -1 +0,0 @@
from openerp import api,models,fields

3
mail_wall_widgets/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mail_wall_widgets/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Extra Widgets for mail wall', 'name': 'Extra Widgets for mail wall',
'version': '1.0.0', 'version': '1.0.0',

7
mail_wall_widgets/models.py

@ -1,4 +1,5 @@
from openerp.osv import osv,fields as old_fields
# -*- coding: utf-8 -*-
from openerp.osv import fields as old_fields
from openerp import api, models, fields, tools from openerp import api, models, fields, tools
from openerp.tools.safe_eval import safe_eval from openerp.tools.safe_eval import safe_eval
try: try:
@ -15,6 +16,7 @@ from datetime import date, datetime, timedelta
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class mail_wall_widgets_widget(models.Model): class mail_wall_widgets_widget(models.Model):
_name = 'mail.wall.widgets.widget' _name = 'mail.wall.widgets.widget'
_order = "sequence, id" _order = "sequence, id"
@ -95,6 +97,7 @@ Slice - use "domain" for total and "won_domain" for target
if self.agenda: if self.agenda:
today = date.today() today = date.today()
tomorrow = today + timedelta(days=1) tomorrow = today + timedelta(days=1)
def r2date(r): def r2date(r):
d = getattr(r, field_date_name) d = getattr(r, field_date_name)
if d: if d:
@ -225,6 +228,7 @@ Slice - use "domain" for total and "won_domain" for target
res['monetary'] = self.value_field_monetary res['monetary'] = self.value_field_monetary
return res return res
class mail_wall_widgets_cache(models.Model): class mail_wall_widgets_cache(models.Model):
_name = 'mail.wall.widgets.cache' _name = 'mail.wall.widgets.cache'
@ -233,6 +237,7 @@ class mail_wall_widgets_cache(models.Model):
res_model = fields.Integer('Resource Model') res_model = fields.Integer('Resource Model')
user_id = fields.Many2one('res.users') user_id = fields.Many2one('res.users')
class res_users(models.Model): class res_users(models.Model):
_inherit = 'res.users' _inherit = 'res.users'

26
mail_wall_widgets/static/src/js/main.js

@ -8,13 +8,13 @@ openerp.mail_wall_widgets = function(instance) {
var self = this; var self = this;
this._super(parent, action); this._super(parent, action);
this.deferred = $.Deferred(); this.deferred = $.Deferred();
self.money_df = $.Deferred()
self.money_df = $.Deferred();
self.money_df.resolve(); self.money_df.resolve();
self.money_cache = {}
self.money_cache = {};
//$(document).off('keydown.klistener'); //$(document).off('keydown.klistener');
this.widget_templates = { this.widget_templates = {
'mail.wall.widgets.widget': "mail_wall_widgets.Widget" 'mail.wall.widgets.widget': "mail_wall_widgets.Widget"
}
};
}, },
events: { events: {
'click .oe_open_record': function(event){ 'click .oe_open_record': function(event){
@ -27,7 +27,7 @@ openerp.mail_wall_widgets = function(instance) {
'target': 'current', 'target': 'current',
'views': [[false, 'form'],[false, 'list']], 'views': [[false, 'form'],[false, 'list']],
'domain': $t.parent().parent().attr('data-domain'), 'domain': $t.parent().parent().attr('data-domain'),
})
});
}, },
'click .oe_open_record_list': function(event){ 'click .oe_open_record_list': function(event){
var $t = $(event.currentTarget); var $t = $(event.currentTarget);
@ -38,7 +38,7 @@ openerp.mail_wall_widgets = function(instance) {
'target': 'current', 'target': 'current',
'views': [[false, 'list'],[false, 'form']], 'views': [[false, 'list'],[false, 'form']],
'domain': $t.parent().attr('data-domain'), 'domain': $t.parent().attr('data-domain'),
})
});
}, },
'click .oe_open_record_list_funnel': function(event){ 'click .oe_open_record_list_funnel': function(event){
var $t = $(event.currentTarget); var $t = $(event.currentTarget);
@ -49,7 +49,7 @@ openerp.mail_wall_widgets = function(instance) {
'target': 'current', 'target': 'current',
'views': [[false, 'list'],[false, 'form']], 'views': [[false, 'list'],[false, 'form']],
'domain': $t.attr('data-domain'), 'domain': $t.attr('data-domain'),
})
});
}, },
}, },
start: function() { start: function() {
@ -97,18 +97,18 @@ openerp.mail_wall_widgets = function(instance) {
self.money_df = self.money_df =
self.money_df.then(function(){ self.money_df.then(function(){
var callback = function(){ var callback = function(){
money_field.set({'currency_info': self.money_cache[currency_id]})
}
money_field.set({'currency_info': self.money_cache[currency_id]});
};
if (self.money_cache[currency_id]){ if (self.money_cache[currency_id]){
callback(); callback();
return; return;
} }
var req = new instance.web.Model("res.currency").query(["symbol", "position"]).filter([["id", "=", currency_id]]).first()
var req = new instance.web.Model("res.currency").query(["symbol", "position"]).filter([["id", "=", currency_id]]).first();
return req.then(function(res){ return req.then(function(res){
self.money_cache[currency_id] = res; self.money_cache[currency_id] = res;
callback(); callback();
})
})
});
});
}); });
}, },
render_float_fields: function(item) { render_float_fields: function(item) {
@ -123,8 +123,8 @@ openerp.mail_wall_widgets = function(instance) {
if (precision && precision<1) if (precision && precision<1)
digits[1] = ($(this).attr('data-precision') || '0.01').slice(2).indexOf('1')+1; digits[1] = ($(this).attr('data-precision') || '0.01').slice(2).indexOf('1')+1;
value = instance.web.format_value(parseFloat(value), {type: "float", digits: digits}, '')
$(this).text(value)
value = instance.web.format_value(parseFloat(value), {type: "float", digits: digits}, '');
$(this).text(value);
}); });
}, },
render_user_avatars: function(item) { render_user_avatars: function(item) {

3
mass_mailing_extra/__init__.py

@ -1 +1,2 @@
import models
# -*- coding: utf-8 -*-
from . import models

1
mass_mailing_extra/__openerp__.py

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
{ {
'name': 'Improvements for mass mailing', 'name': 'Improvements for mass mailing',
'version': '1.0.0', 'version': '1.0.0',

3
mass_mailing_extra/models.py

@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
from openerp import api, models, fields from openerp import api, models, fields
class MailMailStats(models.Model): class MailMailStats(models.Model):
_inherit = 'mail.mail.statistics' _inherit = 'mail.mail.statistics'
@ -24,5 +26,4 @@ class MailMailStats(models.Model):
res[self.partner_id.id] = self.partner_id res[self.partner_id.id] = self.partner_id
self.partners = ', '.join([('%s <%s>' % (p.name, p.email)) for id, p in res.items()]) self.partners = ', '.join([('%s <%s>' % (p.name, p.email)) for id, p in res.items()])
partners = fields.Char('Partners', compute=_get_partners) partners = fields.Char('Partners', compute=_get_partners)

2
res_partner_mails_count/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models
from . import models

3
res_partner_mails_count/tests/test_mail.py

@ -3,8 +3,9 @@
from openerp.tests.common import TransactionCase from openerp.tests.common import TransactionCase
class test_message_count(TransactionCase):
class TestMessageCount(TransactionCase):
post_install = True post_install = True
def test_count(self): def test_count(self):
new_partner1 = self.env['res.partner'].sudo().create({'name': 'rpmc Test Partner one', 'email': 'tt@tt', 'notify_email': 'always'}) new_partner1 = self.env['res.partner'].sudo().create({'name': 'rpmc Test Partner one', 'email': 'tt@tt', 'notify_email': 'always'})
new_partner2 = self.env['res.partner'].sudo().create({'name': 'rpmc Test Partner two', 'email': 'rr@rr', 'notify_email': 'always'}) new_partner2 = self.env['res.partner'].sudo().create({'name': 'rpmc Test Partner two', 'email': 'rr@rr', 'notify_email': 'always'})

3
res_partner_mails_count/tests/test_phantom.py

@ -1,8 +1,11 @@
# -*- coding: utf-8 -*-
import openerp.tests import openerp.tests
@openerp.tests.common.at_install(False) @openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True) @openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase): class TestUi(openerp.tests.HttpCase):
def test_01_res_partner_mails_to_count(self): def test_01_res_partner_mails_to_count(self):
self.phantom_js('/', "openerp.Tour.run('mails_count_tour', 'test')", "openerp.Tour.tours.mails_count_tour", login="admin") self.phantom_js('/', "openerp.Tour.run('mails_count_tour', 'test')", "openerp.Tour.tours.mails_count_tour", login="admin")

2
res_partner_strip_email/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models
from . import models

3
res_partner_strip_email/models.py

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import models, fields, api
from openerp import api
from openerp import models
class res_partner_strip_email(models.Model): class res_partner_strip_email(models.Model):

Loading…
Cancel
Save