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 / 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
network:
version: 2
ethernets:
enp0s3:
addresses: [192.168.1.202/24]
@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"/>
<!-- 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>
@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
<filter string="This Month" name="this_month" domain="['&amp;', ('date', '&gt;=', context_today().strftime('%Y-%m-01')),
('date', '&lt;', (context_today() + relativedelta(months=1)).strftime('%Y-%m-01'))]"/>
<filter string="Last Month" name="last_month1" domain="['&amp;', ('date', '&gt;=', (context_today() - relativedelta(months=1)).strftime('%Y-%m-01')),
('date', '&lt;', (context_today() - relativedelta(months=0)).strftime('%Y-%m-01'))]"/>
<filter string="2 Months Ago" name="last_month2" domain="['&amp;', ('date', '&gt;=', (context_today() - relativedelta(months=2)).strftime('%Y-%m-01')),
('date', '&lt;', (context_today() - relativedelta(months=1)).strftime('%Y-%m-01'))]"/>
<filter string="3 Months Ago" name="last_month3" domain="['&amp;', ('date', '&gt;=', (context_today() - relativedelta(months=3)).strftime('%Y-%m-01')),
@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]
TURN OFF:
update ir_mail_server set active = 'f';
update fetchmail_server set active = 'f';
update ir_cron set active = 'f' where function = 'schedule_backup';
TURN ON:
update ir_mail_server set active = 't';
update fetchmail_server set active = 't';
update ir_cron set active = 't' where function = 'schedule_backup';