


Task_rule = fields.Many2many(compute='_task_rule_calc', comodel_name='')

Right_ids = ()ġ) Model: class TaskStateRights(models.Model): Task_rule = fields.Many2many(compute='_task_rule_calc', _task_rule_calc(self): Return (self, cr, uid, ids, context=context) Return (self, lambda value:value.id)ĭef unlink(self, cr, uid, ids, context=None): Project_task_fases = fields.Many2many('','project_optional_rel','pr_src_id','pr_dest_id',string='Fases allowed to view', help="All the project task fases you choose here will be viewable by this write(self, vals): The following is an example based on the models that you provide(tested in old and new api and working) Also if you need you could override _eval_context of the ir.rule to set more values to be available to ir.rule domains based on the uid or any other value searched through the orm or direct sql statements. You could develop that checks as a field function of res.users and use that field function in the domain for ir.rule on the project.task model since the user object is available for ir.rule domains. For example when we've added a record 'User1' and added the statusses 'Development', 'Testing' then the 'User1' should only be able to see the types 'Development' and 'Testing' on the project task view. Depending on what is filled in for this user on the model '' I want to show/hide different types. So on this new view you can choose an user and then choose project task stages. I've then created a form and tree view for this new model: Project_task_fases = fields.Many2many('','project_optional_rel','pr_src_id','pr_dest_id',string='Fases allowed to view', help="All the project task fases you choose here will be viewable by this user.") The code: class TaskStateRights(models.Model): I've first created a new model which has a many2one to 'res.users' and a many2many to ''. I want to be able to influence who can view which project tasks without record rules but depending on what is filled in on a new model. Usually I would work with groups and rules for limiting different things to users but this one is different.
