Skip to content

Instantly share code, notes, and snippets.

@jaa-odoo
jaa-odoo / Ubuntu Software Install
Last active January 6, 2020 11:11
Ubuntu Software Install
1) Sublime Text 3
Step 1: sudo wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
Step 2: echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
Step 3: sudo apt-get update
Step 4: sudo apt-get install sublime-text
2) Sublime Text 3 Package Control
https://packagecontrol.io/installation
Step 1: Open Sublime Text 3
Step 2: Press "ctrl + `"
https://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx
@jaa-odoo
jaa-odoo / odoo.quant.check.health.py
Last active November 9, 2020 11:09
Odoo Stock Unreverse Odoo 12 Edition Popular issue amongst many bugs in Enterprise Edition.
"""
Email: pateljainikkumar@gmail.com
"""
quants = env['stock.quant'].search([])
warning = ''
for quant in quants:
move_lines = env["stock.move.line"].search([
('product_id', '=', quant.product_id.id),
('location_id', '=', quant.location_id.id),
@jaa-odoo
jaa-odoo / odoo.uom.decimal.accuracy.py
Last active December 18, 2024 18:23
Odoo Decimal Accuracy (DA) of "Product Unit of Measure" is set with
"""
Email: pateljainikkumar@gmail.com
"""
# Use after Fix 1
# Especially when quantities have weird/many decimals e.g. 10.0000000001
# Decimal Accuracy for "Product Unit Of Measure" should be
# more precise than any of the UOMs' rounding precisions.
# The customer should either modify the Decimal Accuracy (e.g. to 4 digits)
# Available variables:
# - env: Odoo Environment on which the action is triggered
# - model: Odoo Model of the record on which the action is triggered; is a void recordset
# - record: record on which the action is triggered; may be void
# - records: recordset of all records on which the action is triggered in multi-mode; may be void
# - time, datetime, dateutil, timezone: useful Python libraries
# - log: log(message, level='info'): logging function to record debug information in ir.logging table
# - Warning: Warning Exception to use with raise
# To return an action, assign: action = {...}