Skip to content

Instantly share code, notes, and snippets.

View llynix's full-sized avatar

Anthony Taylor llynix

View GitHub Profile
@llynix
llynix / fix-file-size.py
Created December 27, 2025 16:12
Fix file_size not being set in Odoo 17
import base64
import sys
import time
BATCH_SIZE = 50
last_id = 0
processed = 0
batch_no = 0
Attachment = env['ir.attachment'].with_context(active_test=False)
print("Starting attachment file_size backfill…")
sys.stdout.flush()
@llynix
llynix / multiple-websites.xml
Created December 27, 2025 16:11
Generating code for different websites in Odoo views
<t t-if="website.id == 1">
<!-- Content for the first website-->
</t>
<t t-if="website.id == 2">
<!-- Content for the second website-->
</t>
@llynix
llynix / model.py
Created December 27, 2025 16:08
Do not copy field when copying item in Odoo
map = fields.Monetary(string='Informative Words Here', copy=False)
@llynix
llynix / logger.py
Created December 27, 2025 16:07
Logging in Odoo
# You need to import the logger:
import logging
_logger = logging.getLogger(__name__)
# Then something like this:
_logger.info('FYI: This is happening')
@llynix
llynix / jquery-version.js
Created December 27, 2025 16:05
Get jQuery Version
console.log(jQuery().jquery);
@llynix
llynix / mount.sh
Last active December 27, 2025 15:59
Mount Windows drive on a Linux machine
sshfs -o allow_other,default_permissions "COMPUTER_NAME\USER@YOUR.IP.ADDRESS:/Users/USER/Desktop/SHARED_FOLDER" /mnt/MOUNT_POINT
@llynix
llynix / url-scrape.sh
Last active December 27, 2025 16:00
One liner to pull URL's from links
cat index.html | sed -n 's/.*href="\([^"]*\)".*/\1/p'