
- Agregar campo computed selection_options_display que muestra las opciones disponibles - Implementar método _compute_selection_options_display que obtiene opciones del parámetro - Actualizar vista para mostrar las opciones disponibles debajo del campo de entrada - Remover widget selection que no funciona con campos Char dinámicos - Agregar placeholder descriptivo para guiar al usuario El usuario ahora puede ver las opciones válidas (ej: "Negativo < /dev/null | Positivo") y escribir el valor correcto en el campo de texto. Scripts de prueba agregados para validar la solución. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
Script para encontrar un resultado real con tipo selection
|
|
"""
|
|
|
|
import odoo
|
|
|
|
def find_selection_result(env):
|
|
"""Buscar un resultado con parámetro tipo selection"""
|
|
|
|
# Buscar resultados con parámetros tipo selection
|
|
results = env['lims.result'].search([
|
|
('parameter_value_type', '=', 'selection')
|
|
], limit=5)
|
|
|
|
print("RESULTADOS CON PARÁMETROS TIPO SELECTION:")
|
|
print("=" * 80)
|
|
|
|
for result in results:
|
|
print(f"\nResultado ID: {result.id}")
|
|
print(f" Test ID: {result.test_id.id}")
|
|
print(f" Test: {result.test_id.name}")
|
|
print(f" Parámetro: {result.parameter_id.name}")
|
|
print(f" Parámetro ID: {result.parameter_id.id}")
|
|
print(f" Selection values del parámetro: '{result.parameter_id.selection_values}'")
|
|
print(f" Valor actual: '{result.value_selection}'")
|
|
|
|
if result.parameter_id.selection_values:
|
|
options = [opt.strip() for opt in result.parameter_id.selection_values.split(',')]
|
|
print(f" Opciones disponibles: {options}")
|
|
|
|
return results
|
|
|
|
|
|
if __name__ == '__main__':
|
|
db_name = 'lims_demo'
|
|
odoo.tools.config.parse_config(['--database', db_name])
|
|
registry = odoo.registry(db_name)
|
|
|
|
with registry.cursor() as cr:
|
|
env = odoo.api.Environment(cr, 1, {})
|
|
results = find_selection_result(env) |