From 86126f17b8266c1484505451e6917c7f5891afa3 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 25 Feb 2013 15:33:09 +0100 Subject: [PATCH 01/97] [IMP] account_followup: it is now possible to group by the followup level of partners (added store={} on followup level fields) bzr revid: qdp-launchpad@openerp.com-20130225143309-9652l4j9pojtory9 --- addons/account_followup/account_followup.py | 18 ++++++++++++++++-- .../account_followup_customers.xml | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index aeee35c93dc..a4e8f874332 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -426,6 +426,14 @@ class res_partner(osv.osv): return [('id','=','0')] return [('id','in', [x[0] for x in res])] + def _get_partners(self, cr, uid, ids, context=None): + #this function search for the partners linked to all account.move.line 'ids' that have been changed + partners = set() + for aml in self.browse(cr, uid, ids, context=context): + if aml.partner_id: + partners.add(aml.partner_id.id) + return list(partners) + _inherit = "res.partner" _columns = { 'payment_responsible_id':fields.many2one('res.users', ondelete='set null', string='Follow-up Responsible', @@ -447,12 +455,18 @@ class res_partner(osv.osv): 'latest_followup_level_id':fields.function(_get_latest, method=True, type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level", help="The maximum follow-up level", - store=False, + store={ + 'res.partner': (lambda self, cr, uid, ids, c: ids,[],10), + 'account.move.line': (_get_partners, ['followup_line_id'], 10), + }, multi="latest"), 'latest_followup_level_id_without_lit':fields.function(_get_latest, method=True, type='many2one', relation='account_followup.followup.line', string="Latest Follow-up Level without litigation", help="The maximum follow-up level without taking into account the account move lines with litigation", - store=False, + store={ + 'res.partner': (lambda self, cr, uid, ids, c: ids,[],10), + 'account.move.line': (_get_partners, ['followup_line_id'], 10), + }, multi="latest"), 'payment_amount_due':fields.function(_get_amounts_and_date, type='float', string="Amount Due", diff --git a/addons/account_followup/account_followup_customers.xml b/addons/account_followup/account_followup_customers.xml index 691d1555e8d..78a9c892614 100644 --- a/addons/account_followup/account_followup_customers.xml +++ b/addons/account_followup/account_followup_customers.xml @@ -17,6 +17,7 @@ + @@ -39,6 +40,7 @@ + From 01cf4346a5797465c07fed100d31b12003eae8f7 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 25 Feb 2013 16:08:18 +0100 Subject: [PATCH 02/97] [IMP] project_issue, usability: added a button to jump on issues from the res.partner bzr revid: qdp-launchpad@openerp.com-20130225150818-mtucc9pvptlfk591 --- addons/project_issue/project_issue_view.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index a6b0b2cff96..56ccc00a332 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -364,5 +364,19 @@ + + + res.partner.issues.button.view + res.partner + + + + + - File + /web/binary/upload_attachment From f05aff8ac9e257ca8c79d58c544b48b39ce354cd Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Fri, 8 Mar 2013 11:48:50 +0100 Subject: [PATCH 23/97] [FIX]tools/mail: fix regex when sanitizing html containing mail address bzr revid: csn@openerp.com-20130308104850-02nfuaxdr91bo0nx --- openerp/tools/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 7ca9dd75bac..933c8927d2c 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -50,7 +50,7 @@ def html_sanitize(src): src = ustr(src, errors='replace') # html encode email tags - part = re.compile(r"(<[^<>]+@[^<>]+>)", re.IGNORECASE | re.DOTALL) + part = re.compile(r"(<(([^a<>]|a[^<>\s])[^<>]*)@[^<>]+>)", re.IGNORECASE | re.DOTALL) src = part.sub(lambda m: cgi.escape(m.group(1)), src) # some corner cases make the parser crash (such as in test_mail) From 22bba15ccd7ab709db9ed2c38a132273c9847e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:43:41 +0100 Subject: [PATCH 24/97] [FIX] email_template: on_change values for m2m can be list of ids, not necessarily commands. bzr revid: tde@openerp.com-20130308124341-ih0f4us81cffer7m --- addons/email_template/wizard/mail_compose_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index e9f539a22b2..9dad18e07f3 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -141,7 +141,7 @@ class mail_compose_message(osv.TransientModel): # legacy template behavior: void values do not erase existing values and the # related key is removed from the values dict if partner_ids: - values['partner_ids'] = [(6, 0, list(partner_ids))] + values['partner_ids'] = list(partner_ids) return values From 6dbb52267f514055f013207f7522f9d49dfd6110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:47:24 +0100 Subject: [PATCH 25/97] [FIX] res_partner: notification_email_send help and selection values strings updated for cleaner explanations. bzr revid: tde@openerp.com-20130308124724-6tmb4w180sf32ktb --- addons/mail/res_partner.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 218b5ae3cb7..6807c13a08a 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -30,13 +30,16 @@ class res_partner_mail(osv.Model): _columns = { 'notification_email_send': fields.selection([ - ('all', 'All feeds'), - ('comment', 'Comments and Emails'), - ('email', 'Emails only'), + ('all', 'All Messages (discussions, emails, followed system notifications)'), + ('comment', 'Incoming Emails and Discussions'), + ('email', 'Incoming Emails only'), ('none', 'Never') - ], 'Receive Feeds by Email', required=True, - help="Choose in which case you want to receive an email when you "\ - "receive new feeds."), + ], 'Receive Messages by Email', required=True, + help="Policy to receive emails for new notifications pushed to your Inbox. "\ + "'Never' prevents OpenERP from sending emails for notifications. "\ + "'Incoming Emails only' send an email when you receive an incoming email, such as customer replies. "\ + "'Incoming Emails and Discussions' sends emails for incoming emails along with user input. "\ + "'All Messages' also sends emails for notifications received for followed subtype, like stage changes, in addition to Incoming Emails and Discussions."), } _defaults = { From d130a05e8cf147ea983c42de588d3ac9c66e319a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:47:53 +0100 Subject: [PATCH 26/97] [FIX] crm, email_template: opt_out parameter used only for mass mailing and marketing campaigns. Updated help accordingly. bzr revid: tde@openerp.com-20130308124753-dzt5e5nf7zpaq2dk --- addons/crm/crm_lead.py | 2 +- addons/email_template/res_partner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index e8bba67e1ce..9b3697b8dc5 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -259,7 +259,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"), 'contact_name': fields.char('Contact Name', size=64), 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), - 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails or unsubscribed to a campaign."), + 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), diff --git a/addons/email_template/res_partner.py b/addons/email_template/res_partner.py index 987fca43219..bf730f37458 100644 --- a/addons/email_template/res_partner.py +++ b/addons/email_template/res_partner.py @@ -28,8 +28,8 @@ class res_partner(osv.osv): _inherit = 'res.partner' _columns = { - 'opt_out': fields.boolean('Opt-Out', help="If checked, this partner will not receive any automated email " \ - "notifications, such as the availability of invoices."), + 'opt_out': fields.boolean('Opt-Out', + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), } _defaults = { From 6d78c2f2349ea64d5248644c559c34a0bdccd7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 13:48:35 +0100 Subject: [PATCH 27/97] [FIX] res_partner: mail now adds forgotten notification_email_send field; otherwise partner manager are not able to change the email reception policy for partners that are not users. bzr revid: tde@openerp.com-20130308124835-sooyabgjhawjg7qr --- addons/mail/res_partner_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/res_partner_view.xml b/addons/mail/res_partner_view.xml index a4aa56ae971..7df5d27c9d0 100644 --- a/addons/mail/res_partner_view.xml +++ b/addons/mail/res_partner_view.xml @@ -7,6 +7,9 @@ res.partner + + +
From 16a89075e0cbfcb42bfe0e8c6ebbac2012b1097e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 8 Mar 2013 14:14:52 +0100 Subject: [PATCH 28/97] [FIX] FieldTextHtml: fixed quote error in parameter of cleditor, leading to font-family not taken into account. bzr revid: tde@openerp.com-20130308131452-8mmmpc6was3lfse8 --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3ca546a9754..c8f7eaf032e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2662,7 +2662,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc "| removeformat | bullets numbering | outdent " + "indent | link unlink | source", bodyStyle: // style to assign to document body contained within the editor - "margin:4px; color:#4c4c4c; font-size:13px; font-family:\"Lucida Grande\",Helvetica,Verdana,Arial,sans-serif; cursor:text" + "margin:4px; color:#4c4c4c; font-size:13px; font-family:\'Lucida Grande\',Helvetica,Verdana,Arial,sans-serif; cursor:text" }); this.$cleditor = this.$textarea.cleditor()[0]; this.$cleditor.change(function() { From d79150eefacef9c9f78e16fb92a938e2a3b7cc71 Mon Sep 17 00:00:00 2001 From: Peter Langenberg Date: Fri, 8 Mar 2013 18:06:08 +0100 Subject: [PATCH 29/97] sometimes sequence of sales order lines wrong after save (most frequent using debian squeeze) lp bug: https://launchpad.net/bugs/1134365 fixed bzr revid: pl@agaplan.eu-20130308170608-3zlsrow4rnw2fcqi --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8e944691a1d..854c671fd74 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -717,7 +717,7 @@ class sale_order_line(osv.osv): 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesperson'), 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), } - _order = 'order_id desc, sequence' + _order = 'order_id desc, sequence, id' _defaults = { 'product_uom' : _get_uom_id, 'discount': 0.0, From 7310643b6b15e09db11de2ec38be007e37706936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 12:46:23 +0100 Subject: [PATCH 30/97] [IMP] email: better reply_to that includes document name. bzr revid: tde@openerp.com-20130311114623-ftcj8s8rbahvjupz --- addons/mail/mail_mail.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 1b3ca152a9a..6219ace864f 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -21,6 +21,7 @@ import base64 import logging +import re from urllib import urlencode from urlparse import urljoin @@ -198,13 +199,27 @@ class mail_mail(osv.Model): :param browse_record mail: mail.mail browse_record :param browse_record partner: specific recipient partner """ + # TDE FIXME BEFORE MERGE: not sure the late change is interesting if mail.reply_to: return mail.reply_to - if not mail.model or not mail.res_id: - return False - if not hasattr(self.pool.get(mail.model), 'message_get_reply_to'): - return False - return self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + document_name = '' + email_reply_to = False + if mail.model and mail.res_id and hasattr(self.pool.get(mail.model), 'message_get_reply_to'): + email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + + if not email_reply_to: + if mail.email_from: + match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex + if match: + email_reply_to = match.group(1) + + if email_reply_to: + if mail.model and mail.res_id: + document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] + if document_name: + return 'Followers of %s <%s>' % (document_name[1], email_reply_to) + else: + return email_reply_to def send_get_email_dict(self, cr, uid, mail, partner=None, context=None): """ Return a dictionary for specific email values, depending on a From a2a8c238dcd04e683ef6d3f1051aaa9e432db89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 13:42:54 +0100 Subject: [PATCH 31/97] [CLEAN] email_template: removed a print statement. bzr revid: tde@openerp.com-20130311124254-xzxs1r6cnqw2zxxc --- addons/email_template/wizard/mail_compose_message.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 9dad18e07f3..255f93998a2 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -70,7 +70,6 @@ class mail_compose_message(osv.TransientModel): elif template_id: # FIXME odo: change the mail generation to avoid attachment duplication values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context) - print values.get('partner_ids') # transform attachments into attachment_ids values['attachment_ids'] = [] ir_attach_obj = self.pool.get('ir.attachment') From 6ae80a98acb524d0965658446a65bf5fd2a020d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 13:49:14 +0100 Subject: [PATCH 32/97] [CLEAN] mail: cleaned code of modified reply_to. bzr revid: tde@openerp.com-20130311124914-xcdbgmw4w7nm02rv --- addons/mail/mail_mail.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 6219ace864f..1ca3255fd84 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -202,24 +202,26 @@ class mail_mail(osv.Model): # TDE FIXME BEFORE MERGE: not sure the late change is interesting if mail.reply_to: return mail.reply_to - document_name = '' email_reply_to = False + + # if model and res_id: try to use ``message_get_reply_to`` that returns the document alias if mail.model and mail.res_id and hasattr(self.pool.get(mail.model), 'message_get_reply_to'): email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] + # no alias reply_to -> reply_to will be the email_from, only the email part + if not email_reply_to and mail.email_from: + match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex + if match: + email_reply_to = match.group(1) - if not email_reply_to: - if mail.email_from: - match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex - if match: - email_reply_to = match.group(1) - + # format 'Document name ' if email_reply_to: + document_name = '' if mail.model and mail.res_id: document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] if document_name: - return 'Followers of %s <%s>' % (document_name[1], email_reply_to) - else: - return email_reply_to + email_reply_to = 'Followers of %s <%s>' % (document_name[1], email_reply_to) + + return email_reply_to def send_get_email_dict(self, cr, uid, mail, partner=None, context=None): """ Return a dictionary for specific email values, depending on a From 459fce0150981269e668fda52001463269f58659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 11 Mar 2013 15:08:38 +0100 Subject: [PATCH 33/97] [CLEAN] Removed unnecessary quotes. As Teal'c said: Indeed. bzr revid: tde@openerp.com-20130311140838-g9pvncskvuibz1wm --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c8f7eaf032e..952a1c9d15f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2662,7 +2662,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc "| removeformat | bullets numbering | outdent " + "indent | link unlink | source", bodyStyle: // style to assign to document body contained within the editor - "margin:4px; color:#4c4c4c; font-size:13px; font-family:\'Lucida Grande\',Helvetica,Verdana,Arial,sans-serif; cursor:text" + "margin:4px; color:#4c4c4c; font-size:13px; font-family:'Lucida Grande',Helvetica,Verdana,Arial,sans-serif; cursor:text" }); this.$cleditor = this.$textarea.cleditor()[0]; this.$cleditor.change(function() { From 910f7097ba8278e329de236341f7e2e78293c0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 11:56:40 +0100 Subject: [PATCH 34/97] [IMP] res_partner: use tools.email_split instead of custom regex when parsing partner_name to find an email. bzr revid: tde@openerp.com-20130313105640-r53xueaz36zw3fjd --- openerp/addons/base/res/res_partner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 4dce23b4d33..7c9fbf58c64 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -417,10 +417,10 @@ class res_partner(osv.osv, format_address): """ Supported syntax: - 'Raoul ': will find name and email address - otherwise: default, everything is set as the name """ - match = re.search(r'([^\s,<@]+@[^>\s,]+)', text) - if match: - email = match.group(1) - name = text[:text.index(email)].replace('"','').replace('<','').strip() + emails = tools.email_split(text) + if emails: + email = emails[0] + name = text[:text.index(email)].replace('"', '').replace('<', '').strip() else: name, email = text, '' return name, email From d49889c9a8575cdb31193770172e9de3bb1b3d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:17:46 +0100 Subject: [PATCH 35/97] [IMP] mail: res_partner: improved help for notification_email_send. bzr revid: tde@openerp.com-20130313111746-xfrd8kdhntb39gwl --- addons/mail/res_partner.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/mail/res_partner.py b/addons/mail/res_partner.py index 6807c13a08a..05f9fc2ace0 100644 --- a/addons/mail/res_partner.py +++ b/addons/mail/res_partner.py @@ -30,16 +30,16 @@ class res_partner_mail(osv.Model): _columns = { 'notification_email_send': fields.selection([ - ('all', 'All Messages (discussions, emails, followed system notifications)'), - ('comment', 'Incoming Emails and Discussions'), + ('none', 'Never'), ('email', 'Incoming Emails only'), - ('none', 'Never') + ('comment', 'Incoming Emails and Discussions'), + ('all', 'All Messages (discussions, emails, followed system notifications)'), ], 'Receive Messages by Email', required=True, - help="Policy to receive emails for new notifications pushed to your Inbox. "\ - "'Never' prevents OpenERP from sending emails for notifications. "\ - "'Incoming Emails only' send an email when you receive an incoming email, such as customer replies. "\ - "'Incoming Emails and Discussions' sends emails for incoming emails along with user input. "\ - "'All Messages' also sends emails for notifications received for followed subtype, like stage changes, in addition to Incoming Emails and Discussions."), + help="Policy to receive emails for new messages pushed to your personal Inbox:\n " + "- Never: no emails are sent" + "- Incoming Emails only: for messages received by the system via email" + "- Incoming Emails and Discussions: for incoming emails along with internal discussions" + "- All Messages: for every notification you receive in your Inbox"), } _defaults = { From 6b2c64ff4099a3ab7cb5f0643f20bda5943f3f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:19:26 +0100 Subject: [PATCH 36/97] [IMP] mail_mail: cleaned code about reply_to format: now uses tools.email_split, cleaned a bit the code. bzr revid: tde@openerp.com-20130313111926-45d9gct5nihr6f6n --- addons/mail/mail_mail.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 1ca3255fd84..7720df84f92 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -209,17 +209,15 @@ class mail_mail(osv.Model): email_reply_to = self.pool.get(mail.model).message_get_reply_to(cr, uid, [mail.res_id], context=context)[0] # no alias reply_to -> reply_to will be the email_from, only the email part if not email_reply_to and mail.email_from: - match = re.search(r'([^\s,<@]+@[^>\s,]+)', mail.email_from) # TDE TODO: simplify multiple same regex - if match: - email_reply_to = match.group(1) + emails = tools.email_split(mail.email_from) + if emails: + email_reply_to = emails[0] # format 'Document name ' - if email_reply_to: - document_name = '' - if mail.model and mail.res_id: - document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] + if email_reply_to and mail.model and mail.res_id: + document_name = self.pool.get(mail.model).name_get(cr, SUPERUSER_ID, [mail.res_id], context=context)[0] if document_name: - email_reply_to = 'Followers of %s <%s>' % (document_name[1], email_reply_to) + email_reply_to = _('Followers of %s <%s>') % (document_name[1], email_reply_to) return email_reply_to From 2f4a59fd0652e1c5b76e5bd62826de084295c91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:20:13 +0100 Subject: [PATCH 37/97] [IMP] email_template, crm: added forgotten filters for opt-out; cleaned help of opt-out; email body is back into internal note as it has been decided that it was too much change for 7.0, especially that email content parsing is not robust enough. bzr revid: tde@openerp.com-20130313112013-veqzplextey1300p --- addons/crm/crm_lead.py | 6 +++++- addons/crm/crm_lead_view.xml | 2 ++ addons/email_template/res_partner.py | 5 +++-- addons/email_template/res_partner_view.xml | 12 ++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9b3697b8dc5..7ab9f110a7b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -259,7 +259,9 @@ class crm_lead(base_stage, format_address, osv.osv): 'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel (mail, direct, phone, ...)"), 'contact_name': fields.char('Contact Name', size=64), 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), - 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), + 'opt_out': fields.boolean('Opt-Out', oldname='optout', + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " + "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), @@ -977,8 +979,10 @@ class crm_lead(base_stage, format_address, osv.osv): """ if custom_values is None: custom_values = {} + desc = html2plaintext(msg.get('body')) if msg.get('body') else '' defaults = { 'name': msg.get('subject') or _("No Subject"), + 'description': desc, 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'partner_id': msg.get('author_id', False), diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index df68f90aa57..39c9a5b98f5 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -341,6 +341,8 @@ + diff --git a/addons/email_template/res_partner.py b/addons/email_template/res_partner.py index bf730f37458..cb3ef67862f 100644 --- a/addons/email_template/res_partner.py +++ b/addons/email_template/res_partner.py @@ -19,7 +19,7 @@ # ############################################################################## -from openerp.osv import fields,osv +from openerp.osv import fields, osv class res_partner(osv.osv): """Inherit res.partner to add a generic opt-out field that can be used @@ -29,7 +29,8 @@ class res_partner(osv.osv): _columns = { 'opt_out': fields.boolean('Opt-Out', - help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign."), + help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " + "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), } _defaults = { diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index 3d17120d69e..7e494bd5054 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -11,5 +11,17 @@ + + + res.partner.opt_out.search + res.partner + + + + + + + From fdf7410acffa269ee81ac7a0f03c3f9429b19e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 12:59:01 +0100 Subject: [PATCH 38/97] [FIX] crm, res_partner: added separator in search views after adding not opt-out filter. bzr revid: tde@openerp.com-20130313115901-s60j69qn3e3q4bpk --- addons/crm/crm_lead_view.xml | 3 ++- addons/email_template/res_partner_view.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 39c9a5b98f5..4c055ce1436 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -341,9 +341,10 @@ + - + diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index 7e494bd5054..c6331ebf514 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -18,8 +18,9 @@ + + help="Leads that did not ask not to be included in mass mailing campaigns" /> From 3dc1a58ed5906212a52c376b62cff69d9ac4ec78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:12:21 +0100 Subject: [PATCH 39/97] [FIX] crm, email_template: fixed help messages talking about partners and leads instead of leads and partners... well, I think this comment is not very understandable, but at least there is a commit message. Horray. bzr revid: tde@openerp.com-20130313121221-lo0kmkt2lltyr94e --- addons/crm/crm_lead.py | 2 +- addons/email_template/res_partner_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 7ab9f110a7b..d0be688c8a5 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -261,7 +261,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner company that will be created while converting the lead into opportunity', select=1), 'opt_out': fields.boolean('Opt-Out', oldname='optout', help="If opt-out is checked, this contact has refused to receive emails for mass mailing and marketing campaign. " - "Filter 'Available for Mass Mailing' allows users to filter the partners when performing mass mailing."), + "Filter 'Available for Mass Mailing' allows users to filter the leads when performing mass mailing."), 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), diff --git a/addons/email_template/res_partner_view.xml b/addons/email_template/res_partner_view.xml index c6331ebf514..1da3681d3af 100644 --- a/addons/email_template/res_partner_view.xml +++ b/addons/email_template/res_partner_view.xml @@ -20,7 +20,7 @@ + help="Partners that did not ask not to be included in mass mailing campaigns" /> From ecd460e0d5a534af2a2536786b401c84267db40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:16:59 +0100 Subject: [PATCH 40/97] [IMP] email_template: improved help for email_from. bzr revid: tde@openerp.com-20130313121659-pvdy814zoq9zonf2 --- addons/email_template/email_template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 280e44fa2fb..08ef3ec6e98 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -142,7 +142,9 @@ class email_template(osv.osv): help="If checked, the user's signature will be appended to the text version " "of the message"), 'subject': fields.char('Subject', translate=True, help="Subject (placeholders may be used here)",), - 'email_from': fields.char('From', help="Sender address (placeholders may be used here)"), + 'email_from': fields.char('From', + help="Sender address (placeholders may be used here). If not set, the default " + "value will be the author's email alias if configured, or email address."), 'email_to': fields.char('To (Emails)', help="Comma-separated recipient addresses (placeholders may be used here)"), 'email_recipients': fields.char('To (Partners)', help="Comma-separated ids of recipient partners (placeholders may be used here)"), 'email_cc': fields.char('Cc', help="Carbon copy recipients (placeholders may be used here)"), From 3b989b2c57f8aeb2d8bb92ec6338b862458d9641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 13 Mar 2013 13:26:32 +0100 Subject: [PATCH 41/97] [FIX] mail_message: fixed strings and names for read/unread filters. bzr revid: tde@openerp.com-20130313122632-bwsz0pss88z0ups2 --- addons/mail/mail_message_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml index 7d2e9483773..8f2fb3f1020 100644 --- a/addons/mail/mail_message_view.xml +++ b/addons/mail/mail_message_view.xml @@ -59,12 +59,12 @@ - - + Date: Wed, 13 Mar 2013 13:43:17 +0100 Subject: [PATCH 42/97] account: [FIX] Removes the unneeded second cancel button on supplier invoices bzr revid: cbi@openerp.com-20130313124317-4ug3gvlnocmc50ko --- addons/account/account_invoice_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 3d46ee8365a..8c7cec67ac5 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -146,7 +146,6 @@
From 1b8891dd955c3789754e9b2b450732097e0cbf1c Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Thu, 14 Mar 2013 11:30:17 +0100 Subject: [PATCH 60/97] [Revert]auth_signup: should be done here bzr revid: dle@openerp.com-20130314103017-g0dps4lx151unu6o --- addons/auth_signup/res_users_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index 27559ea5198..be9942feac2 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -21,7 +21,7 @@
-
From dbed9bdb7586c14e3cf528cab7ac935c62a90a82 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 14 Mar 2013 11:34:20 +0100 Subject: [PATCH 61/97] [FIX] auth_signup: only automatically show signup if signup is enabled bzr revid: chs@openerp.com-20130314103420-tkr1wklrf85vux7o --- addons/auth_signup/static/src/js/auth_signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js index fe071fde55d..bbaf907c625 100644 --- a/addons/auth_signup/static/src/js/auth_signup.js +++ b/addons/auth_signup/static/src/js/auth_signup.js @@ -56,7 +56,7 @@ openerp.auth_signup = function(instance) { self.rpc("/auth_signup/get_config", {dbname: dbname}).done(function(result) { self.signup_enabled = result.signup; self.reset_password_enabled = result.reset_password; - if (self.$("form input[name=login]").val()){ + if (!self.signup_enabled || self.$("form input[name=login]").val()){ self.set('login_mode', 'default'); } else { self.set('login_mode', 'signup'); From 1bc43748ee85c95c49aa79a7f653f71d46408f7c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 14 Mar 2013 11:52:13 +0100 Subject: [PATCH 62/97] [ADD] `hide_breadcrumb` option bzr revid: fme@openerp.com-20130314105213-13dtn26c773qsu7a --- addons/web/static/src/js/views.js | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 1ba65f7ec18..7b2fc87aa97 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -149,6 +149,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ for (var i = 0; i < this.breadcrumbs.length; i += 1) { var item = this.breadcrumbs[i]; var tit = item.get_title(); + if (item.hide_breadcrumb) { + continue; + } if (!_.isArray(tit)) { tit = [tit]; } @@ -282,6 +285,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ * @param {Object} [options] * @param {Boolean} [options.clear_breadcrumbs=false] Clear the breadcrumbs history list * @param {Function} [options.on_reverse_breadcrumb] Callback to be executed whenever an anterior breadcrumb item is clicked on. + * @param {Function} [options.hide_breadcrumb] Do not display this widget's title in the breadcrumb * @param {Function} [options.on_close] Callback to be executed when the dialog is closed (only relevant for target=new actions) * @param {Function} [options.action_menu_id] Manually set the menu id on the fly. * @param {Object} [options.additional_context] Additional context to be merged with the action's context. @@ -291,6 +295,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ options = _.defaults(options || {}, { clear_breadcrumbs: false, on_reverse_breadcrumb: function() {}, + hide_breadcrumb: false, on_close: function() {}, action_menu_id: null, additional_context: {}, @@ -403,7 +408,12 @@ instance.web.ActionManager = instance.web.Widget.extend({ widget: function () { return new instance.web.ViewManagerAction(self, action); }, action: action, klass: 'oe_act_window', - post_process: function (widget) { widget.add_breadcrumb(options.on_reverse_breadcrumb); } + post_process: function (widget) { + widget.add_breadcrumb({ + on_reverse_breadcrumb: options.on_reverse_breadcrumb, + hide_breadcrumb: options.hide_breadcrumb, + }); + }, }, options); }, ir_actions_client: function (action, options) { @@ -427,6 +437,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ widget: widget, title: action.name, on_reverse_breadcrumb: options.on_reverse_breadcrumb, + hide_breadcrumb: options.hide_breadcrumb, }); if (action.tag !== 'reload') { self.do_push_state({}); @@ -649,7 +660,15 @@ instance.web.ViewManager = instance.web.Widget.extend({ set_title: function(title) { this.$el.find('.oe_view_title_text:first').text(title); }, - add_breadcrumb: function(on_reverse_breadcrumb) { + add_breadcrumb: function(options) { + var options = options || {}; + // 7.0 backward compatibility + if (typeof options == 'function') { + options = { + on_reverse_breadcrumb: options + }; + } + // end of 7.0 backward compatibility var self = this; var views = [this.active_view || this.views_src[0].view_type]; this.on('switch_mode', self, function(mode) { @@ -661,7 +680,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ views.push(mode); } }); - this.getParent().push_breadcrumb({ + var item = _.extend({ widget: this, action: this.action, show: function(index) { @@ -695,9 +714,9 @@ instance.web.ViewManager = instance.web.Widget.extend({ titles.pop(); } return titles; - }, - on_reverse_breadcrumb: on_reverse_breadcrumb, - }); + } + }, options); + this.getParent().push_breadcrumb(item); }, /** * Returns to the view preceding the caller view in this manager's From 829961c05d8a0c977f8bfd4dad18264b71118cfa Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 14 Mar 2013 11:56:05 +0100 Subject: [PATCH 63/97] [IMP] project_issue, usability: added description on the search critera of the search bar in issues, moved partner_id field as a distinct facet, added a group on the new button to jump on issues from a partner bzr revid: qdp-launchpad@openerp.com-20130314105605-sdvpg1vt3yfe0g5x --- addons/project_issue/project_issue_view.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 3d7256dfb7a..0ffc54aaa34 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -156,7 +156,7 @@ project.issue - + @@ -164,6 +164,7 @@ + @@ -373,7 +374,7 @@