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