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_all/__init__.py
  3. 2
      mail_all/views/templates.xml
  4. 2
      mail_check_immediately/__init__.py
  5. 13
      mail_check_immediately/__openerp__.py
  6. 1
      mail_check_immediately/models.py
  7. 10
      mail_check_immediately/static/src/js/main.js
  8. 3
      mail_delete_access_link/__init__.py
  9. 14
      mail_delete_access_link/__openerp__.py
  10. 3
      mail_delete_access_link/mail_delete_access_link.py
  11. 15
      mail_delete_odoo_footer/__openerp__.py
  12. 3
      mail_delete_sent_by_footer/__init__.py
  13. 17
      mail_delete_sent_by_footer/__openerp__.py
  14. 2
      mail_delete_sent_by_footer/mail_delete_sent_by_footer.py
  15. 3
      mail_fix_553/__init__.py
  16. 11
      mail_fix_553/__openerp__.py
  17. 24
      mail_fix_553/mail_fix_553.py
  18. 3
      mail_fix_empty_body/__init__.py
  19. 15
      mail_fix_empty_body/__openerp__.py
  20. 4
      mail_fix_empty_body/models.py
  21. 3
      mail_fix_header_from/__init__.py
  22. 17
      mail_fix_header_from/__openerp__.py
  23. 1
      mail_fix_header_from/models.py
  24. 5
      mail_move_message/__init__.py
  25. 15
      mail_move_message/__openerp__.py
  26. 3
      mail_move_message/controllers/__init__.py
  27. 5
      mail_move_message/controllers/main.py
  28. 43
      mail_move_message/mail_move_message_models.py
  29. 24
      mail_move_message/static/src/js/mail_move_message.js
  30. 3
      mail_outgoing/__init__.py
  31. 15
      mail_outgoing/__openerp__.py
  32. 5
      mail_outgoing/mail_outgoing_models.py
  33. 8
      mail_outgoing/mail_outgoing_views.xml
  34. 14
      mail_outgoing/security/mail_outgoing.xml
  35. 3
      mail_partner_lang/__init__.py
  36. 13
      mail_partner_lang/__openerp__.py
  37. 12
      mail_partner_lang/models.py
  38. 6
      mail_recovery/README.rst
  39. 2
      mail_recovery/__openerp__.py
  40. 6
      mail_recovery/static/src/js/mail_recovery.js
  41. 3
      mail_sent/__init__.py
  42. 17
      mail_sent/__openerp__.py
  43. 2
      mail_sent/models.py
  44. 2
      mail_sent/views.xml
  45. 2
      mail_todo_custom/static/src/js/mail_todo_custom.js
  46. 3
      mail_wall_custom/__init__.py
  47. 39
      mail_wall_custom/__openerp__.py
  48. 664
      mail_wall_custom/data.xml
  49. 6
      mail_wall_custom/models.py
  50. 22
      mail_wall_custom/views.xml
  51. 3
      mail_wall_menu/__init__.py
  52. 15
      mail_wall_menu/__openerp__.py
  53. 16
      mail_wall_menu/mail_wall_menu_views.xml
  54. 1
      mail_wall_menu/models.py
  55. 3
      mail_wall_widgets/__init__.py
  56. 19
      mail_wall_widgets/__openerp__.py
  57. 63
      mail_wall_widgets/models.py
  58. 26
      mail_wall_widgets/static/src/js/main.js
  59. 28
      mail_wall_widgets/static/src/xml/main.xml
  60. 44
      mail_wall_widgets/views.xml
  61. 3
      mass_mailing_extra/__init__.py
  62. 15
      mass_mailing_extra/__openerp__.py
  63. 9
      mass_mailing_extra/models.py
  64. 42
      mass_mailing_extra/views.xml
  65. 2
      res_partner_mails_count/__init__.py
  66. 4
      res_partner_mails_count/__openerp__.py
  67. 16
      res_partner_mails_count/static/src/js/main.js
  68. 5
      res_partner_mails_count/tests/test_mail.py
  69. 5
      res_partner_mails_count/tests/test_phantom.py
  70. 2
      res_partner_strip_email/__init__.py
  71. 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_all/__init__.py

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

2
mail_all/views/templates.xml

@ -28,5 +28,5 @@
<field name="action" ref="action_mail_all_feeds"/> <field name="action" ref="action_mail_all_feeds"/>
<field name="parent_id" ref="mail.mail_feeds"/> <field name="parent_id" ref="mail.mail_feeds"/>
</record> </record>
</data>
</data>
</openerp> </openerp>

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': 'GPL-3', 'license': 'GPL-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(){

3
mail_delete_access_link/__init__.py

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

14
mail_delete_access_link/__openerp__.py

@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Delete access link in email footer',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Delete access link in email footer',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-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': 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'

15
mail_delete_odoo_footer/__openerp__.py

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

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

17
mail_delete_sent_by_footer/__openerp__.py

@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Delete "Sent by..." footer in email',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Delete "Sent by..." footer in email',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
'category' : 'Debranding',
'website' : 'https://twitter.com/yelizariev',
'category': 'Debranding',
'website': 'https://twitter.com/yelizariev',
'price': 9.00, 'price': 9.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['mail'],
'data':[
],
'depends': ['mail'],
'data': [
],
'installable': True 'installable': True
} }

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

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': 'GPL-3', 'license': 'GPL-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": True "installable": True
} }

24
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"
@ -41,10 +40,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 +62,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 +104,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 +120,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 +144,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': 'GPL-3', 'license': 'GPL-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': True 'installable': True
} }

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

17
mail_fix_header_from/__openerp__.py

@ -1,16 +1,17 @@
# -*- 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': 'GPL-3', 'license': 'GPL-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"],
#"init_xml" : [],
#"update_xml" : [],
#"active": True,
"depends": ["base"],
# "init_xml" : [],
# "update_xml" : [],
# "active": True,
"installable": True "installable": 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

