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

[3328][AD] account_analytic_distribution_access_control #20

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

Conversation

rinaldifirdaus
Copy link
Contributor

3328

currently still having issue when installing the module with error:
Exception: Module loading account_analytic_distribution_access_control failed: file account_analytic_distribution_access_control/security/ir.model.access.csv could not be processed:
No matching record found for external id 'group_analytic_accounting_user' in field 'Group'
No matching record found for external id 'group_analytic_accounting_user' in field 'Group'
No matching record found for external id 'group_analytic_accounting_user' in field 'Group'
No matching record found for external id 'group_analytic_accounting_user' in field 'Group'
No matching record found for external id 'group_analytic_accounting_user' in field 'Group'

@yostashiro
Copy link
Member

@rinaldifirdaus I think the implementaion should be something simple and no need to add a new group IMO. For example, extending the create method of analytic.distribution.model would probably serve the purpose. Can you try this and see if it works.

@api.model_create_multi
def create(self, vals_list)
    if not self.user_has_groups("analytic.group_account_manager"):
        raise UserError(_("You do not have the permission to create an analytic distribution model."))
    return super().create(vals_list=vals_list)

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.

2 participants