Fix update attachment

This commit is contained in:
Nicolás 2016-11-15 22:45:27 +00:00
parent 3c0ed6b98b
commit 65e4a1998f
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<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"/>
@ -34,5 +33,4 @@
</form>
</field>
</record>
</data>
</odoo>

View File

@ -19,7 +19,9 @@ class AddUrlWizard(models.TransientModel):
@api.multi
def action_add_url(self):
"""Adds the URL with the given name as an ir.attachment record."""
if not self._context.get('active_model'):
return
for form in self:
url = urlparse(form.url)
if not url.scheme: