Fix and tested

This commit is contained in:
Nicolás 2016-11-15 23:11:21 +00:00
parent 34e0bb42c6
commit b74597deac
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,6 @@
<odoo>
<template id="assets_backend" name="google_drive assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/document_url/static/src/css/url.css" type="text/css"/>
<script type="text/javascript" src="/document_url/static/src/js/url.js"></script>
</xpath>
</template>

View File

@ -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'}
attachment_obj.create(attachment)
return False