Skip to content

Instantly share code, notes, and snippets.

View test.py
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
index.conf: |
server {
listen 80;
server_name _;
@findsomeoneyys
findsomeoneyys / assets.xml
Last active Apr 9, 2020
在树视图中添加禁止print打印,引入js后在tree view 增加print="false"
View assets.xml
<?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 / controller.py
Last active Jan 20, 2020
odoo multifile upload
View controller.py
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