Some fixes

This commit is contained in:
Pedro M. Baeza 2014-09-11 16:06:21 +02:00
parent 8cf1e5aa80
commit a522eccebc
2 changed files with 6 additions and 7 deletions

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -25,6 +25,7 @@ try:
except: except:
from urlparse import urlparse from urlparse import urlparse
class AddUrlWizard(orm.TransientModel): class AddUrlWizard(orm.TransientModel):
_name = 'ir.attachment.add_url' _name = 'ir.attachment.add_url'
@ -34,9 +35,7 @@ class AddUrlWizard(orm.TransientModel):
} }
def action_add_url(self, cr, uid, ids, context=None): def action_add_url(self, cr, uid, ids, context=None):
""" """Adds the URL with the given name as an ir.attachment record."""
Adds the URL with the given name as an ir.attachment record.
"""
if context is None: if context is None:
context = {} context = {}
if not context.get('active_model'): if not context.get('active_model'):
@ -56,4 +55,4 @@ class AddUrlWizard(orm.TransientModel):
'res_model': context['active_model'], 'res_model': context['active_model'],
} }
attachment_obj.create(cr, uid, attachment, context=context) attachment_obj.create(cr, uid, attachment, context=context)
return { 'type' : 'ir.actions.act_close_wizard_and_reload_view' } return {'type': 'ir.actions.act_close_wizard_and_reload_view'}