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"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<template id="assets_backend" name="google_drive assets" inherit_id="web.assets_backend"> <template id="assets_backend" name="google_drive assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<link rel="stylesheet" href="/document_url/static/src/css/url.css" type="text/css"/> <link rel="stylesheet" href="/document_url/static/src/css/url.css" type="text/css"/>
@ -34,5 +33,4 @@
</form> </form>
</field> </field>
</record> </record>
</data>
</odoo> </odoo>

View File

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