From 0d3d0e95636cf8ae0d52c650a28f505a89c3dc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 5 Mar 2014 18:36:10 +0100 Subject: [PATCH 01/12] [IMP] mail: improved link in notification, now of form Sent from using , about , access in bzr revid: tde@openerp.com-20140305173610-yw71rophyt3iyfi4 --- addons/mail/mail_followers.py | 5 ++--- addons/mail/mail_mail.py | 17 ++++++++++++++--- addons/portal/mail_mail.py | 6 +++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index 0059df90530..260d4849040 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -115,8 +115,7 @@ class mail_notification(osv.Model): Administrator

- Sent by Your Company using OpenERP. OR - Sent by Administrator using OpenERP. + Sent from Your Company using OpenERP.
""" footer = "" @@ -138,7 +137,7 @@ class mail_notification(osv.Model): company = "%s" % (website_url, user.company_id.name) else: company = user.company_id.name - sent_by = _('Sent by %(company)s using %(openerp)s.') + sent_by = _('Sent from %(company)s using %(openerp)s') signature_company = '%s' % (sent_by % { 'company': company, 'openerp': "OpenERP" diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index a8726c16a0d..eb8aaf3356e 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -148,6 +148,8 @@ class mail_mail(osv.Model): """ Generate URLs for links in mails: - partner is an user and has read access to the document: direct link to document with model, res_id """ + if context is None: + context = {} if partner and partner.user_ids: base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') # the parameters to encode for the query and fragment part of url @@ -160,9 +162,9 @@ class mail_mail(osv.Model): fragment['message_id'] = mail.mail_message_id.id elif mail.model and mail.res_id: fragment.update(model=mail.model, res_id=mail.res_id) - + url = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment))) - return _("""Access your messages and documents in OpenERP""") % url + return _("""about %s %s""") % (url, context.get('model_name', ''), mail.record_name) else: return None @@ -239,10 +241,19 @@ class mail_mail(osv.Model): email sending process has failed :return: True """ + if context is None: + context = {} ir_mail_server = self.pool.get('ir.mail_server') - for mail in self.browse(cr, SUPERUSER_ID, ids, context=context): try: + # TDE note: remove me when model_id field is present on mail.message - done here to avoid doing it multiple times in the sub method + if mail.model: + model_id = self.pool['ir.model'].search(cr, SUPERUSER_ID, [('model', '=', mail.model)], context=context)[0] + model = self.pool['ir.model'].browse(cr, SUPERUSER_ID, model_id, context=context) + else: + model = None + if model: + context['model_name'] = model.name # handle attachments attachments = [] for attach in mail.attachment_ids: diff --git a/addons/portal/mail_mail.py b/addons/portal/mail_mail.py index 18eb15361a3..094b3223560 100644 --- a/addons/portal/mail_mail.py +++ b/addons/portal/mail_mail.py @@ -39,8 +39,8 @@ class mail_mail(osv.Model): if partner and not partner.user_ids: contex_signup = dict(context, signup_valid=True) signup_url = partner_obj._get_signup_url_for_action(cr, SUPERUSER_ID, [partner.id], - action='login', model=mail.model, res_id=mail.res_id, - context=contex_signup)[partner.id] - return _("""Access your messages and documents through our Customer Portal""") % signup_url + action='login', model=mail.model, res_id=mail.res_id, + context=contex_signup)[partner.id] + return _("""access %s %s through our Customer Portal""") % (context.get('model_name', ''), mail.record_name, signup_url) else: return super(mail_mail, self)._get_partner_access_link(cr, uid, mail, partner=partner, context=context) From 933adca053d003b133660d5949e61839bdb76b3a Mon Sep 17 00:00:00 2001 From: Jaydeep Barot Date: Wed, 2 Apr 2014 14:23:56 +0530 Subject: [PATCH 02/12] [IMP] In list view of journal items, user can sort using Reconcile ref field currently. bzr revid: jar@tinyerp.com-20140402085356-4bqscthp64r8ssph --- addons/account/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b48e842caf5..b328792b571 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -445,7 +445,7 @@ class account_move_line(osv.osv): 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1), 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2), 'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2), - 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref'), + 'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref', store=True), 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')), 'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount in Currency', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."), 'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."), From 2558b7ec015ccd58cb8125356dce4bf869d73745 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 23 Apr 2014 11:17:26 +0200 Subject: [PATCH 03/12] [IMP] removes double groupby in row dimension, in opportunities analysis bzr revid: ged@openerp.com-20140423091726-kgnqfqtqjqxvul45 --- addons/crm/report/crm_lead_report_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index c4cffdc012a..083142c550d 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -33,7 +33,6 @@ - From 92e3455565d3f5b889c948d9438c52155cdf2595 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 23 Apr 2014 11:29:55 +0200 Subject: [PATCH 04/12] [IMP] removes double groupby in row dimension, in hr recruitment reporting view (addon hr_recruitment) bzr revid: ged@openerp.com-20140423092955-cong5772cxpvks3m --- addons/hr_recruitment/report/hr_recruitment_report_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml index c214b2efa75..4d15481070f 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml +++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml @@ -8,7 +8,6 @@ - From 8ddf7a21b7c4f202440640aea724fbe8590f8db9 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 23 Apr 2014 16:52:35 +0200 Subject: [PATCH 05/12] [FIX]calendar tooltip attachment container bzr revid: csn@openerp.com-20140423145235-ajph1xj2l492q1sy --- addons/web/static/src/js/view_form.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 21a34db0036..247fd2d2a1a 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1870,11 +1870,19 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi widget = widget || this; trigger = trigger || this.$el; var container = 'body'; - //in the case we have a modal currently showing, attach tooltip - //to the modal to prevent the tooltip to show in the body in the - //case we close the modal too fast - if (window.$('.modal.in').length>0){ - container = window.$('.modal.in:last()'); + /*TODO: need to be refactor + in the case we can find the view form in the parent, + attach the element to it (to prevent tooltip to keep showing + when switching view) or if we have a modal currently showing, + attach tooltip to the modal to prevent the tooltip to show in the body in the + case we close the modal too fast*/ + if ($(trigger).parents('.oe_view_manager_view_form').length > 0){ + container = $(trigger).parents('.oe_view_manager_view_form'); + } + else { + if (window.$('.modal.in').length>0){ + container = window.$('.modal.in:last()'); + } } options = _.extend({ delay: { show: 500, hide: 0 }, From 1657ffb8e7d95ef5f94e59121737abb068371b66 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Wed, 23 Apr 2014 17:01:35 +0200 Subject: [PATCH 06/12] [IMP] website_project: remove preprocess_request content; user can the add link with the menu editor bzr revid: chm@openerp.com-20140423150135-ng1xkiopm2ks3v23 --- addons/website_project/controllers/main.py | 16 ---------------- addons/website_project/views/website_project.xml | 9 --------- 2 files changed, 25 deletions(-) diff --git a/addons/website_project/controllers/main.py b/addons/website_project/controllers/main.py index e487a981996..c16d49e9f44 100644 --- a/addons/website_project/controllers/main.py +++ b/addons/website_project/controllers/main.py @@ -21,22 +21,6 @@ from openerp.addons.web import http from openerp.addons.web.http import request -from openerp.osv import osv - - -class Website(osv.Model): - _inherit = "website" - - def preprocess_request(self, cr, uid, ids, request, context=None): - project_obj = request.registry['project.project'] - project_ids = project_obj.search(cr, uid, [('privacy_visibility', "=", "public")], context=request.context) - - request.context.update({ - 'website_project_ids': project_obj.browse(cr, uid, project_ids, context=request.context) - }) - - return super(Website, self).preprocess_request(cr, uid, ids, request, context=None) - class website_project(http.Controller): diff --git a/addons/website_project/views/website_project.xml b/addons/website_project/views/website_project.xml index 1d511ba3ef1..a7e8b465d73 100644 --- a/addons/website_project/views/website_project.xml +++ b/addons/website_project/views/website_project.xml @@ -2,15 +2,6 @@ - - -