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

[16.0][MIG] dms_field: Migration to 16.0 #339

Merged
merged 53 commits into from
Jun 19, 2024

Conversation

CarlosRoca13
Copy link

@CarlosRoca13 CarlosRoca13 commented May 31, 2024

cc @Tecnativa TT48507

  • This migration has renamed the dms_tree view to dms_list due to an incompatibility with the tree view.

  • Adapt code to owl and use reactivity that it offers

  • Use new drag and drop as it is used on dms module

ping @victoralmau @pedrobaeza

@CarlosRoca13 CarlosRoca13 marked this pull request as draft May 31, 2024 18:05
@CarlosRoca13
Copy link
Author

Set as draft because drag and drop is not already implemented, but the module is usable yet

@pedrobaeza
Copy link
Member

/ocabot migration dms_field

dms_field/views/dms_field_template_views.xml Outdated Show resolved Hide resolved
dms_field/models/dms_field_template.py Outdated Show resolved Hide resolved
@CarlosRoca13 CarlosRoca13 force-pushed the 16.0-MIG-dms_field branch 2 times, most recently from 1f32d57 to 36fc321 Compare June 4, 2024 08:21
@CarlosRoca13 CarlosRoca13 marked this pull request as ready for review June 4, 2024 08:21
@CarlosRoca13
Copy link
Author

@victoralmau Changes done and drag & drop added

Copy link
Member

@victoralmau victoralmau left a comment

Choose a reason for hiding this comment

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

The same suggestion for all occurrences.

res_model=cls.template._name, res_id=cls.template.id
)
template_ctx.create_dms_directory()
cls.template.refresh()
Copy link
Member

@victoralmau victoralmau Jun 6, 2024

Choose a reason for hiding this comment

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

Suggested change
cls.template.refresh()
cls.template.invalidate_model()

@CarlosRoca13 CarlosRoca13 force-pushed the 16.0-MIG-dms_field branch 3 times, most recently from b869429 to dbc1671 Compare June 10, 2024 05:58
@CarlosRoca13
Copy link
Author

@victoralmau Changes done!

Added migration script to change the type of ir.ui.view records that keeps dms_tree type

@CarlosRoca13 CarlosRoca13 force-pushed the 16.0-MIG-dms_field branch 2 times, most recently from 1229741 to 9c29a7c Compare June 10, 2024 07:20
@CarlosRoca13
Copy link
Author

Done! 😄

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

I don't understand why renaming from dms_tree to dms_list and causes potential problems.

Another thing is that the README is not explaining how to enable this in any model.

oca-ci and others added 8 commits June 19, 2024 08:17
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: dms-15.0/dms-15.0-dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_field/
…n as default state

Before this change, when lauching the reload, the child directories
of the reloaded one are opened too.

By doing at this step and not setting the default state, the reloads are
done just for the implied nodes.

Furthermore, the code is improved to just reload the directories that
have being changed.
Currently translated at 100.0% (75 of 75 strings)

Translation: dms-15.0/dms-15.0-dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_field/es/
With hr_dms_field
The steps to reproduce the problem are:

1. Open Employee
2. Go to Documents Page
3. Drop a file on a directory
4. Go to another Employee
5. Try to drop a file

The file can not be dropped.
@CarlosRoca13 CarlosRoca13 force-pushed the 16.0-MIG-dms_field branch 2 times, most recently from 2fcf78c to 652453c Compare June 19, 2024 06:37
CarlosRoca13 and others added 3 commits June 19, 2024 08:39
In the migration, the view type is changed from dms_tree to
dms_list. That's because in this point https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/views/fields/field.js#L282
the 'tree' string is replaced by 'list' what is causing problems
trying to set the view type as it was before.
A parent directory can be set in templates, if set, the directory that is created
linked to a record will be a "child" of that directory.

TT48650
…ors when creating directories from a template.

Example of use case:
- Create a partner.
- Create a template linked to partners.
- Create a directory through the template.
- An access group linked to the partner is created.
- Delete the partner directory.
- Creates a new directory through the template.
- No error will occur and the previous access group will be re-used.
@CarlosRoca13
Copy link
Author

CarlosRoca13 commented Jun 19, 2024

I have added the explanation for the change from dms_tree to dms_list in the commit message and added in CONFIGURE.rst the way to use the embedded view in any model

@pedrobaeza
Copy link
Member

I'm testing the module and the eye button (or the button "Open" in the right part) is not working properly: for PDF files, it downloads it instead of previewing it, and for other files without preview feature, it gets a black popup:

Peek 2024-06-19 08-54

@CarlosRoca13
Copy link
Author

So I'm seeing the pdf ok..
seeing_pdf

For other files it is how it is working now the dms, the preview is delegated to the navigator if you click on the preview image of "other files" you will have the same result
dms preview

@pedrobaeza
Copy link
Member

Please use Firefox for PDF preview. It's not working well there. About the other, I think it the button can be faded if not available.

@CarlosRoca13
Copy link
Author

It is something about your navigator...

Test on firefox:
pdf

…ring

Now the process will be as follows:
- The auto-generated access group will be created.
- The user will be defined in explicit_user_ids of the group
created in the previous step.

In the directory created (from the corresponding record) the auto-generated
group (for the user to have access) + the access groups that the template
had will be used.
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

OK then...

/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-339-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit be90069 into OCA:16.0 Jun 19, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 16.0-MIG-dms_field branch June 19, 2024 16:47
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.