Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
3623 Lượt xem

Hi there,

(Odoo13)

I want to make restriction on task stages in project module that only project initiator or project admin can change the task stages no one other can change the stages to task .Need technical solution only.

Ảnh đại diện
Huỷ bỏ

What do you mean by "Technical Solution only"?

Câu trả lời hay nhất

Here is answer . I did customization and its worked for me.


class ProjectTask(models.Model):

    _inherit = "project.task"


    def write(self, values):

        if 'stage_id' in values and self.env.user != self.create_uid:

            raise UserError(_("You are not allowed to change the stage of task please contact with task initiator !!"))

        else:

            return super(ProjectTask, self).write(values)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

@danish hassan

How did you solve the question?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I mean as a developer . i need code .I want to customize my module.

Ảnh đại diện
Huỷ bỏ