Browse Source

Merge pull request #49 from yelizariev/9.0-merge-91b95cd

9.0 merge 91b95cd
pull/55/head
Ivan Yelizariev 8 years ago
committed by GitHub
parent
commit
c87c7bbeb4
  1. 34
      .travis.yml
  2. 4
      mail_all/README.rst
  3. 2
      mail_all/__init__.py
  4. 2
      mail_all/tests/__init__.py
  5. 2
      mail_all/tests/test_js.py
  6. 2
      mail_all/views/templates.xml
  7. 2
      mail_archives/tests/__init__.py
  8. 2
      mail_archives/tests/test_js.py
  9. 2
      mail_check_immediately/__init__.py
  10. 13
      mail_check_immediately/__openerp__.py
  11. 1
      mail_check_immediately/models.py
  12. 10
      mail_check_immediately/static/src/js/main.js
  13. 15
      mail_delete_odoo_footer/__openerp__.py
  14. 3
      mail_fix_553/__init__.py
  15. 11
      mail_fix_553/__openerp__.py
  16. 25
      mail_fix_553/mail_fix_553.py
  17. 3
      mail_fix_empty_body/__init__.py
  18. 15
      mail_fix_empty_body/__openerp__.py
  19. 5
      mail_fix_empty_body/models.py
  20. 3
      mail_fix_header_from/__init__.py
  21. 11
      mail_fix_header_from/__openerp__.py
  22. 1
      mail_fix_header_from/models.py
  23. 5
      mail_move_message/__init__.py
  24. 17
      mail_move_message/__openerp__.py
  25. 3
      mail_move_message/controllers/__init__.py
  26. 6
      mail_move_message/controllers/main.py
  27. 33
      mail_move_message/mail_move_message_models.py
  28. 8
      mail_move_message/static/src/js/mail_move_message.js
  29. 3
      mail_outgoing/__init__.py
  30. 15
      mail_outgoing/__openerp__.py
  31. 5
      mail_outgoing/mail_outgoing_models.py
  32. 8
      mail_outgoing/mail_outgoing_views.xml
  33. 14
      mail_outgoing/security/mail_outgoing.xml
  34. 3
      mail_partner_lang/__init__.py
  35. 13
      mail_partner_lang/__openerp__.py
  36. 13
      mail_partner_lang/models.py
  37. 6
      mail_recovery/README.rst
  38. 2
      mail_recovery/__openerp__.py
  39. 6
      mail_recovery/static/src/js/mail_recovery.js
  40. 3
      mail_sent/__init__.py
  41. 6
      mail_sent/models.py
  42. 2
      mail_sent/tests/__init__.py
  43. 2
      mail_sent/tests/test_js.py
  44. 2
      mail_todo_custom/static/src/js/mail_todo_custom.js
  45. 1
      mailgun/models.py
  46. 3
      mass_mailing_extra/__init__.py
  47. 15
      mass_mailing_extra/__openerp__.py
  48. 9
      mass_mailing_extra/models.py
  49. 42
      mass_mailing_extra/views.xml
  50. 4
      oca_dependencies.txt
  51. 2
      res_partner_mails_count/__init__.py
  52. 5
      res_partner_mails_count/tests/test_mail.py
  53. 5
      res_partner_mails_count/tests/test_phantom.py
  54. 2
      res_partner_strip_email/__init__.py
  55. 3
      res_partner_strip_email/models.py

34
.travis.yml

@ -0,0 +1,34 @@
language: python
python:
- "2.7"
sudo: false
cache: pip
addons:
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
env:
- VERSION="9.0" LINT_CHECK="1"
- VERSION="9.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0"
- VERSION="9.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0"
- VERSION="9.0" UNIT_TEST="1" LINT_CHECK="0"
virtualenv:
system_site_packages: true
install:
- pip install anybox.testing.openerp
- git clone https://github.com/it-projects-llc/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
script:
- travis_run_tests
after_success:
coveralls

