Skip to content

Instantly share code, notes, and snippets.

@findsomeoneyys
findsomeoneyys / controller.py
Last active January 20, 2020 11:51
odoo multifile upload
class MainController(http.Controller):
@http.route('/photo_upload', type='http', csrf=False, auth='user')
def photo_update(self, **kwargs):
Ira = request.env['ir.attachment'].sudo()
//img1
image_buffer_random = kwargs['avatar'].stream.read()
image = base64.b64encode(image_buffer_random)
//img2
@findsomeoneyys
findsomeoneyys / assets.xml
Last active April 9, 2020 13:16
在树视图中添加禁止print打印,引入js后在tree view 增加print="false"
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="assets_backend_base" name="base assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/module/path/to/static/src/js/web_disable_print.js"/>
</xpath>
</template>
</data>
</odoo>
@findsomeoneyys
findsomeoneyys / test.py
Created December 2, 2020 14:27
nginx-server.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
index.conf: |
server {
listen 80;
server_name _;