Skip to content

Instantly share code, notes, and snippets.

Trik ini banyak yang nyari2 tapi blm ketemu solusinya bahkan di stackoverflow dan forum odoo. Beruntung anda jadi orang Indonesia :)

Pada lingkungan multi-company, ada kasus dimana tampilan data tree view (misalnya res.partner) harus di filter berdasarkan company_id user yang sedang login, tapi tidak bisa dilakukan dengan record rule, karena data tersebut memang mesti bisa dibaca oleh semua user.

Jika menggunakan record rules, setup-nya sangat mudah, yaitu tinggal membuat record rules atas suatu group dengan domain sbb atas object res.partner:

[('company_id', '=', user.company_id)]
import { createApi, fetchBaseQuery } from '@rtk-incubator/rtk-query';
export const api = createApi({
reducerPath: 'api',
baseQuery: fetchBaseQuery({
baseUrl: process.env.REACT_APP_API_URL,
prepareHeaders(headers) {
const token = localStorage.getItem('accessToken');
if (token) {
apiVersion: v1
kind: ConfigMap
metadata:
name: odoo-conf
data:
web: |
[options]
server_wide_modules = web
max_cron_threads = 0
import React from 'react';
import { StyleSheet, View, ViewProps, ViewStyle } from 'react-native';
import { ButtonElement } from '@ui-kitten/components';
interface ButtonSwitchProps extends ViewProps {
fullWidth?: boolean;
children: ButtonElement[];
selectedIndex: number;
onSelect: (index: number) => void;
}
@Semo
Semo / Howto_Zsh5-6-2_Centos7.md
Last active May 9, 2024 07:36
How to install Zsh version 5.6.2 into CentOS 7

How to install Zsh version 5.6.2 into CentOS 7

Given that you have a clean installation of CentOS 7 which was already updated, by you, then you still have some dependencies to install make and install the external Zsh from the source. You must be root to get the stuff done.

Install GCC Development Tools

yum groupinstall "Development tools"

Check if it's working

@cvan
cvan / set-up-chromium-keys.md
Last active March 19, 2024 10:44
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@hofrob
hofrob / filter
Last active December 1, 2023 06:16
Odoo Logstash Filter
filter {
if [type] == "odoo" {
grok {
match => { "message" => "%{ODOOLOG}" }
}
date {
match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS" ]
}
}
}
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@jasonngpt
jasonngpt / vim_f_key
Created October 26, 2013 02:14
Vim F key
If you press the "f" key in normal mode, Vim will move the cursor forward to whatever character you input after "f" is pressed. As an example, consider the following line:
a quick brown fox
If the cursor was at the absolute beginning of the line, and you pressed "fb" in normal mode, Vim would move the cursor so that it was positioned over the "b" in "brown".
If you press "F", Vim will move the cursor backwards instead of forward. Given the previous sentence, if pressed "Fq", and the cursor was at the end of the line, it would move to the "q" in "quick".