Browse Source

[REF] fix lint errors (9.0)

pull/49/head
Ivan Yelizariev 8 years ago
parent
commit
d412fa4dd7
  1. 2
      mail_all/tests/test_js.py
  2. 2
      mail_archives/tests/test_js.py
  3. 4
      mail_fix_553/mail_fix_553.py
  4. 1
      mail_fix_empty_body/models.py
  5. 2
      mail_move_message/controllers/main.py
  6. 1
      mail_move_message/mail_move_message_models.py
  7. 2
      mail_outgoing/mail_outgoing_models.py
  8. 1
      mail_partner_lang/models.py
  9. 2
      mail_sent/tests/test_js.py
  10. 1
      mailgun/models.py
  11. 2
      mass_mailing_extra/models.py
  12. 1
      res_partner_mails_count/tests/test_mail.py
  13. 2
      res_partner_mails_count/tests/test_phantom.py

2
mail_all/tests/test_js.py

@ -1,8 +1,10 @@
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_mail_all(self): def test_01_mail_all(self):
# wait till page loaded and then click and wait again # wait till page loaded and then click and wait again
code = """ code = """

2
mail_archives/tests/test_js.py

@ -1,8 +1,10 @@
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_mail_archives(self): def test_01_mail_archives(self):
# wait till page loaded and then click and wait again # wait till page loaded and then click and wait again
code = """ code = """

4
mail_fix_553/mail_fix_553.py

@ -16,6 +16,7 @@ _logger = logging.getLogger(__name__)
import re import re
class mail_mail(osv.Model): class mail_mail(osv.Model):
_inherit = "mail.mail" _inherit = "mail.mail"
@ -44,7 +45,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 +146,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

1
mail_fix_empty_body/models.py

@ -1,5 +1,6 @@
from openerp import api, models, fields, SUPERUSER_ID from openerp import api, models, fields, SUPERUSER_ID
class mail_compose_message(models.TransientModel): class mail_compose_message(models.TransientModel):
_inherit = 'mail.compose.message' _inherit = 'mail.compose.message'

2
mail_move_message/controllers/main.py

@ -9,6 +9,7 @@ class MailChatController(openerp.addons.bus.controllers.main.BusController):
# ----------------------------- # -----------------------------
# Extends BUS Controller Poll # Extends BUS Controller Poll
# ----------------------------- # -----------------------------
def _poll(self, dbname, channels, last, options): def _poll(self, dbname, channels, last, options):
if request.session.uid: if request.session.uid:
registry, cr, uid, context = request.registry, request.cr, request.session.uid, request.context registry, cr, uid, context = request.registry, request.cr, request.session.uid, request.context
@ -40,7 +41,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')

1
mail_move_message/mail_move_message_models.py

@ -3,6 +3,7 @@ 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'

2
mail_outgoing/mail_outgoing_models.py

@ -1,5 +1,6 @@
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 +14,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']

1
mail_partner_lang/models.py

@ -2,6 +2,7 @@
from openerp.osv import osv, fields from openerp.osv import osv, fields
from openerp import SUPERUSER_ID from openerp import SUPERUSER_ID
class mail_thread(osv.Model): class mail_thread(osv.Model):
_inherit = "mail.thread" _inherit = "mail.thread"

2
mail_sent/tests/test_js.py

@ -1,8 +1,10 @@
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_mail_sent(self): def test_01_mail_sent(self):
# wait till page loaded and then click and wait again # wait till page loaded and then click and wait again
code = """ code = """

1
mailgun/models.py

@ -12,6 +12,7 @@ from openerp.addons.mail.models.mail_thread import mail_header_msgid_re
import logging import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
class MailThread(models.AbstractModel): class MailThread(models.AbstractModel):
_inherit = 'mail.thread' _inherit = 'mail.thread'

2
mass_mailing_extra/models.py

@ -1,5 +1,6 @@
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 +25,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)

1
res_partner_mails_count/tests/test_mail.py

@ -5,6 +5,7 @@ from openerp.tests.common import TransactionCase
class test_message_count(TransactionCase): class test_message_count(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'})

2
res_partner_mails_count/tests/test_phantom.py

@ -1,8 +1,10 @@
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")
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('mails_count_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.mails_count_tour", login="admin") self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('mails_count_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.mails_count_tour", login="admin")

Loading…
Cancel
Save