VTU SO Incoterm Filter

Solo Project by Matthias de Vries

Description

A micro-enhancement that enables sales staff to search for Incoterms by their code (e.g., "EXW," "FOB," "CIF") directly in the sales order incoterm field dropdown. Standard Odoo only searches by the full name ("Ex Works," "Free On Board"), forcing users to remember full terminology. This simple change aligns the system with international business practice where Incoterm codes are universally used.

Business Challenge

Van Thiel exports equipment internationally, requiring precise Incoterm specification on every sales order. Pain points included:

  • Sales staff know Incoterms by code (EXW, FCA, FOB) but Odoo only searched full names
  • Typing "FOB" returned no results; users had to remember "Free On Board"
  • Slower order entry as staff looked up full Incoterm names
  • Risk of selecting wrong Incoterm due to similar full names
  • International customers request by code, not full name, causing confusion
  • Training burden explaining why codes don't work in Odoo

Solution Approach

Matthias implemented a model-level search enhancement for the Incoterm object:

  • Name Search Override: Extends _name_search() or _rec_name_search() method
  • Code-First Logic: Searches both code and name fields simultaneously
  • No UI Changes: Standard dropdown field behavior, enhanced search backend
  • Backward Compatible: Full name searches still work as before

Technical Implementation

The module extends the account.incoterms model with enhanced search capabilities:

  • Inherits account.incoterms model
  • Overrides _name_search() or adds _rec_name_search to search code field
  • Uses | (OR) domain operator to search code OR name
  • Maintains standard Odoo search behavior for all other aspects
  • Zero database changes—pure Python method enhancement
  • No data files required, purely functional change

Results & Impact

Sales order entry time decreased by 5-10 seconds per order—small individually but meaningful across hundreds of orders. More importantly, sales staff stopped needing to ask "what's the full name for CIF again?" The interface now matches how international business actually communicates about Incoterms, eliminating a daily friction point and reducing training time for new staff.