Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [ADD] Project Portal Custom Field Access #1229

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

ivantodorovich
Copy link

@ivantodorovich ivantodorovich commented Jan 30, 2024

Odoo has a feature called "Project Sharing" that allows portal users to view a project's kanban, which has functionalities similar to the backend system.

There's a preset list of fields that portal users can access, which is harcoded in the module's source code.

That's nice but inconvinient if a user introduces new fields to the form and wants to share these with the portal users. They can't currently do this without using a Python override.

To resolve this, the module lets users whitelist these custom fields directly through the ir.model.field model.


Re-created an old closed PR:

ping @AungKoKoLin1997

@ivantodorovich ivantodorovich marked this pull request as ready for review January 30, 2024 11:21
@ivantodorovich ivantodorovich changed the title [ADD] Project Portal Custom Field Access [16.0] [ADD] Project Portal Custom Field Access Jan 30, 2024
Comment on lines +28 to +30
@property
def SELF_WRITABLE_FIELDS(self):
return super().SELF_WRITABLE_FIELDS | self._get_portal_custom_field_access()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you think if we add an option to choose READABLE or WRITEABLE? It may be useful in case of user wants to show only information for the collaborators like Milestone field.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The milestone_id is a core field, and it's already exposed: https://github.com/odoo/odoo/blob/492169bf562768f661727d6387c5e47bee700d9e/addons/project/models/project.py#L49

The purpose of this module is to be able to expose custom fields (those created through the UI, those that start with x_). All other code-defined fields can be exposed through custom modules :) this module is not useful there

I do take your point to be able to choose between read-only and read-and-write. It would be a nice improvement, though it's not required by our project at the moment

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you misunderstood me about milestone_id. I wanted to mention was in case of user wants to create custom fields through UI and he wants to make only readable for collaborators(I mentioned milestone_id as an example of readonly for collaborator). Whatever you got my point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants