Skip to content

Instantly share code, notes, and snippets.

View ray-odoo's full-sized avatar
💭
Spreading purple around the world!

Ray Carnes ray-odoo

💭
Spreading purple around the world!
View GitHub Profile
@ray-odoo
ray-odoo / odoo_versions.md
Created February 23, 2025 20:08 — forked from mao-odoo/odoo_versions.md
Odoo version timeline - saas vs main version

Current Versions

Major Version SaaS Version Official Release Date Planned End of life Bug fix New On Premise New Odoo Online New Odoo.sh
16.0 October 12th 2022 Q4 2025 🔴
saas-16.1 February 2023 June 2023 🔴 🔴 🔴 🔴
saas-16.2 March 2023 Q4 2023 🔴 🔴 🔴 🔴
saas-16.3 June 2023 Q4 2023 🔴 :red_circ
@ray-odoo
ray-odoo / po_lines.xml
Created February 14, 2025 13:08
Purchase Order Lines Menu - Odoo 17
SEARCH VIEW:
<data>
<field name="product_id" position="after">
<field name="name"/>
</field>
<field name="partner_id" position="after">
<field name="date_planned"/>
@ray-odoo
ray-odoo / mega_script.txt
Created December 22, 2024 16:39
Script for field, model, view, window action, server action, automated action, access rights and buttons
# Odoo 16/17/18 - ray
###################
# create a record #
###################
rec = env[''].create({})
env['ir.model.data'].create({'model': '','module': 'ray_odoo_script','name': '', 'res_id': rec.id})
##############################
@ray-odoo
ray-odoo / find_the_nearest.txt
Created September 21, 2024 19:27
Contractors within 50 miles of Sales Order Delivery Address
# custom_ray_odoo
distance = 50
delivery_address = record.partner_shipping_id or record.partner_id
lat = delivery_address.partner_latitude
lng = delivery_address.partner_longitude
if lat == 0.0 or lng == 0.0:
raise UserError("Customer Address has not been geocoded!")
@ray-odoo
ray-odoo / gross_weight_to_net_weight.txt
Created September 15, 2024 13:05
Receiving NET Weight of Seeds after Weighing and Sampling
<data>
<xpath expr="//notebook/page[@name='operations']/field[@name='move_ids_without_package']/tree/field[@name='product_uom_qty']"
position="after">
<field name="x_calc_quantity"
column_invisible="1"/>
<field name="x_gross_quantity"
column_invisible="parent.picking_type_code != 'incoming' or (parent.state != 'assigned' and parent.state !='done')"/>
@ray-odoo
ray-odoo / stock.picking.kanban.example.txt
Created May 14, 2024 16:25
Inherited View for adding buttons to Stock Picking Kanban
<data>
<t t-esc="record.scheduled_date.value and record.scheduled_date.value.split(' ')[0] or False"
position="before">
<button name="671"
icon="fa-calendar-minus-o"
type="action"/>
</t>
<t t-esc="record.scheduled_date.value and record.scheduled_date.value.split(' ')[0] or False"
@ray-odoo
ray-odoo / gist:06c93cec1e5fd3b154620b486234b16a
Last active April 27, 2024 18:16
Update Customer Lead Time based on longest Vendor Delivery Time
# custom_ray_odoo
# loop through all selected product(s)
for record in records:
# set lead time to default 3 days
lead_time = 3
found_vendor = False
# loop through all the vendor(s) on the purchase tab
@ray-odoo
ray-odoo / go_live_clearing_cleanup
Created November 20, 2023 08:11
Go Live with Clearing Accounts and open AR / AP
Bank Balances Clearing: (debit balance if positive, credit balance if negative)
Statement Balance - credit BB clearing, debit the outstanding receipts account
OR
Statement Balance - debit BB clearing, credit the outstanding payments account
There will be debits left in the BB clearing, based on uncleared Customer deposits
credit BB clearing, debit the outstanding receipts account
There will be credits left in the BB clearing, based on uncleared Vendor payments
debit BB clearing, credit to outstanding payments
@ray-odoo
ray-odoo / bom.lines.view.txt
Created September 17, 2023 16:22
Bill of Material Lines View - Odoo 16
<tree multi_edit="1" create="0">
<field name="company_id" invisible="1"/>
<field name="bom_id" readonly="1"/>
<field name="product_id" context="{'default_detailed_type': 'product'}"/>
<field name="product_tmpl_id" invisible="1"/>
<button name="action_see_attachments" type="object" icon="fa-files-o" aria-label="Product Attachments"
title="Product Attachments" class="float-end"/>
<field name="attachments_count" class="text-start" string=" "/>
<field name="product_qty"/>
<field name="product_uom_category_id" invisible="1"/>
@ray-odoo
ray-odoo / bank_rec_for_dummies.txt
Created August 24, 2023 14:08
Odoo 16 - Bank Reconciliation - Simplify CC rec
1) Setup two CC Journals with related accounts - via Add Bank Account
- one is for a single card holder
- one is for a corporate card with many card holders - modeled as payment methods with the top being "Select a Card"
2) Create a custom field x_payment_method_line_id on account.move.line
It is a many2one to account.payment.method.line
Related: move_id.payment_id.payment_method_line_id