Skip to content

Instantly share code, notes, and snippets.

@tong-odoo
tong-odoo / interactions.md
Created February 4, 2025 06:52 — forked from ged-odoo/interactions.md
Interactions

Notes on PublicWidgets and Interactions

We are refactoring the PublicWidget system in the public (website/...) javascript codebase. The initial plan was to convert them to Owl components, but after some experiments, the idea was discarded (did not feel right, also, it would prevent serving pages without Owl in the future).

See:

Silent in the nest,
@tong-odoo
tong-odoo / .code-workspace
Last active September 23, 2024 07:40
VSCode Settings
{
"folders": [
{
"name": "custom",
"path": ".."
},
{
"name": "odoo",
"path": "../../../../odoo/17.0"
},
@tong-odoo
tong-odoo / README.md
Last active April 3, 2023 02:40
Glass Expansion

Description

This is a simple example of how to use the Odoo External API in Odoo 16.0.

References

@tong-odoo
tong-odoo / terminal.sh
Created January 19, 2023 08:11
Fixing Mint Airpod Low Volumn Issue
# Description: The issue is missing profile for codec mSBC
sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt update
sudo apt install pipewire libspa-0.2-bluetooth pipewire-audio-client-libraries
systemctl --user daemon-reload
systemctl --user --now disable pulseaudio.service pulseaudio.socket
systemctl --user mask pulseaudio
systemctl --user --now enable pipewire-media-session.service
systemctl --user restart pipewire
@tong-odoo
tong-odoo / printPdf.js
Last active November 15, 2022 01:54
Javascript Example
function printPdf (url) {
let iframe = env._printIframe;
if (!env._printIframe) {
iframe = env._printIframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.style.display = 'none';
iframe.onload = function() {
iframe.focus();
iframe.contentWindow.print();
if record.seller_ids:
for index, seller in enumerate(record.seller_ids.sorted(lambda s: (s.price, -s.min_qty, s.id)), 1):
seller.update({"sequence": index})
env:
browser: true
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2020
sourceType: module
allowImportExportEverywhere: true
# Globals available in Odoo that shouldn't produce errorings
@tong-odoo
tong-odoo / biopolytech.py
Last active September 19, 2023 09:03
Project
env.cr.execute("""
UPDATE ir_ui_view SET arch_db = REPLACE(arch_db, 'x_studio_payment_date', 'x_payment_date') WHERE arch_db LIKE '%x_studio_payment_date%';
UPDATE ir_ui_view SET arch_db = REPLACE(arch_db, 'x_studio_payment_entry', 'x_payment_entry') WHERE arch_db LIKE '%x_studio_payment_entry%';
UPDATE ir_act_server SET code = REPLACE(code, 'x_studio_payment_date', 'x_payment_date') WHERE code LIKE '%x_studio_payment_date%' and id = 615;
DELETE FROM ir_model_fields WHERE name = 'x_studio_payment_date';
DELETE FROM ir_model_fields WHERE name = 'x_studio_payment_entry';
DELETE FROM base_automation WHERE id = 9;
DELETE FROM ir_actions WHERE id = 608;
""")
@tong-odoo
tong-odoo / controller.js
Last active March 13, 2022 09:32
Create js button and call odoo actions
odoo.define("manila_healthtek_stock_quant_report.InventoryReportListController", function (require) {
"use strict";
var core = require("web.core");
const InventoryReportListController = require("stock.InventoryReportListController");
var qweb = core.qweb;
const InventoryBookReportListController = InventoryReportListController.include({
renderButtons: function ($node) {