Skip to content

Instantly share code, notes, and snippets.

@sebalix
sebalix / Odoo Import - Column naming rules
Created December 22, 2022 08:15
Odoo Import - Column naming rules
Rules for M2O fields, three possibilities:
uom_id => the value has to be the exact name of the record (e.g. "Units")
uom_id/id => the value has to be what we called an external ID (e.g. "uom.product_uom_unit")
uom_id/.id => the value has to be the integer ID of the record (e.g. 10)
diff --git a/odoorpc/error.py b/odoorpc/error.py
index d359d7f..1ade192 100644
--- a/odoorpc/error.py
+++ b/odoorpc/error.py
@@ -21,6 +21,16 @@
"""This module contains all exceptions raised by `OdooRPC` when an error
occurred.
"""
+import sys
+
# -*- coding: utf-8 -*-
# Copyright 2016 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import sys
from openerp import models, fields, SUPERUSER_ID
from openerp.modules.registry import RegistryManager
MODELS = ['my.model1', 'my.model2']
@sebalix
sebalix / bootstrap-db.py
Created March 31, 2016 08:48
Bootstraping Odoo database (8.0)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to bootstrap an Odoo database (8.0)."""
import odoorpc
# Odoo connection
SUPER_PWD = 'admin'
HOST = 'localhost'
PORT = 8069
DB = 'my_db'
account.payment
cancel
post
account.move.line
process_reconciliations
process_reconciliation
reconcile
create_analytic_lines
@sebalix
sebalix / dump_schema.py
Last active June 27, 2017 16:23
Script to fetch the schema of all data models from an Odoo server. Then, it can compare two schema to show the differences between them (fields added, modified or removed).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to fetch the schema of all data models from an Odoo server.
Then, it can compare two schema to show the differences between them (fields
added, modified or removed).
"""
import sys
import json
import oerplib