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 / 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
@ray-odoo
ray-odoo / hint.url
Last active August 9, 2023 02:46
Odoo Service
https://www.odoo.com/forum/help-1/odoo-10-runs-via-odoo-bin-but-cannot-get-to-run-as-a-service-is-this-a-systemd-upstart-thing-112460
/etc/systemd/system/odoo.service
[Unit]
Description=Odoo
Documentation=http://www.odoo.com/
[Service]
network:
version: 2
ethernets:
enp0s3:
addresses: [192.168.1.202/24]
@ray-odoo
ray-odoo / gist:f363fb5037c9bf0b6c69e21fd27591b9
Created July 21, 2022 22:40
Landed Cost - bringing the label from the Vendor Bill over to a custom field on the Valuation Adjustment Line
# Example Vendor Bill
Track "Track", 100 units x $10 = $1,000
Train "Train", 250 units x $7 = $1,750
Design "for Track", 1 unit x $195
Freight "for the PO", 1 unit x $595
Overcharge "for Track", 100 units x price_unit
Overcharge, "for Train", 250 units x price_unit
# We want to know, for each LC, should it be applied to one product, or both
# After this we need to delete the lines where there isn't a match - no design on train, no track overchange on train, etc
<!-- Note: the ID's of your Company records may not be 1 and 2, so adjust accordingly -->
<!-- Odoo 15 -->
<data inherit_id="web.layout">
<xpath expr="//body" position="inside">
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '1'">
<style>.o_main_navbar {background-color: #57596F!important;border-bottom: 0px;}</style></t>
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '2'">
<style>.o_main_navbar {background-color: #6B3C3C!important;border-bottom: 0px;}</style></t>
<?xml version="1.0"?>
<tree string="Forecasted Inventory" create="0" multi_edit="1" editable="top">
<field name="write_date"/>
<field name="write_uid"/>
<field name="origin" readonly="1"/>
<field name="picking_id" widget="one2many_button" readonly="1"/>
<field name="date"/>
<field name="x_step"/>
<field name="product_id" readonly="1"/>
<field name="product_packaging_id" optional="hide" groups="product.group_stock_packaging"/>