From b74597deac6cf287a1929c6f940fb9627b7d8df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s?= Date: Tue, 15 Nov 2016 23:11:21 +0000 Subject: [PATCH] Fix and tested --- document_url/view/document_url_view.xml | 1 - document_url/wizard/document_url.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/document_url/view/document_url_view.xml b/document_url/view/document_url_view.xml index 099743c9..53825671 100644 --- a/document_url/view/document_url_view.xml +++ b/document_url/view/document_url_view.xml @@ -2,7 +2,6 @@ diff --git a/document_url/wizard/document_url.py b/document_url/wizard/document_url.py index 649ae726..0731ad6d 100644 --- a/document_url/wizard/document_url.py +++ b/document_url/wizard/document_url.py @@ -22,6 +22,7 @@ class AddUrlWizard(models.TransientModel): if not self._context.get('active_model'): return + attachment_obj = self.env['ir.attachment'] for form in self: url = urlparse(form.url) if not url.scheme: @@ -34,5 +35,5 @@ class AddUrlWizard(models.TransientModel): 'res_id': active_id, 'res_model': self._context.get('active_model') } - self.env['ir.attachment'].create(attachment) - return {'type': 'ir.actions.act_close_wizard_and_reload_view'} \ No newline at end of file + attachment_obj.create(attachment) + return False \ No newline at end of file