Help

2

Why can not create issues in portal ?

Avatar
Marc Cassuto

Hi,

after installing module portal_project_issue, I discover a user can only see issues that are assigned to him... but he can not create new ones...

I granted Write and Create rights on project.issues to portal group... It does make the job but all the issue's fields remain hidden.

Is there a module to do this properly ?

Avatar
Discard
1 Answer
1
Avatar
Eckhard Schwarzat
Best Answer

*The form view definition for project issues is the key*

A portal user belongs always to the portal user group and should never belong to the Human Resources / Employee group.

If you look closer at the xml definition of the Project Issue Tracker Form for example, you will see that quite a lot of fields, labels etc. have the groups="base.group_user" attribute. An example:

                        <group>
                        <field name="id"/>
                        <field name="version_id" groups="base.group_user"/>
                        <field name="priority" groups="base.group_user"/>
                        <label for="task_id" groups="base.group_user"/>
                        <div groups="base.group_user">
                            <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline" context="{'default_project_id':project_id}"/>
                            <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/>
                        </div>
                    </group>

If a user belongs to HR/Employee group than she is able to see these elements; HR / Employees is equal to base.group_user. However, if she is a portal user and therefore ought not be a member of the HR / Employees group these elements are not visible to her; Portal is equal to portal.group_portal.

In order to make these elements visible, you have to inherit the view in question and use the replace statements on the elements you want to make visible and add them again either without the groups= attribute (all users including portal users can see this element from now on [depending on ACL and Record Rules]) or with a groups="portal.group_portal" attribute to make it only visible to Portal users.

Here is an example section of the original project issue form view:

                        <page string="Description">
                        <field name="description" placeholder="Add an internal note..." groups="base.group_user"/>
                    </page>

and the statement in the inherited view:

                <page string="Description" position="replace">
                <page string="Description">
                    <field name="description" placeholder="Add a description..."/>
                </page>
            </page>

As mentioned earlier, in order to see fields you need to check ACL rules, Record rules, view definitions and if you still can't see a field for a particular user group even the python code itself, because with Version 7 we have now column level security which is applied on python code level.

Avatar
Discard