4
mail_all/README.rst

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

2
mail_all/__init__.py

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

2
mail_all/tests/__init__.py

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import test_js
import test_js

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_all/views/templates.xml

@ -9,4 +9,4 @@
</xpath> </xpath>
</template> </template>
</data> </data>
</openerp>
</openerp>

2
mail_archives/tests/__init__.py

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import test_js
import test_js

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 = """

2
mail_check_immediately/__init__.py

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

13
mail_check_immediately/__openerp__.py

@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Check mail immediately',
'version' : '1.0.1',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Check mail immediately',
'version': '1.0.1',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://twitter.com/yelizariev',
'website': 'https://twitter.com/yelizariev',
'price': 9.00, 'price': 9.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['base', 'web', 'fetchmail', 'mail'],
'depends': ['base', 'web', 'fetchmail', 'mail'],
'data': [ 'data': [
'views.xml', 'views.xml',
],
],
'qweb': [ 'qweb': [
"static/src/xml/main.xml", "static/src/xml/main.xml",
], ],

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

15
mail_delete_odoo_footer/__openerp__.py

@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Delete Odoo footer in email (TODO)',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Delete Odoo footer in email (TODO)',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://yelizariev.github.io',
'depends' : [],
'data':[
],
'website': 'https://yelizariev.github.io',
'depends': [],
'data': [
],
'installable': False 'installable': False
} }

3
mail_fix_553/__init__.py

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

11
mail_fix_553/__openerp__.py

@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
{ {
"name" : "Fix mail error 553",
"version" : "0.3",
"author" : "IT-Projects LLC, Ivan Yelizariev",
"name": "Fix mail error 553",
"version": "0.3",
"author": "IT-Projects LLC, Ivan Yelizariev",
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
"website" : "https://yelizariev.github.io",
"depends" : ["base", "mail"],
"website": "https://yelizariev.github.io",
"depends": ["base", "mail"],
"data": ["data.xml"], "data": ["data.xml"],
'installable': False 'installable': False
} }

25
mail_fix_553/mail_fix_553.py

@ -2,19 +2,19 @@
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"
@ -41,10 +41,9 @@ class mail_mail(osv.Model):
catchall_alias_name = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.name_alias_from", context=context) catchall_alias_name = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.name_alias_from", context=context)
catchall_domain = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.domain", context=context) catchall_domain = self.pool['ir.config_parameter'].get_param(cr, uid, "mail.catchall.domain", context=context)
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']
@ -64,8 +63,8 @@ class mail_mail(osv.Model):
# soft/hard mem limits with temporary data. # soft/hard mem limits with temporary data.
attachment_ids = [a.id for a in mail.attachment_ids] attachment_ids = [a.id for a in mail.attachment_ids]
attachments = [(a['datas_fname'], base64.b64decode(a['datas'])) attachments = [(a['datas_fname'], base64.b64decode(a['datas']))
for a in ir_attachment.read(cr, SUPERUSER_ID, attachment_ids,
['datas_fname', 'datas'])]
for a in ir_attachment.read(cr, SUPERUSER_ID, attachment_ids,
['datas_fname', 'datas'])]
# specific behavior to customize the send email for notified partners # specific behavior to customize the send email for notified partners
email_list = [] email_list = []
@ -106,7 +105,7 @@ class mail_mail(osv.Model):
email_from = formataddr((catchall_alias_name, email_from)) email_from = formataddr((catchall_alias_name, email_from))
msg = ir_mail_server.build_email( msg = ir_mail_server.build_email(
email_from=email_from, # NEW STUFF
email_from=email_from, # NEW STUFF
email_to=email.get('email_to'), email_to=email.get('email_to'),
subject=email.get('subject'), subject=email.get('subject'),
body=email.get('body'), body=email.get('body'),
@ -122,8 +121,8 @@ class mail_mail(osv.Model):
headers=headers) headers=headers)
try: try:
res = ir_mail_server.send_email(cr, uid, msg, res = ir_mail_server.send_email(cr, uid, msg,
mail_server_id=mail.mail_server_id.id,
context=context)
mail_server_id=mail.mail_server_id.id,
context=context)
except AssertionError as error: except AssertionError as error:
if error.message == ir_mail_server.NO_VALID_RECIPIENT: if error.message == ir_mail_server.NO_VALID_RECIPIENT:
# No valid recipient found for this particular # No valid recipient found for this particular
@ -146,8 +145,8 @@ 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. '\
'Consider raising the --limit-memory-hard startup option',
_logger.exception('MemoryError while processing mail with ID %r and Msg-Id %r. '
'Consider raising the --limit-memory-hard startup option',
mail.id, mail.message_id) mail.id, mail.message_id)
raise raise
except Exception as e: except Exception as e:

3
mail_fix_empty_body/__init__.py

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

15
mail_fix_empty_body/__openerp__.py

@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Fix "False" in empty email body',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Fix "False" in empty email body',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://twitter.com/yelizariev',
'website': 'https://twitter.com/yelizariev',
'price': 9.00, 'price': 9.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['mail'],
'data':[
],
'depends': ['mail'],
'data': [
],
'installable': False 'installable': False
} }

5
mail_fix_empty_body/models.py

@ -1,4 +1,7 @@
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

11
mail_fix_header_from/__openerp__.py

@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
{ {
"name" : "Fix non-ascii header 'from' (OBSOLETE)",
"version" : "0.3",
"author" : "IT-Projects LLC, Ivan Yelizariev",
"name": "Fix non-ascii header 'from' (OBSOLETE)",
"version": "0.3",
"author": "IT-Projects LLC, Ivan Yelizariev",
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
"website" : "https://yelizariev.github.io",
"website": "https://yelizariev.github.io",
"description": """ "description": """
Obsolete in odoo 8.0 since Sep 10, 2014 https://github.com/odoo/odoo/commit/f2cf6ced17d3477b8858e3a8f955a42cc8a629ff . You can install this module, if you use older version. Obsolete in odoo 8.0 since Sep 10, 2014 https://github.com/odoo/odoo/commit/f2cf6ced17d3477b8858e3a8f955a42cc8a629ff . You can install this module, if you use older version.
""", """,
"depends" : ["base"],
"depends": ["base"],
#"init_xml" : [], #"init_xml" : [],
#"update_xml" : [], #"update_xml" : [],
#"active": True, #"active": True,

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

17
mail_move_message/__openerp__.py

@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Mail relocation',
'version' : '1.0.4',
'author' : 'IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko',
'name': 'Mail relocation',
'version': '1.0.4',
'author': 'IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko',
'license': 'LGPL-3', 'license': 'LGPL-3',
'category' : 'Discuss',
'website' : 'https://twitter.com/yelizariev',
'category': 'Discuss',
'website': 'https://twitter.com/yelizariev',
'price': 100.00, 'price': 100.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['mail_all', 'web_polymorphic_field'],
'depends': ['mail_all', 'web_polymorphic_field'],
'images': ['images/inbox.png'], 'images': ['images/inbox.png'],
'data':[
'data': [
'mail_move_message_views.xml', 'mail_move_message_views.xml',
'data/mail_move_message_data.xml', 'data/mail_move_message_data.xml',
],
],
'qweb': [ 'qweb': [
'static/src/xml/mail_move_message_main.xml', 'static/src/xml/mail_move_message_main.xml',
], ],

3
mail_move_message/controllers/__init__.py

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

6
mail_move_message/controllers/main.py

@ -1,3 +1,4 @@
# -*- 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
@ -9,6 +10,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
@ -17,6 +19,7 @@ class MailChatController(openerp.addons.bus.controllers.main.BusController):
return super(MailChatController, self)._poll(dbname, channels, last, options) return super(MailChatController, self)._poll(dbname, channels, last, options)
class DataSetCustom(DataSet): class DataSetCustom(DataSet):
def _extend_name(self, model, records): def _extend_name(self, model, records):
@ -40,12 +43,11 @@ 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')
if context and context.get('extended_name_with_contact'): if context and context.get('extended_name_with_contact'):
#add order by ID desc
# add order by ID desc
cr, uid = request.cr, request.uid cr, uid = request.cr, request.uid
Model = request.registry[model] Model = request.registry[model]
search_args = list(kwargs.get('args') or []) search_args = list(kwargs.get('args') or [])

33
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'
@ -34,7 +35,7 @@ class wizard(models.TransientModel):
if 'message_id' in res: if 'message_id' in res:
message = self.env['mail.message'].browse(res['message_id']) message = self.env['mail.message'].browse(res['message_id'])
email_from = message.email_from email_from = message.email_from
parts = email_split(email_from.replace(' ',','))
parts = email_split(email_from.replace(' ', ','))
if parts: if parts:
email = parts[0] email = parts[0]
name = email_from.find(email) != -1 and email_from[:email_from.index(email)].replace('"', '').replace('<', '').strip() or email_from name = email_from.find(email) != -1 and email_from[:email_from.index(email)].replace('"', '').replace('<', '').strip() or email_from
@ -51,7 +52,7 @@ class wizard(models.TransientModel):
res['res_id'] = res_id and res_id[0].id res['res_id'] = res_id and res_id[0].id
config_parameters = self.env['ir.config_parameter'] config_parameters = self.env['ir.config_parameter']
res['move_followers'] = config_parameters.get_param('mail_relocation_move_followers')
res['move_followers'] = config_parameters.get_param('mail_relocation_move_followers')
res['uid'] = self.env.uid res['uid'] = self.env.uid
@ -102,8 +103,8 @@ class wizard(models.TransientModel):
def update_move_back(self): def update_move_back(self):
model = self.message_id.moved_from_model model = self.message_id.moved_from_model
self.move_back = self.parent_id == self.message_id.moved_from_parent_id \ self.move_back = self.parent_id == self.message_id.moved_from_parent_id \
and self.res_id == self.message_id.moved_from_res_id \
and (self.model == model or (not self.model and not model))
and self.res_id == self.message_id.moved_from_res_id \
and (self.model == model or (not self.model and not model))
@api.onchange('parent_id') @api.onchange('parent_id')
def on_change_parent_id(self): def on_change_parent_id(self):
@ -140,7 +141,7 @@ class wizard(models.TransientModel):
operation = 'write' operation = 'write'
context = self._context context = self._context
if not ( self.model and self.res_id ):
if not (self.model and self.res_id):
return True return True
model_obj = self.pool[self.model] model_obj = self.pool[self.model]
mids = model_obj.exists(cr, uid, [self.res_id]) mids = model_obj.exists(cr, uid, [self.res_id])
@ -169,9 +170,9 @@ class wizard(models.TransientModel):
for r in self: for r in self:
r.check_access() r.check_access()
if not r.parent_id or not (r.parent_id.model == r.model and if not r.parent_id or not (r.parent_id.model == r.model and
r.parent_id.res_id == r.res_id):
#link with the first message of record
parent = self.env['mail.message'].search([('model','=',r.model), ('res_id','=',r.res_id)], order='id', limit=1)
r.parent_id.res_id == r.res_id):
# link with the first message of record
parent = self.env['mail.message'].search([('model', '=', r.model), ('res_id', '=', r.res_id)], order='id', limit=1)
r.parent_id = parent.id or None r.parent_id = parent.id or None
r.message_id.move(r.parent_id.id, r.res_id, r.model, r.move_back, r.move_followers) r.message_id.move(r.parent_id.id, r.res_id, r.model, r.move_back, r.move_followers)
@ -265,7 +266,7 @@ class mail_message(models.Model):
fol_obj = self.env['mail.followers'] fol_obj = self.env['mail.followers']
for message in self: for message in self:
followers = fol_obj.sudo().search([('res_model', '=', message.model), followers = fol_obj.sudo().search([('res_model', '=', message.model),
('res_id', '=', message.res_id)])
('res_id', '=', message.res_id)])
for f in followers: for f in followers:
self.env[model].browse(ids).message_subscribe([f.partner_id.id], [s.id for s in f.subtype_ids]) self.env[model].browse(ids).message_subscribe([f.partner_id.id], [s.id for s in f.subtype_ids])
@ -333,7 +334,7 @@ class mail_message(models.Model):
return [] return []
if isinstance(ids, (long, int)): if isinstance(ids, (long, int)):
ids = [ids] ids = [ids]
reads = self.read(cr, uid, ids, ['record_name','model', 'res_id'], context=context)
reads = self.read(cr, uid, ids, ['record_name', 'model', 'res_id'], context=context)
res = [] res = []
for record in reads: for record in reads:
name = record['record_name'] or '' name = record['record_name'] or ''
@ -400,11 +401,11 @@ class res_partner(models.Model):
email_address = (vals['email'].replace('\\', '\\\\').replace('%', '\\%').replace('_', '\\_')) email_address = (vals['email'].replace('\\', '\\\\').replace('%', '\\%').replace('_', '\\_'))
email_brackets = "<%s>" % email_address email_brackets = "<%s>" % email_address
messages = mail_message_obj.search([ messages = mail_message_obj.search([
'|',
('email_from', '=ilike', email_address),
('email_from', 'ilike', email_brackets),
('author_id', '=', False)
])
'|',
('email_from', '=ilike', email_address),
('email_from', 'ilike', email_brackets),
('author_id', '=', False)
])
if messages: if messages:
messages.sudo().write({'author_id': res.id}) messages.sudo().write({'author_id': res.id})
return res return res

8
mail_move_message/static/src/js/mail_move_message.js

@ -96,7 +96,7 @@ odoo.define('mail_move_message.relocate', function (require) {
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 Model(this.view.dataset.model); var model = new Model(this.view.dataset.model);
@ -116,7 +116,7 @@ odoo.define('mail_move_message.relocate', function (require) {
} }
$.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 dialog = new form_common.FormViewDialog(self, { var dialog = new form_common.FormViewDialog(self, {
res_model: related_field.field.relation, res_model: related_field.field.relation,
@ -130,8 +130,8 @@ odoo.define('mail_move_message.relocate', function (require) {
}); });
dialog.on('create_completed', self, function(id) { dialog.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);
} }
}); });
}); });

3
mail_outgoing/__init__.py

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

15
mail_outgoing/__openerp__.py

@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Outgoing mails menu',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Outgoing mails menu',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://yelizariev.github.io',
'website': 'https://yelizariev.github.io',
'description': """ 'description': """
Allows to check outgoing mails, i.e. failed or delayed. Allows to check outgoing mails, i.e. failed or delayed.
Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d
""", """,
'depends' : ['mail'],
'data':[
'depends': ['mail'],
'data': [
'security/mail_outgoing.xml', 'security/mail_outgoing.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'mail_outgoing_views.xml', 'mail_outgoing_views.xml',
],
],
'installable': False 'installable': False
} }

5
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,10 +15,11 @@ 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']
_needaction = True _needaction = True
def _needaction_domain_get(self, cr, uid, context=None): def _needaction_domain_get(self, cr, uid, context=None):
return [('state','in', ['outgoing', 'exception'])]
return [('state', 'in', ['outgoing', 'exception'])]

8
mail_outgoing/mail_outgoing_views.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<record id="action_mail_outgoing" model="ir.actions.act_window"> <record id="action_mail_outgoing" model="ir.actions.act_window">
<field name="name">Outgoing</field> <field name="name">Outgoing</field>
<field name="res_model">mail.mail</field> <field name="res_model">mail.mail</field>
@ -10,8 +10,8 @@
<field name="context">{}</field> <field name="context">{}</field>
<field name="search_view_id" ref="mail.view_mail_search"/> <field name="search_view_id" ref="mail.view_mail_search"/>
<field name="help" type="html"> <field name="help" type="html">
<p>
Failed or delayed emails will be shown here. You will be able to retry failed emails and send delayed emails manually.
<p>
Failed or delayed emails will be shown here. You will be able to retry failed emails and send delayed emails manually.
</p> </p>
</field> </field>
</record> </record>
@ -30,5 +30,5 @@
</record> </record>
</data>
</data>
</openerp> </openerp>

14
mail_outgoing/security/mail_outgoing.xml

@ -3,10 +3,10 @@
<data> <data>
<record model="res.groups" id="group_all_emails"> <record model="res.groups" id="group_all_emails">
<field name="name">all_emails</field> <field name="name">all_emails</field>
<field name="comment">Gets access to all emails. For example to check outgoing emails.</field>
</record>
<field name="comment">Gets access to all emails. For example to check outgoing emails.</field>
</record>
<record model="ir.rule" id="rule_mail_mail_user">
<record model="ir.rule" id="rule_mail_mail_user">
<field name="name">mail.mail: user</field> <field name="name">mail.mail: user</field>
<field name="model_id" ref="mail.model_mail_mail"/> <field name="model_id" ref="mail.model_mail_mail"/>
<field name="domain_force">[('author_id', '=', user.partner_id.id)]</field> <field name="domain_force">[('author_id', '=', user.partner_id.id)]</field>
@ -16,9 +16,9 @@
<field name="perm_create" eval="True"/> <field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="False"/> <field name="perm_unlink" eval="False"/>
<field name="global" eval="False"/> <field name="global" eval="False"/>
</record>
</record>
<record model="ir.rule" id="rule_mail_mail_system">
<record model="ir.rule" id="rule_mail_mail_system">
<field name="name">mail.mail: system</field> <field name="name">mail.mail: system</field>
<field name="model_id" ref="mail.model_mail_mail"/> <field name="model_id" ref="mail.model_mail_mail"/>
<field name="domain_force">[(1, '=', 1)]</field> <field name="domain_force">[(1, '=', 1)]</field>
@ -28,6 +28,6 @@
<field name="perm_create" eval="True"/> <field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/> <field name="perm_unlink" eval="True"/>
<field name="global" eval="False"/> <field name="global" eval="False"/>
</record>
</data>
</record>
</data>
</openerp> </openerp>

3
mail_partner_lang/__init__.py

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

13
mail_partner_lang/__openerp__.py

@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Use partner language in mail',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Use partner language in mail',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://yelizariev.github.io',
'website': 'https://yelizariev.github.io',
'depends' : ['mail'],
'data':[],
'depends': ['mail'],
'data': [],
'installable': False, 'installable': False,
} }

13
mail_partner_lang/models.py

@ -1,6 +1,7 @@
# -*- 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"
@ -37,7 +38,7 @@ class mail_thread(osv.Model):
for browse_record in self.browse(cr, uid, ids, context=context): for browse_record in self.browse(cr, uid, ids, context=context):
p = getattr(browse_record, 'partner_id', None) p = getattr(browse_record, 'partner_id', None)
if p: if p:
browse_record._context.update({'lang':p.lang})
browse_record._context.update({'lang': p.lang})
initial = initial_values[browse_record.id] initial = initial_values[browse_record.id]
changes = set() changes = set()
@ -53,12 +54,12 @@ class mail_thread(osv.Model):
if record_value == initial_value and getattr(self._all_columns[col_name].column, 'track_visibility', None) == 'always': if record_value == initial_value and getattr(self._all_columns[col_name].column, 'track_visibility', None) == 'always':
tracked_values[col_name] = dict(col_info=col_info['string'], tracked_values[col_name] = dict(col_info=col_info['string'],
new_value=convert_for_display(record_value, col_info))
new_value=convert_for_display(record_value, col_info))
elif record_value != initial_value and (record_value or initial_value): # because browse null != False elif record_value != initial_value and (record_value or initial_value): # because browse null != False
if getattr(self._all_columns[col_name].column, 'track_visibility', None) in ['always', 'onchange']: if getattr(self._all_columns[col_name].column, 'track_visibility', None) in ['always', 'onchange']:
tracked_values[col_name] = dict(col_info=col_info['string'], tracked_values[col_name] = dict(col_info=col_info['string'],
old_value=convert_for_display(initial_value, col_info),
new_value=convert_for_display(record_value, col_info))
old_value=convert_for_display(initial_value, col_info),
new_value=convert_for_display(record_value, col_info))
if col_name in tracked_fields: if col_name in tracked_fields:
changes.add(col_name) changes.add(col_name)
if not changes: if not changes:

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/9.0
HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_recovery/ HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_recovery/
Usage instructions: `<doc/index.rst>`_
Usage instructions: `<doc/index.rst>`__
Changelog: `<doc/changelog.rst>`_
Changelog: `<doc/changelog.rst>`__
Tested on Odoo 9.0 fd9eb2e4819031c6758c021f4c335b591367632d Tested on Odoo 9.0 fd9eb2e4819031c6758c021f4c335b591367632d

2
mail_recovery/__openerp__.py

@ -12,6 +12,6 @@
'depends': ['mail'], 'depends': ['mail'],
'data': [ 'data': [
'data.xml', 'data.xml',
],
],
"installable": True, "installable": True,
} }

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

@ -10,14 +10,14 @@ odoo.define('mail_recovery', function (require) {
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();
}, },
send_message: function (event) { send_message: function (event) {
window.localStorage['message_storage'] = '';
window.localStorage.message_storage = '';
return this._super(event); return this._super(event);
}, },
}); });

3
mail_sent/__init__.py

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

6
mail_sent/models.py

@ -12,9 +12,9 @@ class MailMessage(models.Model):
def _get_sent(self): def _get_sent(self):
self_sudo = self.sudo() self_sudo = self.sudo()
self_sudo.sent = len(self_sudo.partner_ids) > 1 \ self_sudo.sent = len(self_sudo.partner_ids) > 1 \
or len(self_sudo.partner_ids) == 1 \
and self_sudo.author_id \
and self_sudo.partner_ids[0].id != self_sudo.author_id.id
or len(self_sudo.partner_ids) == 1 \
and self_sudo.author_id \
and self_sudo.partner_ids[0].id != self_sudo.author_id.id
@api.multi @api.multi
def message_format(self): def message_format(self):

2
mail_sent/tests/__init__.py

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import test_js
import test_js

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 = """

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

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

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'

