콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
265 화면

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")?

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
2
6월 25
1555
3
5월 25
1760
2
5월 25
1026
2
5월 25
1839
1
5월 25
722