15
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',
'name': 'Mail relocation',
'version': '1.0.4',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://twitter.com/yelizariev',
'website': 'https://twitter.com/yelizariev',
'price': 100.00, 'price': 100.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['mail', 'web_polymorphic_field'],
'depends': ['mail', '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

5
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,12 +28,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 [])

43
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,20 +170,20 @@ 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)
if not ( r.model and r.res_id ):
if not (r.model and r.res_id):
obj = self.pool.get('ir.model.data').get_object_reference(self._cr, SUPERUSER_ID, 'mail', 'mail_archivesfeeds')[1] obj = self.pool.get('ir.model.data').get_object_reference(self._cr, SUPERUSER_ID, 'mail', 'mail_archivesfeeds')[1]
return { return {
'type' : 'ir.actions.client',
'name' : 'Archive',
'tag' : 'reload',
'params' : {'menu_id': obj},
'type': 'ir.actions.client',
'name': 'Archive',
'tag': 'reload',
'params': {'menu_id': obj},
} }
return { return {
'name': _('Record'), 'name': _('Record'),
@ -260,7 +261,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])
@ -315,7 +316,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 ''
@ -372,11 +373,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

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

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': 'GPL-3', 'license': 'GPL-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': True 'installable': True
} }

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': 'GPL-3', 'license': 'GPL-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,
} }

12
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"
@ -37,7 +37,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 +53,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/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

2
mail_recovery/__openerp__.py

@ -12,5 +12,5 @@
'depends': ['mail'], 'depends': ['mail'],
'data': [ 'data': [
'data.xml', 'data.xml',
],
],
} }

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

17
mail_sent/__openerp__.py

@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Sentbox',
'version' : '1.0.2',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Sentbox',
'version': '1.0.2',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
'category' : 'Discuss',
'website' : 'https://twitter.com/yelizariev',
'category': 'Discuss',
'website': 'https://twitter.com/yelizariev',
'price': 40.00, 'price': 40.00,
'currency': 'EUR', 'currency': 'EUR',
'depends' : ['mail'],
'data':[
'depends': ['mail'],
'data': [
'views.xml', 'views.xml',
],
],
'installable': True 'installable': True
} }

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

@ -34,5 +34,5 @@
<field name="action" ref="action_mail_sent_feeds"/> <field name="action" ref="action_mail_sent_feeds"/>
<field name="parent_id" ref="mail.mail_feeds"/> <field name="parent_id" ref="mail.mail_feeds"/>
</record> </record>
</data>
</data>
</openerp> </openerp>

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

39
mail_wall_custom/__openerp__.py

@ -1,25 +1,26 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Custom mail wall',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Custom mail wall',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
'category' : 'Custom',
'website' : 'https://yelizariev.github.io',
'depends' : ['gamification',
'gamification_extra',
'hr',
'sale',
'sales_team',
'crm',
'calendar',
'project',
'mail_wall_widgets',
'sale_mediation_custom',
'access_custom',
],
'data':[
'category': 'Custom',
'website': 'https://yelizariev.github.io',
'depends': ['gamification',
'gamification_extra',
'hr',
'sale',
'sales_team',
'crm',
'calendar',
'project',
'mail_wall_widgets',
'sale_mediation_custom',
'access_custom',
],
'data': [
'views.xml', 'views.xml',
'data.xml', 'data.xml',
],
],
'installable': True, 'installable': True,
} }

664
mail_wall_custom/data.xml

