Go to file
2026-02-02 16:41:49 +07:00
models feat: Add .gitignore to exclude compiled Python and temporary Odoo files. 2026-01-21 11:04:02 +07:00
static/src feat: Implement decimal styling for tax totals and refine list view aggregate rendering. 2026-02-02 16:41:49 +07:00
__init__.py fix the decimal style at certain area 2026-01-09 10:11:56 +07:00
__manifest__.py feat: Implement decimal styling for tax totals and refine list view aggregate rendering. 2026-02-02 16:41:49 +07:00
.gitignore chore: Add .gitignore to exclude common Python, Odoo, and editor-related files. 2026-01-21 11:04:24 +07:00
README.md fix the decimal style at certain area 2026-01-09 10:11:56 +07:00

Web Decimal Style

This module enhances the display of decimal numbers in Odoo by styling the decimal part differently from the integer part.

Features

  • Wraps decimal parts in a CSS class for custom styling
  • Works across all numeric field types (float, monetary, percentage, etc.)
  • Fixed: Proper decimal formatting in inventory detailed operations
  • Enhanced support for stock moves and inventory operations
  • Handles escaped HTML markup properly in list views

Recent Fixes

Inventory Operations Fix

  • Issue: Decimal formatting was not working in inventory detailed operations
  • Root Cause: Previous implementation stripped decimal formatting from stock moves to avoid HTML escaping issues
  • Solution:
    • Improved markup handling to preserve decimal formatting while avoiding escaping issues
    • Added specific patches for stock move line renderers
    • Enhanced the wrapDecimal function to handle inventory-specific cases
    • Added proper view inheritance for stock move line views

Technical Changes

  1. Enhanced List View Patch: Instead of stripping formatting from stock moves, now properly handles escaped HTML
  2. New Stock Move Patch: Added specific handling for stock move line renderers and enhanced formatter registry
  3. Improved wrapDecimal Function: Better regex handling for various number formats
  4. Enhanced Formatter Registry: Comprehensive patching of all numeric formatters used in inventory
  5. Added Stock Dependency: Module now depends on stock module for proper integration

Usage

The module automatically applies decimal styling to all numeric fields. The decimal part will appear smaller and slightly transparent compared to the integer part.

Debugging

Console Debugging

  1. Open browser developer tools (F12)
  2. Go to Console tab
  3. Look for messages starting with:
    • "Web Decimal Style module loaded successfully"
    • "Universal Decimal Patch: Formatting"
    • "Stock Operations: Applying decimal formatting"

Manual Testing

In the browser console, you can test the decimal formatting function:

// Test the wrapDecimal function
testDecimalStyle('123.45')

Visual Debugging

The CSS includes a debug indicator (🔸) that appears before each decimal part. This is currently enabled to help identify when decimal formatting is applied.

Troubleshooting Steps

  1. Check module loading: Look for "Web Decimal Style module loaded successfully" in console
  2. Check field detection: Look for logging messages when viewing inventory operations
  3. Verify decimal detection: The module should detect values with decimal points (e.g., "123.45")
  4. Check CSS application: Look for <span class="o_decimal"> elements in the HTML

If decimal formatting is not working:

  1. Refresh the page after module update
  2. Clear browser cache
  3. Check browser console for JavaScript errors
  4. Verify the module is properly installed and upgraded

Installation

  1. Install the module
  2. Restart Odoo
  3. Update the module list
  4. Install "Web Decimal Style"

The formatting will be applied automatically to all numeric fields across the system, including inventory operations.