3
mass_mailing_extra/__init__.py

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

15
mass_mailing_extra/__openerp__.py

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Improvements for mass mailing',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Improvements for mass mailing',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3', 'license': 'LGPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://yelizariev.github.io',
'website': 'https://yelizariev.github.io',
'description': """ 'description': """
Modules adds: Modules adds:
@ -13,9 +14,9 @@ Modules adds:
Tested on 8.0 f8d5a6727d3e8d428d9bef93da7ba6b11f344284 Tested on 8.0 f8d5a6727d3e8d428d9bef93da7ba6b11f344284
""", """,
'depends' : ['mass_mailing'],
'data':[
'depends': ['mass_mailing'],
'data': [
'views.xml', 'views.xml',
],
],
'installable': False 'installable': False
} }

9
mass_mailing_extra/models.py

@ -1,4 +1,6 @@
from openerp import api,models,fields
# -*- coding: utf-8 -*-
from openerp import api, models, fields
class MailMailStats(models.Model): class MailMailStats(models.Model):
@ -8,7 +10,7 @@ class MailMailStats(models.Model):
@api.one @api.one
def _get_partner_id(self): def _get_partner_id(self):
if self.model=='res.partner':
if self.model == 'res.partner':
self.partner_id = self.res_id self.partner_id = self.res_id
else: else:
self.partner_id = None self.partner_id = None
@ -22,7 +24,6 @@ class MailMailStats(models.Model):
res[p.id] = p res[p.id] = p
if self.partner_id and self.partner_id.id not in res: if self.partner_id and self.partner_id.id not in res:
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)