@ -2,136 +2,136 @@
<openerp> <openerp>
<data> <data>
<record id="goal_average_payment_time" model="gamification.goal.definition"> <record id="goal_average_payment_time" model="gamification.goal.definition">
<field name="name">Average payment time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
<field name="field_date_id" ref="sale.field_sale_order_date_order"/>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id),('state','in', ['done'])]</field>
</record>
<field name="name">Average payment time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
<field name="field_date_id" ref="sale.field_sale_order_date_order"/>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id),('state','in', ['done'])]</field>
</record>
<record id="goal_average_payment_time_all" model="gamification.goal.definition"> <record id="goal_average_payment_time_all" model="gamification.goal.definition">
<field name="name">Average payment time [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
<field name="field_date_id" ref="sale.field_sale_order_date_order"/>
<field name="condition">lower</field>
<field name="domain">[('state','in', ['done'])]</field>
</record>
<field name="name">Average payment time [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
<field name="field_date_id" ref="sale.field_sale_order_date_order"/>
<field name="condition">lower</field>
<field name="domain">[('state','in', ['done'])]</field>
</record>
<record id="goal_average_deal_time" model="gamification.goal.definition"> <record id="goal_average_deal_time" model="gamification.goal.definition">
<field name="name">Average deal time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
<field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
</record>
<field name="name">Average deal time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
<field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
</record>
<record id="goal_average_deal_time_all" model="gamification.goal.definition"> <record id="goal_average_deal_time_all" model="gamification.goal.definition">
<field name="name">Average deal time [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
<field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
<field name="condition">lower</field>
<field name="domain">[('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
</record>
<field name="name">Average deal time [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">avg</field>
<field name="display_mode">progress</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
<field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
<field name="condition">lower</field>
<field name="domain">[('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
</record>
<record id="goal_oldest_lead" model="gamification.goal.definition"> <record id="goal_oldest_lead" model="gamification.goal.definition">
<field name="name">Oldest lead</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', '=', 'lead')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<field name="name">Oldest lead</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', '=', 'lead')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<record id="goal_oldest_lead_all" model="gamification.goal.definition"> <record id="goal_oldest_lead_all" model="gamification.goal.definition">
<field name="name">Oldest lead [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('sales_funnel_type', '=', 'lead')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<field name="name">Oldest lead [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('sales_funnel_type', '=', 'lead')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<record id="goal_oldest_opp" model="gamification.goal.definition"> <record id="goal_oldest_opp" model="gamification.goal.definition">
<field name="name">Oldest Opportunity</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), '|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<field name="name">Oldest Opportunity</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">[('user_id','=', user.id), '|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<record id="goal_oldest_opp_all" model="gamification.goal.definition"> <record id="goal_oldest_opp_all" model="gamification.goal.definition">
<field name="name">Oldest Opportunity [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">['|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<field name="name">Oldest Opportunity [ALL]</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix">days</field>
<field name="computation_mode">max</field>
<field name="display_mode">progress</field>
<field name="condition">lower</field>
<field name="domain">['|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
<record id="goal_personal_comission" model="gamification.goal.definition"> <record id="goal_personal_comission" model="gamification.goal.definition">
<field name="name">Personal comission</field>
<field name="description"></field>
<field name="monetary" eval="True"/>
<field name="computation_mode">python</field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain">[('state','!=','cancel'),('user_id','=',user.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
<field name="model_id" ref="account.model_account_invoice_report"/>
<field name="field_id" ref="account.field_account_invoice_report_price_total"/>
<field name="name">Personal comission</field>
<field name="description"></field>
<field name="monetary" eval="True"/>
<field name="computation_mode">python</field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain">[('state','!=','cancel'),('user_id','=',user.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
<field name="model_id" ref="account.model_account_invoice_report"/>
<field name="field_id" ref="account.field_account_invoice_report_price_total"/>
<field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" /> <field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" />
<field name="compute_code">
<field name="compute_code">
personal_comission = object.user_id.employee_ids and object.user_id.employee_ids[0].personal_comission or 0.0 personal_comission = object.user_id.employee_ids and object.user_id.employee_ids[0].personal_comission or 0.0
result = object.sum * personal_comission / 100.0 result = object.sum * personal_comission / 100.0
</field> </field>
</record>
</record>
<record id="goal_team_bonus" model="gamification.goal.definition"> <record id="goal_team_bonus" model="gamification.goal.definition">
<field name="name">Team bonus</field>
<field name="description">Monthly team bonus</field>
<field name="monetary" eval="True"/>
<field name="computation_mode">python</field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain">[('state','!=','cancel'),('section_id','=',user.default_section_id.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
<field name="model_id" ref="account.model_account_invoice_report"/>
<field name="field_id" ref="account.field_account_invoice_report_price_total"/>
<field name="name">Team bonus</field>
<field name="description">Monthly team bonus</field>
<field name="monetary" eval="True"/>
<field name="computation_mode">python</field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain">[('state','!=','cancel'),('section_id','=',user.default_section_id.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
<field name="model_id" ref="account.model_account_invoice_report"/>
<field name="field_id" ref="account.field_account_invoice_report_price_total"/>
<field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" /> <field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" />
<field name="compute_code">
<![CDATA[
<field name="compute_code">
<![CDATA[
minimum = object.user_id.default_section_id.invoiced_forecast minimum = object.user_id.default_section_id.invoiced_forecast
maximum = object.user_id.default_section_id.invoiced_target maximum = object.user_id.default_section_id.invoiced_target
current = object.sum current = object.sum
@ -147,256 +147,256 @@ else:
result = int(result * 100) / 100.0 result = int(result * 100) / 100.0
]]> ]]>
</field> </field>
</record>
</record>
<record model="res.groups" id="group_dashboard_accountant"> <record model="res.groups" id="group_dashboard_accountant">
<field name="name">dashboard_accountant</field> <field name="name">dashboard_accountant</field>
<field name="category_id" ref="access_custom.module_category_custom"/> <field name="category_id" ref="access_custom.module_category_custom"/>
<field name="comment">Shows dashboard to accountant</field>
</record>
<field name="comment">Shows dashboard to accountant</field>
</record>
<record model="res.groups" id="group_dashboard_sales_management"> <record model="res.groups" id="group_dashboard_sales_management">
<field name="name">dashboard_sales_managment</field> <field name="name">dashboard_sales_managment</field>
<field name="category_id" ref="access_custom.module_category_custom"/> <field name="category_id" ref="access_custom.module_category_custom"/>
<field name="comment">Shows sales management dashboard</field>
</record>
<field name="comment">Shows sales management dashboard</field>
</record>
<record model="res.groups" id="group_dashboard_management"> <record model="res.groups" id="group_dashboard_management">
<field name="name">dashboard_managment</field> <field name="name">dashboard_managment</field>
<field name="category_id" ref="access_custom.module_category_custom"/> <field name="category_id" ref="access_custom.module_category_custom"/>
<field name="comment">Shows management dashboard. It includes: sales management + accountant dashboard + EXTRA</field>
<field name="implied_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management')),(4, ref('mail_wall_custom.group_dashboard_accountant'))]"/>
</record>
<field name="comment">Shows management dashboard. It includes: sales management + accountant dashboard + EXTRA</field>
<field name="implied_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management')),(4, ref('mail_wall_custom.group_dashboard_accountant'))]"/>
</record>
<record model="res.groups" id="group_dashboard_sales_person"> <record model="res.groups" id="group_dashboard_sales_person">
<field name="name">dashboard_sales_person</field> <field name="name">dashboard_sales_person</field>
<field name="category_id" ref="access_custom.module_category_custom"/> <field name="category_id" ref="access_custom.module_category_custom"/>
<field name="comment">Shows dashboard to salesperson</field>
</record>
<field name="comment">Shows dashboard to salesperson</field>
</record>
<record model="res.groups" id="group_dashboard_admin"> <record model="res.groups" id="group_dashboard_admin">
<field name="name">dashboard_admin</field> <field name="name">dashboard_admin</field>
<field name="category_id" ref="access_custom.module_category_custom"/> <field name="category_id" ref="access_custom.module_category_custom"/>
<field name="comment">Shows admin dashboard</field>
</record>
<field name="comment">Shows admin dashboard</field>
</record>
<record id="widget_outstanding_invoices" model="mail.wall.widgets.widget">
<field name="name">Outstanding sale orders</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('user_id', '=', user.id),('state', 'in', ['progress', 'manual'])]</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_outstanding_invoices" model="mail.wall.widgets.widget">
<field name="name">Outstanding sale orders</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('user_id', '=', user.id),('state', 'in', ['progress', 'manual'])]</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_outstanding_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Outstanding sale orders [ALL]</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('state', 'in', ['progress', 'manual'])]</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_outstanding_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Outstanding sale orders [ALL]</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('state', 'in', ['progress', 'manual'])]</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sent_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Sent invoices [ALL]</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="domain">[('type', 'in', ['out_invoice']),('state','in',['open'])]</field>
<field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sent_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Sent invoices [ALL]</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="domain">[('type', 'in', ['out_invoice']),('state','in',['open'])]</field>
<field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_received_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Received invoices [ALL]</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="domain">[('type', 'in', ['in_invoice']),('state','in',['open'])]</field>
<field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_received_invoices_all" model="mail.wall.widgets.widget">
<field name="name">Received invoices [ALL]</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="domain">[('type', 'in', ['in_invoice']),('state','in',['open'])]</field>
<field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="active" eval="True"/>
</record>
<record id="widget_tasks" model="mail.wall.widgets.widget">
<field name="name">Task deadlines</field>
<field name="model_id" ref="project.model_project_task"/>
<field name="domain">[('user_id', '=', user.id),('date_deadline','!=',False)]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="project.field_project_task_date_deadline"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_tasks_all" model="mail.wall.widgets.widget">
<field name="name">Task deadlines [ALL]</field>
<field name="model_id" ref="project.model_project_task"/>
<field name="domain">[('date_deadline','!=',False)]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="project.field_project_task_date_deadline"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_tasks" model="mail.wall.widgets.widget">
<field name="name">Task deadlines</field>
<field name="model_id" ref="project.model_project_task"/>
<field name="domain">[('user_id', '=', user.id),('date_deadline','!=',False)]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="project.field_project_task_date_deadline"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_tasks_all" model="mail.wall.widgets.widget">
<field name="name">Task deadlines [ALL]</field>
<field name="model_id" ref="project.model_project_task"/>
<field name="domain">[('date_deadline','!=',False)]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="project.field_project_task_date_deadline"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_next_action" model="mail.wall.widgets.widget">
<field name="name">Next action</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('user_id', '=', user.id), '|',('date_action','!=',False),('title_action', '!=', False)]</field>
<field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_next_action_all" model="mail.wall.widgets.widget">
<field name="name">Next action [ALL]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">['|',('date_action','!=',False),('title_action', '!=', False)]</field>
<field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_next_action" model="mail.wall.widgets.widget">
<field name="name">Next action</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('user_id', '=', user.id), '|',('date_action','!=',False),('title_action', '!=', False)]</field>
<field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_next_action_all" model="mail.wall.widgets.widget">
<field name="name">Next action [ALL]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">['|',('date_action','!=',False),('title_action', '!=', False)]</field>
<field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_calls" model="mail.wall.widgets.widget">
<field name="name">Calls</field>
<field name="model_id" ref="crm.model_crm_phonecall"/>
<field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">date DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_calls_all" model="mail.wall.widgets.widget">
<field name="name">Calls [ALL]</field>
<field name="model_id" ref="crm.model_crm_phonecall"/>
<field name="domain">[('state', 'not in', ['cancel'])]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">date DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_calls" model="mail.wall.widgets.widget">
<field name="name">Calls</field>
<field name="model_id" ref="crm.model_crm_phonecall"/>
<field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">date DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_calls_all" model="mail.wall.widgets.widget">
<field name="name">Calls [ALL]</field>
<field name="model_id" ref="crm.model_crm_phonecall"/>
<field name="domain">[('state', 'not in', ['cancel'])]</field>
<field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">date DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_meetings" model="mail.wall.widgets.widget">
<field name="name">Meetings</field>
<field name="model_id" ref="calendar.model_calendar_event"/>
<field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
<field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">start_datetime DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_meetings" model="mail.wall.widgets.widget">
<field name="name">Meetings</field>
<field name="model_id" ref="calendar.model_calendar_event"/>
<field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
<field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">start_datetime DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_meetings_all" model="mail.wall.widgets.widget">
<field name="name">Meetings [ALL]</field>
<field name="model_id" ref="calendar.model_calendar_event"/>
<field name="domain">[]</field>
<field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">start_datetime DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_meetings_all" model="mail.wall.widgets.widget">
<field name="name">Meetings [ALL]</field>
<field name="model_id" ref="calendar.model_calendar_event"/>
<field name="domain">[]</field>
<field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
<field name="agenda" eval="True"/>
<field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
<field name="type">list</field>
<field name="limit">10</field>
<field name="order">start_datetime DESC</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_funnel" model="mail.wall.widgets.widget">
<field name="name">Conversion Rate</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">funnel</field>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
<field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_funnel_all" model="mail.wall.widgets.widget">
<field name="name">Conversion Rate [ALL]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('sales_funnel_type', 'in', ['won', 'lost'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
<field name="type">funnel</field>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
<field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_funnel" model="mail.wall.widgets.widget">
<field name="name">Conversion Rate</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">funnel</field>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
<field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_funnel_all" model="mail.wall.widgets.widget">
<field name="name">Conversion Rate [ALL]</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="domain">[('sales_funnel_type', 'in', ['won', 'lost'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
<field name="type">funnel</field>
<field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
<field name="value_field_monetary" eval="True"/>
<field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
<field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_contributed" model="mail.wall.widgets.widget">
<field name="name">Sales contributed</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('state', 'in', ['done'])]</field>
<field name="won_domain">[('user_id','=', user.id), ('state', 'in', ['done'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">slice</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="active" eval="True"/>
</record>
<record id="widget_sales_contributed" model="mail.wall.widgets.widget">
<field name="name">Sales contributed</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain">[('state', 'in', ['done'])]</field>
<field name="won_domain">[('user_id','=', user.id), ('state', 'in', ['done'])]</field>
<field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
<field name="type">slice</field>
<field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
<field name="value_field_monetary" eval="True"/>
<field name="active" eval="True"/>
</record>
<!-- <!--
<record id="goal_average_deal_time" model="gamification.goal.definition"> <record id="goal_average_deal_time" model="gamification.goal.definition">
<field name="name">Average deal time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix"></field>
<field name="computation_mode"></field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain"></field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
-->
</data>
<field name="name">Average deal time</field>
<field name="description"></field>
<field name="monetary" eval="False"/>
<field name="suffix"></field>
<field name="computation_mode"></field>
<field name="display_mode">progress</field>
<field name="condition">higher</field>
<field name="domain"></field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
</record>
-->
</data>
</openerp> </openerp>

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'

22
mail_wall_custom/views.xml

@ -4,17 +4,17 @@
<record id="view_employee_form" model="ir.ui.view"> <record id="view_employee_form" model="ir.ui.view">
<field name="name">hr.employee.form</field> <field name="name">hr.employee.form</field>
<field name="model">hr.employee</field> <field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//group[@name='active_group']" position="before"> <xpath expr="//group[@name='active_group']" position="before">
<group string="Bonuses">
<field name="default_section_id"/>
<field name="personal_comission"/>
<field name="team_bonus"/>
<field name="company_bonus"/>
</group>
</xpath>
</field>
</record>
</data>
<group string="Bonuses">
<field name="default_section_id"/>
<field name="personal_comission"/>
<field name="team_bonus"/>
<field name="company_bonus"/>
</group>
</xpath>
</field>
</record>
</data>
</openerp> </openerp>

3
mail_wall_menu/__init__.py

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

15
mail_wall_menu/__openerp__.py

@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Menu for widgets at Messaging section',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Menu for widgets at Messaging section',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
"category": "Discuss", "category": "Discuss",
'website' : 'https://yelizariev.github.io',
'website': 'https://yelizariev.github.io',
'description': """ 'description': """
Module creates special menu at Messaging section to show only gamification-like blocks there. Module creates special menu at Messaging section to show only gamification-like blocks there.
Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d
""", """,
'depends' : ['mail'],
'data':[
'depends': ['mail'],
'data': [
'mail_wall_menu_views.xml', 'mail_wall_menu_views.xml',
],
],
'installable': True 'installable': True
} }

16
mail_wall_menu/mail_wall_menu_views.xml

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<template id="assets_backend" name="assets" inherit_id="mail.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_wall_menu/static/src/css/mail_wall_menu.css"/>
<script type="text/javascript" src="/mail_wall_menu/static/lib/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="/mail_wall_menu/static/src/js/mail_wall_menu.js"></script>
</xpath>
</template>
<template id="assets_backend" name="assets" inherit_id="mail.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_wall_menu/static/src/css/mail_wall_menu.css"/>
<script type="text/javascript" src="/mail_wall_menu/static/lib/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="/mail_wall_menu/static/src/js/mail_wall_menu.js"></script>
</xpath>
</template>
<record id="action_dashboard" model="ir.actions.client"> <record id="action_dashboard" model="ir.actions.client">
@ -29,5 +29,5 @@
<menuitem id="mail_wall_menu.menu_folder" name="Dashboard" parent="mail.mail_feeds_main" groups="base.group_user" sequence="5"/> <menuitem id="mail_wall_menu.menu_folder" name="Dashboard" parent="mail.mail_feeds_main" groups="base.group_user" sequence="5"/>
<menuitem id="mail_wall_menu.menu_dashboard" name="Dashboard" parent="mail_wall_menu.menu_folder" groups="base.group_user" sequence="10" action="action_dashboard"/> <menuitem id="mail_wall_menu.menu_dashboard" name="Dashboard" parent="mail_wall_menu.menu_folder" groups="base.group_user" sequence="10" action="action_dashboard"/>
</data>
</data>
</openerp> </openerp>

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

19
mail_wall_widgets/__openerp__.py

@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
{ {
'name' : 'Extra Widgets for mail wall',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'name': 'Extra Widgets for mail wall',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3', 'license': 'GPL-3',
'category' : 'Custom',
'website' : 'https://yelizariev.github.io',
'category': 'Custom',
'website': 'https://yelizariev.github.io',
'description': """ 'description': """
Tested on odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d Tested on odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d
""", """,
'depends' : ['mail','gamification'],
'data':[
'depends': ['mail', 'gamification'],
'data': [
'views.xml', 'views.xml',
#'data.xml',
# 'data.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
],
],
'qweb': ['static/src/xml/main.xml'], 'qweb': ['static/src/xml/main.xml'],
'installable': True, 'installable': True,
} }

63
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"
@ -25,10 +27,10 @@ class mail_wall_widgets_widget(models.Model):
('list', 'List'), ('list', 'List'),
('funnel', 'Funnel'), ('funnel', 'Funnel'),
('slice', 'Slice'), ('slice', 'Slice'),
#('', ''),
#('', ''),
#('', ''),
#('', ''),
# ('', ''),
# ('', ''),
# ('', ''),
# ('', ''),
], help=''' ], help='''
Slice - use "domain" for total and "won_domain" for target Slice - use "domain" for total and "won_domain" for target
'''), '''),
@ -39,19 +41,19 @@ Slice - use "domain" for total and "won_domain" for target
'limit': old_fields.integer('Limit', help='Limit count of records to show'), 'limit': old_fields.integer('Limit', help='Limit count of records to show'),
'order': old_fields.char('Order', help='Order of records to show'), 'order': old_fields.char('Order', help='Order of records to show'),
'value_field_id': old_fields.many2one('ir.model.fields', 'value_field_id': old_fields.many2one('ir.model.fields',
string='Value field',
help='The field containing the value of record'),
string='Value field',
help='The field containing the value of record'),
'stage_field_id': old_fields.many2one('ir.model.fields', 'stage_field_id': old_fields.many2one('ir.model.fields',
string='Stage field',
help='Field to split records in funnel. It can be selection type or many2one (the later should have "sequence" field)'),
#'stage_field_domain': old_fields.many2one('ir.model.fields',
string='Stage field',
help='Field to split records in funnel. It can be selection type or many2one (the later should have "sequence" field)'),
# 'stage_field_domain': old_fields.many2one('ir.model.fields',
# string='Stage field domain', # string='Stage field domain',
# help='(for many2one stage_field_id) Domain to find stage objects'), # help='(for many2one stage_field_id) Domain to find stage objects'),
'won_domain': old_fields.char('Won domain', 'won_domain': old_fields.char('Won domain',
help='Domain to find won objects'),
help='Domain to find won objects'),
'field_date_id': old_fields.many2one('ir.model.fields', 'field_date_id': old_fields.many2one('ir.model.fields',
string='Date Field',
help='The date to use for the time period evaluated'),
string='Date Field',
help='The date to use for the time period evaluated'),
'start_date': old_fields.date('Start Date'), 'start_date': old_fields.date('Start Date'),
'end_date': old_fields.date('End Date'), # no start and end = always active 'end_date': old_fields.date('End Date'), # no start and end = always active
'content': old_fields.char('Line template', help='Mako template to show content'), 'content': old_fields.char('Line template', help='Mako template to show content'),
@ -95,10 +97,11 @@ 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:
d = datetime.strptime(d, self.field_date_id.ttype=='date' and DEFAULT_SERVER_DATE_FORMAT or DEFAULT_SERVER_DATETIME_FORMAT)
d = datetime.strptime(d, self.field_date_id.ttype == 'date' and DEFAULT_SERVER_DATE_FORMAT or DEFAULT_SERVER_DATETIME_FORMAT)
d = d.date() d = d.date()
else: else:
d = date.today() d = date.today()
@ -140,10 +143,10 @@ Slice - use "domain" for total and "won_domain" for target
}) })
for r in obj.search(domain, limit=self.limit, order=self.order): for r in obj.search(domain, limit=self.limit, order=self.order):
mako = mako_template_env.from_string(tools.ustr(self.content)) mako = mako_template_env.from_string(tools.ustr(self.content))
content = mako.render({'record':r})
content = mako.render({'record': r})
r_json = { r_json = {
'id': r.id, 'id': r.id,
#'fields': dict( (f,getattr(r,f)) for f in fields),
# 'fields': dict( (f,getattr(r,f)) for f in fields),
'display_mode': 'progress', 'display_mode': 'progress',
'state': 'inprogress', 'state': 'inprogress',
'completeness': 0, 'completeness': 0,
@ -161,26 +164,26 @@ Slice - use "domain" for total and "won_domain" for target
for g in groups: for g in groups:
del g['test'] del g['test']
elif self.type == 'funnel': elif self.type == 'funnel':
stage_ids = [] # [key]
stage_ids = [] # [key]
for group in obj.read_group(domain, [], [self.stage_field_id.name]): for group in obj.read_group(domain, [], [self.stage_field_id.name]):
key = group[self.stage_field_id.name] key = group[self.stage_field_id.name]
if isinstance(key, (list, tuple)): if isinstance(key, (list, tuple)):
key = key[0] key = key[0]
stage_ids.append(key) stage_ids.append(key)
stages = [] # [{'name':Name, 'id': key}]
stages = [] # [{'name':Name, 'id': key}]
if self.stage_field_id.ttype == 'selection': if self.stage_field_id.ttype == 'selection':
d = dict (self.stage_field_id.selection)
stages = [ {'id':id, 'name':d[id]} for id in stage_ids ]
else: # many2one
d = dict(self.stage_field_id.selection)
stages = [{'id': id, 'name': d[id]} for id in stage_ids]
else: # many2one
stage_model = self.stage_field_id.relation stage_model = self.stage_field_id.relation
for r in self.env[stage_model].browse(stage_ids): for r in self.env[stage_model].browse(stage_ids):
stages.append({'id': r.id, 'name':r.name_get()[0][1]})
stages.append({'id': r.id, 'name': r.name_get()[0][1]})
value_field_name = self.value_field_id.name value_field_name = self.value_field_id.name
for stage in stages: for stage in stages:
d = copy.copy(domain) d = copy.copy(domain)
d.append( (self.stage_field_id.name, '=', stage['id']) )
d.append((self.stage_field_id.name, '=', stage['id']))
result = obj.read_group(d, [value_field_name], []) result = obj.read_group(d, [value_field_name], [])
stage['closed_value'] = result and result[0][value_field_name] or 0.0 stage['closed_value'] = result and result[0][value_field_name] or 0.0
stage['domain'] = str(d) stage['domain'] = str(d)
@ -189,7 +192,7 @@ Slice - use "domain" for total and "won_domain" for target
d = domain + won_domain d = domain + won_domain
result = obj.read_group(domain, [value_field_name], []) result = obj.read_group(domain, [value_field_name], [])
won = {'name': _('Won'), won = {'name': _('Won'),
'id':'__won__',
'id': '__won__',
'closed_value': result and result[0][value_field_name] or 0.0 'closed_value': result and result[0][value_field_name] or 0.0
} }
stages.append(won) stages.append(won)
@ -200,7 +203,7 @@ Slice - use "domain" for total and "won_domain" for target
total_value = stages[0]['abs_value'] total_value = stages[0]['abs_value']
precision = self.precision precision = self.precision
for s in stages: for s in stages:
s['rel_value'] = round(100*s['abs_value']/total_value/precision)*precision if total_value else 100
s['rel_value'] = round(100 * s['abs_value'] / total_value / precision) * precision if total_value else 100
# dummy fields # dummy fields
s['display_mode'] = 'progress' s['display_mode'] = 'progress'
s['monetary'] = 1 s['monetary'] = 1
@ -210,7 +213,7 @@ Slice - use "domain" for total and "won_domain" for target
res['conversion_rate'] = stages[-1]['rel_value'] res['conversion_rate'] = stages[-1]['rel_value']
elif self.type == 'slice': elif self.type == 'slice':
value_field_name = self.value_field_id.name value_field_name = self.value_field_id.name
for f,d in [('total', domain), ('won', won_domain)]:
for f, d in [('total', domain), ('won', won_domain)]:
result = obj.read_group(d, [value_field_name], []) result = obj.read_group(d, [value_field_name], [])
res[f] = result and result[0][value_field_name] or 0.0 res[f] = result and result[0][value_field_name] or 0.0
@ -219,12 +222,13 @@ Slice - use "domain" for total and "won_domain" for target
precision = self.precision precision = self.precision
total_value = res['total'] total_value = res['total']
res['slice'] = round(100*res['won']/res['total']/precision)*precision if res['total'] else 100
res['slice'] = round(100 * res['won'] / res['total'] / precision) * precision if res['total'] else 100
# dummy fields # dummy fields
res['display_mode'] = 'progress' res['display_mode'] = 'progress'
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'
@ -258,7 +263,7 @@ class res_users(models.Model):
domain = [('group_ids', 'in', user.groups_id.ids), ('active', '=', True)] domain = [('group_ids', 'in', user.groups_id.ids), ('active', '=', True)]
for widget in self.env[model].search(domain, order='sequence'): for widget in self.env[model].search(domain, order='sequence'):
if widget.cache: if widget.cache:
#TODO
# TODO
continue continue
res.append({ res.append({
'model': model, 'model': model,
@ -268,7 +273,7 @@ class res_users(models.Model):
}) })
return res return res
#def get_challenge_suggestions(self, cr, uid, context=None):
# def get_challenge_suggestions(self, cr, uid, context=None):
# """Return the list of challenges suggested to the user""" # """Return the list of challenges suggested to the user"""
# challenge_info = [] # challenge_info = []
# challenge_obj = self.pool.get('mail_wall_widgets.challenge') # challenge_obj = self.pool.get('mail_wall_widgets.challenge')

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

28
mail_wall_widgets/static/src/xml/main.xml

@ -13,10 +13,10 @@
<t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'list'"> <t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'list'">
<div class="oe_table oe_goals_list" t-att-data-model="info.data.model" t-att-data-domain="info.data.domain"> <div class="oe_table oe_goals_list" t-att-data-model="info.data.model" t-att-data-domain="info.data.domain">
<div t-foreach="info.data.groups" t-as="group" t-if="group.lines.length or group.mandatory" t-attf-class="list_group #{group.class or ''}">
<div t-if="group.label" class="group_label">
<t t-esc="group.label"/>
</div>
<div t-foreach="info.data.groups" t-as="group" t-if="group.lines.length or group.mandatory" t-attf-class="list_group #{group.class or ''}">
<div t-if="group.label" class="group_label">
<t t-esc="group.label"/>
</div>
<div t-foreach="group.lines" t-as="line" t-attf-class="oe_row oe_goal_outer_box oe_open_record record #{line.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}" t-att-data-id="line.id" > <div t-foreach="group.lines" t-as="line" t-attf-class="oe_row oe_goal_outer_box oe_open_record record #{line.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}" t-att-data-id="line.id" >
<t t-if="line.display_mode == 'progress'"> <t t-if="line.display_mode == 'progress'">
<div class="oe_goal_progress_background"></div> <div class="oe_goal_progress_background"></div>
@ -27,17 +27,17 @@
<span t-att-title="line.description"><t t-raw="line.name" /></span> <span t-att-title="line.description"><t t-raw="line.name" /></span>
</div> </div>
</div> </div>
<t t-if="!group.lines.length">
<div class="empty_list">No records</div>
</t>
</div>
<t t-if="!group.lines.length">
<div class="empty_list">No records</div>
</t>
</div>
<div t-if="info.data.more" class="oe_row oe_goal_outer_box oe_open_record_list">
<div t-if="info.data.more" class="oe_row oe_goal_outer_box oe_open_record_list">
<div class="oe_goal_progress_background"></div> <div class="oe_goal_progress_background"></div>
<div class="more">
More...
</div>
</div>
<div class="more">
More...
</div>
</div>
</div> </div>
</t> </t>
<t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'funnel'"> <t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'funnel'">
@ -57,7 +57,7 @@
</t> </t>
<t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'slice'"> <t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'slice'">
<div class="oe_table oe_goals_list funnel" t-att-data-model="info.data.model" t-att-data-domain="info.data.domain"> <div class="oe_table oe_goals_list funnel" t-att-data-model="info.data.model" t-att-data-domain="info.data.domain">
<t t-set="line" t-value="info.data"/>
<t t-set="line" t-value="info.data"/>
<div t-attf-class="oe_row oe_goal_outer_box oe_open_record_list record #{line.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}" t-att-data-id="line.id" t-att-data-domain="line.won_domain" > <div t-attf-class="oe_row oe_goal_outer_box oe_open_record_list record #{line.state == 'reached' ? 'oe_goal_reached' : ''} #{line.display_mode != 'progress' ? 'oe_no_progress' : ''}" t-att-data-id="line.id" t-att-data-domain="line.won_domain" >
<t t-if="line.display_mode == 'progress'"> <t t-if="line.display_mode == 'progress'">
<div class="oe_goal_progress_background"></div> <div class="oe_goal_progress_background"></div>

44
mail_wall_widgets/views.xml

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<template id="assets_backend" name="assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_wall_widgets/static/src/css/main.css"/>
<script type="text/javascript" src="/mail_wall_widgets/static/src/js/main.js"></script>
</xpath>
</template>
<template id="assets_backend" name="assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_wall_widgets/static/src/css/main.css"/>
<script type="text/javascript" src="/mail_wall_widgets/static/src/js/main.js"></script>
</xpath>
</template>
<!-- Widget -->
<!-- Widget -->
<record id="mail_wall_widgets_widget_action" model="ir.actions.act_window"> <record id="mail_wall_widgets_widget_action" model="ir.actions.act_window">
<field name="name">Widgets</field> <field name="name">Widgets</field>
<field name="res_model">mail.wall.widgets.widget</field> <field name="res_model">mail.wall.widgets.widget</field>
@ -47,7 +47,7 @@
<field name="name" class="oe_inline"/> <field name="name" class="oe_inline"/>
</h1> </h1>
<field name="type" class="oe_inline"/>
<field name="type" class="oe_inline"/>
<label for="description" class="oe_edit_only"/> <label for="description" class="oe_edit_only"/>
<div> <div>
<field name="description" class="oe_inline"/> <field name="description" class="oe_inline"/>
@ -58,27 +58,27 @@
<field name="model_id" class="oe_inline"/> <field name="model_id" class="oe_inline"/>
<field name="domain" /> <field name="domain" />
<field name="won_domain" attrs="{'invisible':[('type', 'not in', ['funnel','slice'])]}" /> <field name="won_domain" attrs="{'invisible':[('type', 'not in', ['funnel','slice'])]}" />
<field name="field_date_id" attrs="{'required':[('agenda','=',True)]}"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="field_date_id" attrs="{'required':[('agenda','=',True)]}"/>
<field name="start_date"/>
<field name="end_date"/>
</group>
<group string="How to select users?">
<field name="group_ids" class="oe_inline" widget="many2many_tags"/>
</group> </group>
<group string="How to select users?">
<field name="group_ids" class="oe_inline" widget="many2many_tags"/>
</group>
<group string="How show data?"> <group string="How show data?">
<field name="stage_field_id" attrs="{'invisible':[('type', 'not in', ['funnel'])]}"/>
<field name="stage_field_id" attrs="{'invisible':[('type', 'not in', ['funnel'])]}"/>
<field name="value_field_id" class="oe_inline"/> <field name="value_field_id" class="oe_inline"/>
<field name="value_field_monetary" class="oe_inline"/> <field name="value_field_monetary" class="oe_inline"/>
<field name="precision" class="oe_inline"/> <field name="precision" class="oe_inline"/>
<field name="content" attrs="{'invisible':[('type', 'not in', ['list'])]}"/>
<field name="content" attrs="{'invisible':[('type', 'not in', ['list'])]}"/>
<field name="limit" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/> <field name="limit" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/>
<field name="order" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/> <field name="order" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/>
<field name="agenda" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/>
<field name="agenda" attrs="{'invisible':[('type', 'not in', ['list'])]}" class="oe_inline"/>
</group> </group>
<group string="Other">
<group string="Other">
<field name="sequence" class="oe_inline"/> <field name="sequence" class="oe_inline"/>
<field name="active"/>
</group>
<field name="active"/>
</group>
</sheet> </sheet>
</form> </form>
</field> </field>
@ -100,6 +100,6 @@
<!-- menus in settings - technical feature required --> <!-- menus in settings - technical feature required -->
<menuitem id="mail_wall_widgets_widget_menu" parent="gamification.gamification_menu" action="mail_wall_widgets_widget_action" sequence="50"/> <menuitem id="mail_wall_widgets_widget_menu" parent="gamification.gamification_menu" action="mail_wall_widgets_widget_action" sequence="50"/>
</data>
</data>
</openerp> </openerp>

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': 'GPL-3', 'license': 'GPL-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': True 'installable': True
} }

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>

2
res_partner_mails_count/__init__.py

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

4
res_partner_mails_count/__openerp__.py

@ -14,8 +14,8 @@
"depends": [ "depends": [
'base', 'base',
'mail' ,
'web_tour_extra' ,
'mail',
'web_tour_extra',
], ],
"external_dependencies": {"python": [], "bin": []}, "external_dependencies": {"python": [], "bin": []},
"data": [ "data": [

16
res_partner_mails_count/static/src/js/main.js

@ -1,10 +1,10 @@
openerp.res_partner_mails_count = function(instance){ openerp.res_partner_mails_count = function(instance){
instance.mail.Wall.include({
init: function(){
this._super.apply(this, arguments);
if(this.context.ignore_search_model){
delete this.defaults.model;
}
}
});
instance.mail.Wall.include({
init: function(){
this._super.apply(this, arguments);
if(this.context.ignore_search_model){
delete this.defaults.model;
}
}
});
}; };

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,10 +1,13 @@
# -*- 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")
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