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

[5191][ADD] product_attachment_name_update #157

Open
wants to merge 2 commits into
base: 15.0
Choose a base branch
from

Conversation

AungKoKoLin1997
Copy link
Contributor

else:
res_model = "product.product"
rec = self.env[res_model].browse(attachment.res_id)
attachment.name = f"[{rec.name}][{rec.id}] {attachment.name}"
Copy link
Contributor

Choose a reason for hiding this comment

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

If I attach two images with exactly the same name to the same product, two separate attachments with the same name are created, so they are not unique. I think using the ID from ir.attachment might help. Also, I think switching from using product.product and product.template IDs to using ir.attachment might make it unique. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@nobuQuartile nobuQuartile left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@nobuQuartile nobuQuartile left a comment

Choose a reason for hiding this comment

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

Please make the name of the image added to the chatter the same as the one added to the Extra Product Media images.
Is that possible?
Sorry for the lack of requirements

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