-
-
Notifications
You must be signed in to change notification settings - Fork 171
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][MIG]dms_attachment_link: port to 16.0 version #311
[16.0][MIG]dms_attachment_link: port to 16.0 version #311
Conversation
Thanks for the contribution. Please preserve commit history following technical method explained in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0. If the jump is between several versions, you have to modify the source branch in the main command to accommodate it to this circumstance. |
e64392a
to
26ad8b1
Compare
TT41512 [UPD] Update dms_attachment_link.pot [UPD] README.rst
…selection. TT41512 [UPD] Update dms_attachment_link.pot dms_attachment_link 13.0.1.1.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: dms-13.0/dms-13.0-dms_attachment_link Translate-URL: https://translation.odoo-community.org/projects/dms-13-0/dms-13-0-dms_attachment_link/
Currently translated at 100.0% (6 of 6 strings) Translation: dms-15.0/dms-15.0-dms_attachment_link Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_attachment_link/es/
Currently translated at 100.0% (6 of 6 strings) Translation: dms-15.0/dms-15.0-dms_attachment_link Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_attachment_link/it/
26ad8b1
to
75516c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
Formally seems OK, now reviewers should check the migration itself. /ocabot migration dms_attachment_link |
@api.model_create_multi | ||
def create(self, vals_list): | ||
"""Create attachments and link them to DMS files.""" | ||
attachments = super().create(vals_list) | ||
for attachment, vals in zip(attachments, vals_list): | ||
if "dms_file_id" in vals: | ||
attachment.datas = attachment.dms_file_id.content | ||
return attachments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change necessary? The _compute_datas()
method already takes care of it (or should).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general code LGTM, agree with @victoralmau that extending _compute_datas()
isn't neccessary
|
||
@api.depends("dms_file_id.content") | ||
def _compute_datas(self): | ||
"""Get the contents of the attachment directly from the DMS fiel.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Get the contents of the attachment directly from the DMS fiel.""" | |
"""Get the contents of the attachment directly from the DMS file.""" |
Dear all, Would you fix and merge with the main 16.0 branch. |
Seams unit testes fail. This prevent the merge process?! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review OK.
The changes from commit [16.0][FIX]dms_attachment_link: refactoring code add them to [16.0][MIG]dms_attachment_link: port to 16.0 version
The errors in tests will already be solved when you run it again (it was related to OCA/oca-ci#78).
The branch 17.0 dose not contain this module. What the problem is? |
The 17.0 branch does not have this module because it has not been migrated. If you want to migrate it you can do it (for example when this migration is finished and it is merged in v16). |
Superseed by #371 |
Migrate dms_attachment_link module from Odoo 15.0 to Odoo 16.0