42
mass_mailing_extra/views.xml

@ -5,34 +5,34 @@
<record model="ir.ui.view" id="view_mail_mail_statistics_form"> <record model="ir.ui.view" id="view_mail_mail_statistics_form">
<field name="name">mail.mail.statistics.form</field> <field name="name">mail.mail.statistics.form</field>
<field name="model">mail.mail.statistics</field> <field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_form"/>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//form" position="inside">
<notebook>
<page string="Partners">
<group>
<label for="partners" string="Partners (summary)"/>
<field name="partners" readonly="1" nolabel="1"/>
<field name="partner_id" readonly="1"/>
</group>
<label for="partner_ids"/>
<field name="partner_ids" readonly="1"/>
</page>
</notebook>
</xpath>
</field>
</record>
<xpath expr="//form" position="inside">
<notebook>
<page string="Partners">
<group>
<label for="partners" string="Partners (summary)"/>
<field name="partners" readonly="1" nolabel="1"/>
<field name="partner_id" readonly="1"/>
</group>
<label for="partner_ids"/>
<field name="partner_ids" readonly="1"/>
</page>
</notebook>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mail_statistics_tree"> <record model="ir.ui.view" id="view_mail_mail_statistics_tree">
<field name="name">mail.mail.statistics.tree</field> <field name="name">mail.mail.statistics.tree</field>
<field name="model">mail.mail.statistics</field> <field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_tree"/>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='mail_mail_id_int']" position="before">
<field name="partners"/>
</xpath>
<xpath expr="//field[@name='mail_mail_id_int']" position="before">
<field name="partners"/>
</xpath>
</field> </field>
</record> </record>
</data>
</data>
</openerp> </openerp>

4
oca_dependencies.txt

@ -0,0 +1,4 @@
OCA_web https://github.com/OCA/web
access-addons https://github.com/it-projects-llc/access-addons.git
misc-addons https://github.com/it-projects-llc/misc-addons
website-addons https://github.com/it-projects-llc/website-addons

2
res_partner_mails_count/__init__.py

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

5
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'})
@ -30,4 +31,4 @@ class test_message_count(TransactionCase):
self.assertEqual(new_partner1.mails_to, 0) self.assertEqual(new_partner1.mails_to, 0)
self.assertEqual(new_partner1.mails_from, 2, 'rpmc: one message but mails_from != 2') self.assertEqual(new_partner1.mails_from, 2, 'rpmc: one message but mails_from != 2')
self.assertEqual(new_partner2.mails_to, 2, 'rpmc: one message but mails_to != 2') self.assertEqual(new_partner2.mails_to, 2, 'rpmc: one message but mails_to != 2')
self.assertEqual(new_partner2.mails_from, 0)
self.assertEqual(new_partner2.mails_from, 0)

5
res_partner_mails_count/tests/test_phantom.py

@ -1,11 +1,14 @@
# -*- 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")
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")
def test_02_res_partner_mails_from_count(self): def test_02_res_partner_mails_from_count(self):
# wait till page loaded and then click and wait again # wait till page loaded and then click and wait again

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