Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1206 Vistas

Hello Odoo Community,

I’m working with the Project module in Odoo 18, and I’ve created a project called "Software Testing" with three stages: First Stage, In Progress, and Done.

Inside this project, I created a task named "Web Testing" in the First Stage. From the Action menu of the task, I added a custom Property with:

  • Label: Employee.
  • Field Type: Text.

The property works fine inside the task, but when I export the task to Excel, the property field appears like this:

{'ec679a2a7188466a': 'alia'}

Instead of showing just the value ("alia"), it includes the internal ID or key ('ec679a2a7188466a'). This makes the export hard to read or use in reports.

My questions Is there a way to export the custom properties without the internal ID—just showing the value (e.g., "alia")?

Avatar
Descartar
Mejor respuesta

Hi,


In Odoo, properties on tasks are stored as a JSON dictionary where the key is an internal identifier (like ec679a2a7188466a) and the value is what you entered (like "alia"). When exporting, Odoo doesn’t flatten this structure, so you see both the internal key and the value instead of just the user-friendly text.


Option 1 – Use custom fields instead of properties:

If you create a real custom field on the project.task model (using Studio or development), the data is stored directly in that field. This means when you export, you’ll get clean values such as "alia" without the extra technical identifiers. Properties are flexible but less reporting-friendly, so custom fields are the better long-term choice if reporting and exporting matter.


Option 2 – Add a computed field for export:

You can add a new computed field that pulls the property’s value out of the JSON. For example, a field like Employee (Property Value) can read from the property dictionary and return only the value. When exporting, you simply select this field instead of the raw properties. This works well if you want to keep using properties but need clean exports.


Option 3 – Reporting view or server action:

If you don’t want to modify the model itself, another option is to create a reporting SQL view or a server action that processes the JSON and extracts only the values. This way, you can generate reports or exports that ignore the internal IDs and only show readable values, without changing how properties are stored.


Hope it helps

Avatar
Descartar
Mejor respuesta

Hii,
Option 1: Use Studio to Add a Computed Field

Open the Task form (in Studio).

Click “Add a new field” → Choose "Text".

Click “Advanced Properties”.

Set this as the Python expression:

record.x_studio_employee.values()[0] if record.x_studio_employee else ''

(Replace x_studio_employee with your actual field name if it's different.)

Save and show this field in the list view.

Now when you export tasks, use this new field — it will show just "alia".

Option 2: Create a Computed Field via Code


If you're customizing with code, define a computed field like this:

from odoo import fields, models, api


class ProjectTask(models.Model):

    _inherit = 'project.task'


    employee_value = fields.Char(string="Employee (Cleaned)", compute="_compute_employee_value")


    @api.depends('employee')

    def _compute_employee_value(self):

        for task in self:

            val = task.employee

            if isinstance(val, dict):

                task.employee_value = next(iter(val.values()), '')

            else:

                task.employee_value = val or ''

i hope it is help full

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
sept 25
224
1
jul 25
853
2
jun 25
2892
3
may 25
2887
2
jul 25
1644