Skip to content

[16.0][ADD] attachment_log #3161

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

geomer198
Copy link

This module adds the following features for attachments:

  • Displays the date and time when each attachment was added under the attachment file
  • Records chatter messages showing which user linked or unlinked files to attachments

@geomer198 geomer198 force-pushed the 16.0-t4242-attachment-log-add branch from 9b18974 to fc0cd0a Compare January 9, 2025 17:48
Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

Here are my concerns: why should we post a message for every attachment added?
What if an incoming email arrives with 10+ attachments in it? It will result in 10+ messages trashing the record chatter.
You can simply show name of the user who added attachment together with the creation date. That is.

Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

You should add test coverage for the features you are adding.

@geomer198 geomer198 force-pushed the 16.0-t4242-attachment-log-add branch 2 times, most recently from 7e55b4c to 81f090d Compare January 15, 2025 21:44
Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

You need to add CONFIGURE.rts to explain the configuration process.

To enable note logging of attachment operations in record chatter: 

- Go to "Settings > General Settings" and scroll to the "Discuss" section.
- Activate the "Attachment Logging" checkbox.

Add screenshots that make both configuration and usage easier. Must be not more than 800px width.
Here is an example. Don't use this picture because you need to fix the configuration view first.

image

Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

Code review LGTM

@yostashiro
Copy link
Member

yostashiro commented Jan 19, 2025

Just noticed that I don't seem to be able to attach a file in a message (upload doesn't complete) when the feature is activated (tested in Runboat). Can you please check?

image

@ivs-cetmix
Copy link
Member

Just noticed that I don't seem to be able to attach a file in a message (upload doesn't complete) when the feature is activated (tested in Runboat). Can you please check?

Hi @yostashiro! Thank you for noticing that! Will fix.

Copy link

@xxp-odoo xxp-odoo left a comment

Choose a reason for hiding this comment

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

Functionality LGTM

@geomer198
Copy link
Author

Just noticed that I don't seem to be able to attach a file in a message (upload doesn't complete) when the feature is activated (tested in Runboat). Can you please check?

image

Thank you for your comment. I have tested your problem on runboat and everything works correctly.

@ivs-cetmix
Copy link
Member

Hi @yostashiro could you please check again on the runboat?

@yostashiro
Copy link
Member

Took a quick look in runboat and noticed a couple of things:

1/ When I attach a file directly to the thread (not via send message or log note), the user and date information doesn't seem to be assigned to the attachment.

image

2/ The assigned date seems to show in UTC. The best would be to show it in user's timezone.

image

If these are as intended, we may want to update the README to mention these?

@geomer198 geomer198 force-pushed the 16.0-t4242-attachment-log-add branch from 2dea328 to e9d0365 Compare March 24, 2025 15:17
@geomer198
Copy link
Author

@yostashiro Could you please check again?

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

Functional test. LGTM with a question.

I'm not sure how to interpret the CI error.

Comment on lines 84 to 88
tz = self._context.get("tz") or self.env.user.tz
create_date = self.create_date
create_date = Datetime.context_timestamp(
self.with_context(tz=tz), timestamp=create_date
)
Copy link
Member

@yostashiro yostashiro Mar 26, 2025

Choose a reason for hiding this comment

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

I wasn't sure this conversion was necessary on the server side. Does it not work if we just return the raw self.create_date and use widget="datetime" in the view?

@rvalyi
Copy link
Member

rvalyi commented Mar 26, 2025

Merging based on the reviews.
/ocabot merge nobump

@rvalyi
Copy link
Member

rvalyi commented Mar 27, 2025

/ocabot merge nobump

@ivs-cetmix
Copy link
Member

Hi @rvalyi , looks like the merge process has stuck here. @sbidoul could you please have a look too?

@geomer198 geomer198 force-pushed the 16.0-t4242-attachment-log-add branch from e9d0365 to 4e3d7c5 Compare April 16, 2025 13:56
Copy link

@Christian-RB Christian-RB left a comment

Choose a reason for hiding this comment

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

I think this is a pretty good feature and tests seems to be failing for different reason. Code and functional review LGTM

@ivs-cetmix
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-3161-by-ivs-cetmix-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request May 1, 2025
Signed-off-by ivs-cetmix
@OCA-git-bot
Copy link
Contributor

@ivs-cetmix your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-3161-by-ivs-cetmix-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@Christian-RB
Copy link

@geomer198 Can you rebase de code to retry the tests?

@geomer198 geomer198 force-pushed the 16.0-t4242-attachment-log-add branch from 9dead3b to 7fe2718 Compare June 14, 2025 20:07
@geomer198
Copy link
Author

@geomer198 Can you rebase de code to retry the tests?

Done!

@xxp-odoo
Copy link

xxp-odoo commented Jun 20, 2025

@Christian-RB
Could you please proceed with the merge?

@Christian-RB
Copy link

@ivs-cetmix Can you retry the merge command? Thanks in advance

@ivs-cetmix
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-3161-by-ivs-cetmix-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 554a155 into OCA:16.0 Jun 20, 2025
8 checks passed
@OCA-git-bot
Copy link
Contributor

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

@ivs-cetmix ivs-cetmix deleted the 16.0-t4242-attachment-log-add branch June 20, 2025 12:45
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.

9 participants