1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>
20 ##############################################################################
23 from osv import fields
25 class transient_update_maildomain(orm.TransientModel):
27 _name = "transient.update.maildomain"
28 _description = "Update Mail Domain"
30 'name' : fields.text('Domain', required=True),
32 def update_domain(self, cr, uid, ids, context=None):
33 config_parameter_pool = self.pool.get("ir.config_parameter")
34 for record in self.browse(cr, uid, ids, context):
35 config_parameter_pool.set_param(cr, uid, "mail.catchall.domain", record.name, context)
36 return {'type': 'ir.actions.act_window_close'}