Skip to content

Instantly share code, notes, and snippets.

@rbikbov
rbikbov / asd
Created October 31, 2018 10:06
@classmethod
def binary_content(cls, xmlid=None, model='ir.attachment', id=None, field='datas',
unique=False, filename=None, filename_field='datas_fname', download=False,
mimetype=None, default_mimetype='application/octet-stream',
access_token=None, related_id=None, access_mode=None, env=None):
""" Get file, attachment or downloadable content
If the ``xmlid`` and ``id`` parameter is omitted, fetches the default value for the
binary field (via ``default_get``), otherwise fetches the field for
that precise record.
:param str xmlid: xmlid of the record
@classmethod
def binary_content(cls, xmlid=None, model='ir.attachment', id=None, field='datas',
unique=False, filename=None, filename_field='datas_fname', download=False,
mimetype=None, default_mimetype='application/octet-stream',
access_token=None, env=None):
""" Get file, attachment or downloadable content
If the ``xmlid`` and ``id`` parameter is omitted, fetches the default value for the
binary field (via ``default_get``), otherwise fetches the field for
that precise record.
:param str xmlid: xmlid of the record
{
"swagger":"2.0",
"info":{
"version":"1.0.0",
"title":"Swagger Sample App"
},
"host":"localhost:8069",
"basePath":"/api/v1/test",
"schemes":[
"http"
{
"swagger":"2.0",
"info":{
"version":"1.0.0",
"title":"Swagger Sample App"
},
"host":"localhost:8069",
"basePath":"/api/v1/test",
"schemes":[
"http"
{
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline"
}
},
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"git.autofetch": true,
@rbikbov
rbikbov / test
Last active September 16, 2017 11:45
const info = {};
info.name = document.querySelector(
'div.n-product-summary__headline div.n-title__text h1'
).innerText;
info.features = Array.prototype.map.call(
document.querySelectorAll('.n-product-spec-list li'),
child => {
const [name, quantity] = child.innerText.split(':');
return { name, quantity };
}