Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Technical
  3. Obscure Field v 18.0
  4. Sales Conditions FAQ

Obscure Field

by tuanhoangdef <hng.atuan@gmail.com> https://github.com/tuanhoangdef/obscure_field/tree/19.0/
Odoo
v 18.0 Third Party 11
Download for v 18.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 28
Technical Name obscure_field
LicenseLGPL-3
Websitehttps://github.com/tuanhoangdef/obscure_field/tree/18.0/
Versions 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 28
Technical Name obscure_field
LicenseLGPL-3
Websitehttps://github.com/tuanhoangdef/obscure_field/tree/18.0/
Versions 18.0 19.0

Obscure Field

Add a Char-compatible Odoo field for credentials that must not appear raw in form view network responses, read APIs, or exports.

The Problem

A common implementation mistake is to store credentials such as passwords, API keys, client secrets, and access tokens in regular character fields, then only hide them visually in the form view. The value may look protected to the user, but the browser can still receive the original value behind the scenes.

For example, an integration module might define credential fields as plain fields.Char values:

from odoo import fields, models


class Marketplace(models.Model):
    _name = 'marketplace'

    client_id = fields.Char(string='Client ID')
    client_secret = fields.Char(string='Client Secret')
    refresh_token = fields.Char(string='Refresh Token')
    access_token = fields.Char(string='Access Token')

The form view may then apply the password option to mask the value on screen:

<group>
    <field name="client_id"/>
    <field name="client_secret" password="True"/>
    <field name="refresh_token" password="True"/>
    <field name="access_token" password="True"/>
</group>
Odoo form view showing credential fields masked in the browser
Resulting form view with credential fields visually masked.

This is not enough. Inspecting the browser network tab can still reveal the sensitive values in the response payload, even though the form input displays a masked value.

Chrome network response showing sensitive credential data in plain text
Chrome inspector response tab showing sensitive data returned in plain text.

Obscure Field fixes the problem at the field layer. Only fields declared as fields.Obscure are masked in read, web_read, and export responses.

Key Features

  • Declare sensitive values with fields.Obscure instead of regular fields.Char.
  • Return ****** for populated obscure fields in read and web_read payloads.
  • Mask exported values to reduce accidental CSV or XLSX credential disclosure.
  • Keep the real stored value available to trusted server-side Python code through record.field.
  • Ignore all-star placeholder writes, so saving a form does not overwrite the existing credential.
  • Apply masking only to fields explicitly declared as fields.Obscure.

Example Code

Declare sensitive fields with fields.Obscure:

from odoo import fields, models


class Marketplace(models.Model):
    _name = 'marketplace'

    client_secret = fields.Obscure(string='Client Secret')
    refresh_token = fields.Obscure(string='Refresh Token')
    access_token = fields.Obscure(string='API Access Token')

Backend usage

def action_connect(self):
    secret = self.client_secret
    token = self.access_token
    # Use the real values for trusted backend logic.

Response payload

{
    "client_secret": "******",
    "refresh_token": "******",
    "access_token": "******"
}

Behavior

Operation Result
record.client_secret Returns the real value to server-side Python code.
read / web_read Returns ****** when the field has a value.
Export Returns a masked value instead of the stored credential.
write({'client_secret': '******'}) Ignored as an unchanged placeholder.
write({'client_secret': 'new-secret'}) Saves the new value.

Important Limits

This module currently hides values from read/export payloads. It does not encrypt values at rest and it does not replace Odoo access control, record rules, or proper group permissions.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

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's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with