diff --git a/document_url/README.rst b/document_url/README.rst index 833cf082..9f97ed99 100644 --- a/document_url/README.rst +++ b/document_url/README.rst @@ -41,8 +41,6 @@ Contributors * Jonathan Nemry * Pedro M. Baeza -* Nicolás Ramos -* Antonio Cánovas Maintainer ---------- diff --git a/document_url/static/src/xml/url.xml b/document_url/static/src/xml/url.xml index 8d5a3dfa..b76722d3 100644 --- a/document_url/static/src/xml/url.xml +++ b/document_url/static/src/xml/url.xml @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/document_url/wizard/document_url.py b/document_url/wizard/document_url.py index 932060f7..5583fbaa 100644 --- a/document_url/wizard/document_url.py +++ b/document_url/wizard/document_url.py @@ -21,20 +21,20 @@ class AddUrlWizard(models.TransientModel): """Adds the URL with the given name as an ir.attachment record.""" context = self.env.context - if not context.get('active_model'): + if not context['active_model']: return attachment_obj = self.env['ir.attachment'] for form in self: url = urlparse(form.url) if not url.scheme: url = urlparse('%s%s' % ('http://', form.url)) - for active_id in context.get('active_ids', []): + for active_id in context['active_ids', []]: attachment = { 'name': form.name, 'type': 'url', 'url': url.geturl(), 'res_id': active_id, - 'res_model': context.get('active_model') + 'res_model': context['active_model'] } attachment_obj.create(attachment) return False