-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
+
+
+ Meet the team
+ portal_crm.crm_contact_us
+
+ form
+ form
+ Here you can see our employees' public profile, if any
+
+
+
+
diff --git a/addons/portal_project_issue/portal_project_issue_view.xml b/addons/portal_project_issue/portal_project_issue_view.xml
index 6502d92b4dc..5a88e54a00b 100644
--- a/addons/portal_project_issue/portal_project_issue_view.xml
+++ b/addons/portal_project_issue/portal_project_issue_view.xml
@@ -75,8 +75,8 @@
Click to create an issue.
- OpenERP's kanban view will help you track easily your current
- pipeline of issues to fix.
+ You can track your claims from this menu and the action we
+ will take.
diff --git a/addons/portal_sale/portal_sale_view.xml b/addons/portal_sale/portal_sale_view.xml
index b46175f7feb..216cc828835 100644
--- a/addons/portal_sale/portal_sale_view.xml
+++ b/addons/portal_sale/portal_sale_view.xml
@@ -13,7 +13,7 @@
tree,form,calendar,graph
{"search_default_draft":1}
-
You don't have any quotation.
+
We haven't sent you any quotation.
@@ -23,7 +23,7 @@
tree,form,calendar,graph
{"search_default_sales":1}
- You don't have any sale order.
+ We haven't sent you any sale order.
@@ -34,18 +34,7 @@
[('type','=','out')]
{'default_type': 'out', 'contact_display': 'partner_address'}
- You don't have any delivery order.
-
-
-
- Products
- ir.actions.act_window
- product.product
- form
- kanban,tree,form
-
-
- There are no public products.
+ We haven't sent you any delivery order.
@@ -55,7 +44,7 @@
[('type','=','out_invoice')]
{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}
- You don't have any invoice.
+ We haven't sent you any invoice.
@@ -65,7 +54,7 @@
{'type':'receipt'}
current
- You don't have any refunds or payments.
+ We haven't sent you any credit note.
-
-
-
+
+
From e92a31e2bb365a1453d555bbf8d18069ed94299a Mon Sep 17 00:00:00 2001
From: "vta vta@openerp.com" <>
Date: Fri, 16 Nov 2012 08:57:44 +0100
Subject: [PATCH 02/31] [IMP] Now portal users can subscribe to public content.
bzr revid: vta@openerp.com-20121116075744-tclpsjxi1ut6wvh8
---
addons/mail/mail_thread.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index ee1a015396b..4f7871ca961 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -796,11 +796,12 @@ class mail_thread(osv.AbstractModel):
def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None):
""" Add partners to the records followers. """
- self.write(cr, uid, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context)
+ self.check_access_rights(cr, uid, 'read')
+ self.write(cr, SUPERUSER_ID, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context)
# if subtypes are not specified (and not set to a void list), fetch default ones
if subtype_ids is None:
subtype_obj = self.pool.get('mail.message.subtype')
- subtype_ids = subtype_obj.search(cr, uid, [('default', '=', True), '|', ('res_model', '=', self._name), ('res_model', '=', False)], context=context)
+ subtype_ids = subtype_obj.search(cr, SUPERUSER_ID, [('default', '=', True), '|', ('res_model', '=', self._name), ('res_model', '=', False)], context=context)
# update the subscriptions
fol_obj = self.pool.get('mail.followers')
fol_ids = fol_obj.search(cr, SUPERUSER_ID, [('res_model', '=', self._name), ('res_id', 'in', ids), ('partner_id', 'in', partner_ids)], context=context)
From ed3c46aa6f973f65d6df0db295ec529789e927e4 Mon Sep 17 00:00:00 2001
From: "vta vta@openerp.com" <>
Date: Fri, 16 Nov 2012 11:30:48 +0100
Subject: [PATCH 03/31] [FIX] Move required to the view.
bzr revid: vta@openerp.com-20121116103048-0ervln9ekqly89qx
---
addons/portal_crm/wizard/contact.py | 4 ++--
addons/portal_crm/wizard/contact_view.xml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/portal_crm/wizard/contact.py b/addons/portal_crm/wizard/contact.py
index 65de0c96226..09605257a5a 100644
--- a/addons/portal_crm/wizard/contact.py
+++ b/addons/portal_crm/wizard/contact.py
@@ -28,8 +28,8 @@ class crm_contact_us(osv.TransientModel):
_description = 'Contact form for the portal'
_inherit = 'crm.lead'
_columns = {
- 'subject' : fields.char('Subject', required=True),
- 'body' : fields.text('Content', required=True),
+ 'subject' : fields.char('Subject'),
+ 'body' : fields.text('Content'),
'company_ids' : fields.many2many('res.company', string='Companies', readonly=True),
}
diff --git a/addons/portal_crm/wizard/contact_view.xml b/addons/portal_crm/wizard/contact_view.xml
index 70f87fe1ff8..dce8e18a69b 100644
--- a/addons/portal_crm/wizard/contact_view.xml
+++ b/addons/portal_crm/wizard/contact_view.xml
@@ -15,8 +15,8 @@
-
-
+
+
From 7541e11697c2aaff1755e995697d1029bf7da718 Mon Sep 17 00:00:00 2001
From: "vta vta@openerp.com" <>
Date: Fri, 16 Nov 2012 13:28:22 +0100
Subject: [PATCH 04/31] [ADD] Added file to manage sending invitations after
sending email invoice.
bzr revid: vta@openerp.com-20121116122822-g5v95tt7ilsmrc9n
---
addons/portal_sale/__init__.py | 1 +
addons/portal_sale/account_invoice.py | 71 +++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 addons/portal_sale/account_invoice.py
diff --git a/addons/portal_sale/__init__.py b/addons/portal_sale/__init__.py
index 26c654db9dd..f61ac2a38dd 100644
--- a/addons/portal_sale/__init__.py
+++ b/addons/portal_sale/__init__.py
@@ -19,3 +19,4 @@
#
##############################################################################
+import account_invoice
\ No newline at end of file
diff --git a/addons/portal_sale/account_invoice.py b/addons/portal_sale/account_invoice.py
new file mode 100644
index 00000000000..2f3a5e0a35c
--- /dev/null
+++ b/addons/portal_sale/account_invoice.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2011 OpenERP S.A ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields,osv
+
+class mail_mail(osv.osv):
+ _inherit = 'mail.mail'
+
+ def _postprocess_sent_message(self, cr, uid, mail, context=None):
+ if mail.model == 'account.invoice':
+ so_obj = self.pool.get('sale.order')
+ inv_obj = self.pool.get('account.invoice')
+
+ inv_follower_ids = inv_obj.read(cr, uid, mail.res_id, ['message_follower_ids'], context=context)['message_follower_ids']
+
+ cr.execute('SELECT rel.order_id FROM sale_order_invoice_rel AS rel WHERE rel.invoice_id='+str(mail.res_id))
+ so_invoice_ids = cr.fetchall()
+ so_follower_ids = []
+ for so_invoice_id in so_invoice_ids:
+ order_id, = so_invoice_id
+ so_follower_ids += so_obj.read(cr, uid, order_id, ['message_follower_ids'], context=context)['message_follower_ids']
+
+ partner_ids = list(set(so_follower_ids).difference(set(inv_follower_ids)))
+
+ if partner_ids:
+ partner_obj = self.pool.get('res.partner')
+ user_obj = self.pool.get('res.users')
+ group_obj = self.pool.get('res.groups')
+
+ document = inv_obj.browse(cr, uid, mail.res_id, context=context)
+
+ # partners = partner_obj.read(cr, uid, partner_ids, ['user_ids'], context=context)
+ # for partner in partners:
+ # users = user_obj.read(cr, uid, partner['user_ids'], ['groups_id'], context=context)
+ # for user in users:
+ # for group in group_obj.browse(cr, uid, user['groups_id'], context=context):
+ # if group.is_portal == True:
+ # print 'Hello'
+ # inv_obj.message_subscribe(cr, uid, [mail.res_id], partner_ids, context=context)
+ # mail_values = {
+ # 'email_from': 'vta@openerp.com',
+ # 'email_to': 'falcobolger@gmail.com',
+ # 'subject': 'Invitation to follow %s' % document.name_get()[0][1],
+ # 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1],
+ # 'auto_delete': True,
+ # }
+ # mail_id = self.create(cr, uid, mail_values, context=context)
+ # print mail_values
+ # self.send(cr, uid, [mail_id], recipient_ids=[partner['id']], context=context)
+
+ return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context)
+
+mail_mail()
\ No newline at end of file
From 20a50a18668592ca94f89a3654ff1486945923dd Mon Sep 17 00:00:00 2001
From: "vta vta@openerp.com" <>
Date: Fri, 16 Nov 2012 15:54:07 +0100
Subject: [PATCH 05/31] [FIX] Fixed portal_crm module structure and test.
Improved code to invite sale order followers to follow the invoice object.
bzr revid: vta@openerp.com-20121116145407-6hbv0xboq3igvt0l
---
addons/portal_crm/__init__.py | 4 +-
addons/portal_crm/__openerp__.py | 4 +-
addons/portal_crm/{wizard => }/contact.py | 14 +++----
.../portal_crm/{wizard => }/contact_view.xml | 18 ++++-----
addons/portal_crm/test/contact_form.yml | 4 +-
addons/portal_crm/wizard/__init__.py | 22 -----------
addons/portal_sale/account_invoice.py | 37 +++++++++----------
7 files changed, 38 insertions(+), 65 deletions(-)
rename addons/portal_crm/{wizard => }/contact.py (91%)
rename addons/portal_crm/{wizard => }/contact_view.xml (87%)
delete mode 100644 addons/portal_crm/wizard/__init__.py
diff --git a/addons/portal_crm/__init__.py b/addons/portal_crm/__init__.py
index 6b791be9f25..92b3ac62321 100644
--- a/addons/portal_crm/__init__.py
+++ b/addons/portal_crm/__init__.py
@@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2011 OpenERP S.A ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -19,4 +19,4 @@
#
##############################################################################
-import wizard
+import contact
diff --git a/addons/portal_crm/__openerp__.py b/addons/portal_crm/__openerp__.py
index 1516ab13961..2eaa829e88a 100644
--- a/addons/portal_crm/__openerp__.py
+++ b/addons/portal_crm/__openerp__.py
@@ -31,7 +31,9 @@ This module adds a contact page (with a contact form creating a lead when submit
""",
'author': 'OpenERP SA',
'depends': ['crm','portal'],
- 'data': ['wizard/contact_view.xml'],
+ 'data': [
+ 'contact_view.xml',
+ ],
'test': [
'test/contact_form.yml',
],
diff --git a/addons/portal_crm/wizard/contact.py b/addons/portal_crm/contact.py
similarity index 91%
rename from addons/portal_crm/wizard/contact.py
rename to addons/portal_crm/contact.py
index 09605257a5a..3beed3b3282 100644
--- a/addons/portal_crm/wizard/contact.py
+++ b/addons/portal_crm/contact.py
@@ -22,14 +22,12 @@
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
-class crm_contact_us(osv.TransientModel):
+class contact(osv.TransientModel):
""" Create new leads through the "contact us" form """
- _name = 'portal_crm.crm_contact_us'
+ _name = 'contact'
_description = 'Contact form for the portal'
_inherit = 'crm.lead'
_columns = {
- 'subject' : fields.char('Subject'),
- 'body' : fields.text('Content'),
'company_ids' : fields.many2many('res.company', string='Companies', readonly=True),
}
@@ -85,7 +83,7 @@ class crm_contact_us(osv.TransientModel):
Since they are potentially sensitive, we don't want any user to be able
to read datas generated through this module. Therefore we'll write
these information directly in the crm.lead table and leave blank
- entries in the portal_crm.crm_contact_us table.
+ entries in the contact table.
This is why the create() method is overwritten.
"""
crm_lead = self.pool.get('crm.lead')
@@ -98,17 +96,15 @@ class crm_contact_us(osv.TransientModel):
Therefore, user SUPERUSER_ID will perform the creation.
"""
print values
- values['name'] = values['subject']
values['contact_name'] = values['partner_name']
- values['description'] = values['body']
crm_lead.create(cr, SUPERUSER_ID, dict(values,user_id=False), context)
"""
- Create an empty record in the portal_crm.crm_contact_us table.
+ Create an empty record in the contact table.
Since the 'name' field is mandatory, give an empty string to avoid an integrity error.
"""
empty_values = dict((k, False) if k != 'name' else (k, '') for k, v in values.iteritems())
- return super(crm_contact_us, self).create(cr, uid, empty_values)
+ return super(contact, self).create(cr, uid, empty_values)
def submit(self, cr, uid, ids, context=None):
""" When the form is submitted, redirect the user to a "Thanks" message """
diff --git a/addons/portal_crm/wizard/contact_view.xml b/addons/portal_crm/contact_view.xml
similarity index 87%
rename from addons/portal_crm/wizard/contact_view.xml
rename to addons/portal_crm/contact_view.xml
index dce8e18a69b..25216d9ff29 100644
--- a/addons/portal_crm/wizard/contact_view.xml
+++ b/addons/portal_crm/contact_view.xml
@@ -3,10 +3,10 @@
- Wizard form view
- portal_crm.crm_contact_us
+ Contact form
+ contact
-
-
@@ -67,7 +65,7 @@
Wizard thanks message
- portal_crm.crm_contact_us
+ contact
99
@@ -85,7 +83,7 @@
Contact Us
- portal_crm.crm_contact_us
+ contact
form
inline
diff --git a/addons/portal_crm/test/contact_form.yml b/addons/portal_crm/test/contact_form.yml
index 7ba93a9e831..e36a7118499 100644
--- a/addons/portal_crm/test/contact_form.yml
+++ b/addons/portal_crm/test/contact_form.yml
@@ -6,7 +6,7 @@
-
As a portal user, I fill in the contact form and submit it.
-
- !record {model: portal_crm.crm_contact_us, id: contact_us_01}:
+ !record {model: contact, id: contact_us_01}:
name: 'Need information about your contact form module'
partner_name: 'Mr. John Doe'
email_from: 'mister@john.doe'
@@ -15,7 +15,7 @@
-
For security reasons, the wizard values is empty.
-
- !python {model: portal_crm.crm_contact_us}: |
+ !python {model: contact}: |
obj = self.browse(cr, uid, ref("contact_us_01"))
assert not(obj.name or obj.partner_name or obj.email_from or obj.phone or obj.description), 'All the wizard\'s values are not empty'
-
diff --git a/addons/portal_crm/wizard/__init__.py b/addons/portal_crm/wizard/__init__.py
deleted file mode 100644
index 92b3ac62321..00000000000
--- a/addons/portal_crm/wizard/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2011 OpenERP S.A ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import contact
diff --git a/addons/portal_sale/account_invoice.py b/addons/portal_sale/account_invoice.py
index 2f3a5e0a35c..4d7fece7a2c 100644
--- a/addons/portal_sale/account_invoice.py
+++ b/addons/portal_sale/account_invoice.py
@@ -46,25 +46,24 @@ class mail_mail(osv.osv):
group_obj = self.pool.get('res.groups')
document = inv_obj.browse(cr, uid, mail.res_id, context=context)
-
- # partners = partner_obj.read(cr, uid, partner_ids, ['user_ids'], context=context)
- # for partner in partners:
- # users = user_obj.read(cr, uid, partner['user_ids'], ['groups_id'], context=context)
- # for user in users:
- # for group in group_obj.browse(cr, uid, user['groups_id'], context=context):
- # if group.is_portal == True:
- # print 'Hello'
- # inv_obj.message_subscribe(cr, uid, [mail.res_id], partner_ids, context=context)
- # mail_values = {
- # 'email_from': 'vta@openerp.com',
- # 'email_to': 'falcobolger@gmail.com',
- # 'subject': 'Invitation to follow %s' % document.name_get()[0][1],
- # 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1],
- # 'auto_delete': True,
- # }
- # mail_id = self.create(cr, uid, mail_values, context=context)
- # print mail_values
- # self.send(cr, uid, [mail_id], recipient_ids=[partner['id']], context=context)
+ group_ids = []
+ for partner in partner_obj.browse(cr, uid, partner_ids, context=context):
+ for user_id in partner.user_ids:
+ group_ids += user_id.groups_id
+ if group_ids:
+ for group_id in group_ids:
+ if group_id.is_portal == True:
+ inv_obj.message_subscribe(cr, uid, [mail.res_id], partner_ids, context=context)
+ mail_values = {
+ 'email_from': 'vta@openerp.com',
+ 'email_to': 'falcobolger@gmail.com',
+ 'subject': 'Invitation to follow %s' % document.name_get()[0][1],
+ 'body_html': 'You have been invited to follow %s' % document.name_get()[0][1],
+ 'auto_delete': True,
+ }
+ mail_id = self.create(cr, uid, mail_values, context=context)
+ self.send(cr, uid, [mail_id], recipient_ids=[partner['id']], context=context)
+ group_ids = []
return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context)
From 73750e33b943cb6167268bfff49116d0f7234176 Mon Sep 17 00:00:00 2001
From: "vta vta@openerp.com" <>
Date: Tue, 20 Nov 2012 08:39:48 +0100
Subject: [PATCH 06/31] [FIX] Removed password from sent email. Fixed naming in
order to pass runbot's test.
bzr revid: vta@openerp.com-20121120073948-1ojettqx7mjb1k75
---
addons/portal/wizard/portal_wizard.py | 6 ------
addons/portal_crm/contact.py | 6 +++---
addons/portal_crm/contact_view.xml | 14 +++++++-------
addons/portal_crm/test/contact_form.yml | 4 ++--
4 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index 545b771e762..485aa941434 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -39,7 +39,6 @@ You have been given access to %(portal)s.
Your login account data is:
Database: %(db)s
Username: %(login)s
-Password: %(password)s
In order to complete the signin process, click on the following url:
%(url)s
@@ -51,10 +50,6 @@ OpenERP - Open Source Business Applications
http://www.openerp.com
""")
-def random_password():
- # temporary random stuff; user password is reset by signup process
- chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
- return ''.join(random.choice(chars) for i in xrange(12))
def extract_email(email):
""" extract the email address from a user-friendly email address """
@@ -181,7 +176,6 @@ class wizard_user(osv.osv_memory):
create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation
values = {
'login': extract_email(wizard_user.email),
- 'password': random_password(),
'partner_id': wizard_user.partner_id.id,
'groups_id': [(6, 0, [])],
'share': True,
diff --git a/addons/portal_crm/contact.py b/addons/portal_crm/contact.py
index 3beed3b3282..c4d4e1d7f8c 100644
--- a/addons/portal_crm/contact.py
+++ b/addons/portal_crm/contact.py
@@ -22,9 +22,9 @@
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
-class contact(osv.TransientModel):
+class crm_contact_us(osv.TransientModel):
""" Create new leads through the "contact us" form """
- _name = 'contact'
+ _name = 'portal_crm.crm_contact_us'
_description = 'Contact form for the portal'
_inherit = 'crm.lead'
_columns = {
@@ -104,7 +104,7 @@ class contact(osv.TransientModel):
Since the 'name' field is mandatory, give an empty string to avoid an integrity error.
"""
empty_values = dict((k, False) if k != 'name' else (k, '') for k, v in values.iteritems())
- return super(contact, self).create(cr, uid, empty_values)
+ return super(crm_contact_us, self).create(cr, uid, empty_values)
def submit(self, cr, uid, ids, context=None):
""" When the form is submitted, redirect the user to a "Thanks" message """
diff --git a/addons/portal_crm/contact_view.xml b/addons/portal_crm/contact_view.xml
index 25216d9ff29..0241259a82a 100644
--- a/addons/portal_crm/contact_view.xml
+++ b/addons/portal_crm/contact_view.xml
@@ -4,7 +4,7 @@
Contact form
- contact
+ portal_crm.crm_contact_us
+