Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
258 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvn 25
1547
3
kvě 25
1760
2
kvě 25
1026
2
kvě 25
1839
1
kvě 25
722