diff --git a/addons/portal_customer/__init__.py b/addons/portal_customer/__init__.py new file mode 100644 index 00000000000..4a812a97cb5 --- /dev/null +++ b/addons/portal_customer/__init__.py @@ -0,0 +1,24 @@ +# -*- 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 portal_customer + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal_customer/__openerp__.py b/addons/portal_customer/__openerp__.py new file mode 100644 index 00000000000..a3d1005c7f6 --- /dev/null +++ b/addons/portal_customer/__openerp__.py @@ -0,0 +1,45 @@ +# -*- 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 . +# +############################################################################## + +{ + 'name' : "Portal Customer", + 'version' : "1.0", + 'depends' : ["sale"], + 'author' : "OpenERP SA", + 'category': 'Portal', + 'description': """ + The Portal Customer module helps customers to track their Sales Quotations, Orders, Invoices and various + other possibilities + """, + 'website': 'http://www.openerp.com', + 'data': [ + ], + "init_xml" : [ + ], + "demo_xml" : [ + ], + "update_xml" : [ + "portal_customer_view.xml" + ], + 'installable': True, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal_customer/portal_customer.py b/addons/portal_customer/portal_customer.py new file mode 100644 index 00000000000..afa27aba44b --- /dev/null +++ b/addons/portal_customer/portal_customer.py @@ -0,0 +1,41 @@ +# -*- 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 +from tools.translate import _ +import time + +class res_partner(osv.osv): + + _inherit = 'res.partner' + _columns = { + 'customer_portal_access': fields.boolean('Portal'), + } + + def onchange_portal_create_user(self, cr, uid, ids, field, context=None): + res_users_obj = self.pool.get('res.users') + if field == 1: + name = self.browse(cr, uid, ids, context=context)[0].name + login = self.browse(cr, uid, ids, context=context)[0].email + res_users_obj.create(cr, uid, {'name':name, 'login':login, 'new_password':login}, context=context) + return True + +res_partner() \ No newline at end of file diff --git a/addons/portal_customer/portal_customer_view.xml b/addons/portal_customer/portal_customer_view.xml new file mode 100644 index 00000000000..06f88f635cd --- /dev/null +++ b/addons/portal_customer/portal_customer_view.xml @@ -0,0 +1,36 @@ + + + + + + + + + res.partner.form + res.partner + + form + + + + + + + + + Contacts + res.partner + form + tree,form + + + + + + + + + + \ No newline at end of file