Odoo Code Snippets

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc. Odoo apps integrate seamlessly to provide a full-featured software platform. It is a system that offers a wide range of features and functionality.

While it’s possible to use Odoo without any code snippets, you may find that certain tasks are easier if you have some coding experience. In this post, we’ve gathered a selection of useful Odoo code snippets for you to reference. Whether you’re looking to create custom reports or configure VAT settings, we’ve got something for everyone.

Odoo Code Snippets


Add Custom Fields to Product
class ShopeeProduct(models.Model):
    _inherit = 'product.product'

    shopee_variation_id = fields.Char(string='Shopee Variation ID')

class ShopeeProductTemplate(models.Model):
    _inherit = 'product.template'

    shopee_product_id = fields.Char(string='Shopee Product ID')
Change User’s Default Page After Login
Create a Wizard
Override a Model’s Create Update and Delete Methods
Open Success Message Popup
Add a Custom Field to Contact Form
Change Color of Tree View’s Lines
Auto Generate Name Column with Sequence
Add Filter and Group By to Search View
Display Another Field in Many2one Instead of Name


Create Email Template and Send Email Programmatically

Menu & Navigation

Add a Menu Item to a Model's Navigation
Open an External URL from Menu Item


Create a Custom QWeb Report
Modify Header and Footer


Create Settings

Leave a Comment

Your email address will not be published.