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

[15.0][ADD] dms_field_auto_classification: New module #288

Merged

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Jan 23, 2024

New module

Locked by:

Please @pedrobaeza and @chienandalu can you review it?

@Tecnativa TT46805

@victoralmau victoralmau force-pushed the 15.0-add-dms_field_auto_classification branch 5 times, most recently from 7bfcd2b to 283f688 Compare February 9, 2024 07:56
@victoralmau
Copy link
Member Author

Ready to review.

@pedrobaeza pedrobaeza added this to the 15.0 milestone Feb 9, 2024
@api.depends("model_id")
def _compute_model(self):
for item in self:
item.model = item.model_id.model
Copy link
Member

Choose a reason for hiding this comment

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

I think this will fail with non admin permissions, as models are restricted (and the same for any model access in whole module).

Copy link
Member Author

Choose a reason for hiding this comment

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

This field is compute sudo.
Template must be created by a user with ir.model permissions.

I have added to tests a user with permissions in Documents: Manager to confirm that that user can do the whole process (without having permissions to ir.model).

Copy link
Member

Choose a reason for hiding this comment

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

Template must be created by a user with ir.model permissions.

Only maximum admins have this permission, so this should be avoided (mis_builder for example had similar problems).

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand the problem of high permissions, but what suggestion do you propose?
Another option is not to select a model (ir.model) and write the name (res.partner for example) directly.

@victoralmau victoralmau force-pushed the 15.0-add-dms_field_auto_classification branch 2 times, most recently from 0ab487f to 7459fb6 Compare February 9, 2024 08:39
@victoralmau victoralmau force-pushed the 15.0-add-dms_field_auto_classification branch from 7459fb6 to fe805fd Compare February 9, 2024 10:55
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Maybe I'm doing something wrong, but I couldn't make it work in demo:

  • I'm using your test zip
  • I set the VAT numbers to two customers.
  • I try to classify them

But no classification is make or folder linked to the partners...

@victoralmau
Copy link
Member Author

Maybe I'm doing something wrong, but I couldn't make it work in demo:

* I'm using your test zip

* I set the VAT numbers to two customers.

* I try to classify them

But no classification is make or folder linked to the partners...

Sorry, you need to create an Embedded DMS templates for partners (https://github.com/OCA/dms/pull/288/files#diff-d37451b07c0c0fd8b55c34a39c8ac57c604748a580057a00fc24ccdbb3525ddeR23) and then (with the corresponding button) in the form view of each partner you must create the linked folder (this is how dms_field works).

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 15.0-ocabot-merge-pr-288-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit a625efa into OCA:15.0 Feb 12, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 92e517c. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 15.0-add-dms_field_auto_classification branch February 12, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants