# in-document URLs are html-escaped, a straight search will not
# find them
url = werkzeug.utils.escape(attachment.website_url)
- ids = Views.search(cr, uid, [('arch', 'like', url)], context=context)
+ ids = Views.search(cr, uid, ["|", ('arch', 'like', '"%s"' % url), ('arch', 'like', "'%s'" % url)], context=context)
if ids:
removal_blocked_by[attachment.id] = Views.read(
this.$('input[type=file]').click();
},
'change input[type=file]': 'file_selection',
- 'change input[type=text]': function () {
- this.$('form').submit();
- },
'submit form': 'form_submit',
//'change input.url': 'preview_image',
//'change select.image-style': 'preview_image',
<button type="button" class="btn hidden wait" disabled="disabled">Uploading...</button>
</div>
<span class="text-muted">— or —</span>
- <div class="form-group">
- <label for="iamgeurl">Image URL</label>
- <input type="text" name="url" class="form-control url" style="width: 300px;" id="iamgeurl" placeholder="http://openerp.com"/>
+ <label for="iamgeurl">Image URL</label>
+ <div class="form-group btn-group">
+ <input type="text" name="url" class="form-control url" style="width: 320px; float: left;" id="iamgeurl" placeholder="http://openerp.com"/>
+ <button class="btn btn-primary" type="submit">Add</button>
</div>
</div>
<input type="hidden" name="func"/>
- <div class="existing-attachments"/>
<div class="help-block"/>
+ <div class="existing-attachments"/>
</form>
</div>
<iframe src="about:blank" name="fileframe" class="hidden"/>