-
-
Notifications
You must be signed in to change notification settings - Fork 545
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
[18.0][MIG] base_tier_validation: Migration to 18.0 #992
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] base_tier_validation: Migration to 18.0 #992
Conversation
Can you place your commits in a separate commit? |
hi @bosd, that commit fixed the icon bug, but i consider that fix as part of PR Migration (because old PR is not yet merged). and author of this PR (#990) also mentioned we have duplicated work, you can read the conversation here: xaviedoanhduy#1 (comment) |
Thanks for the clarification. I was getting a bit lost between the migration pr of this module. Side note, on this one codecov is red. |
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.
Hey, thanks for taking care of this!
There are a few things that need to be corrected, IMO.
Could you check my remarks? 🙏🏻
Thanks!
review_groups = self.env["tier.review"].read_group(domain, ["model"], ["model"]) | ||
for review_group in review_groups: | ||
model = review_group["model"] | ||
Model = self.env[model] | ||
reviews = self.env["tier.review"].search(review_group.get("__domain")) |
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.
💡 tip: This could probably be improved by leveraging the private _read_group
method, and aggregating ['id:recordset']
, and thus not needing to do a search afterwards
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.
@ivantodorovich Good spot. that was on my mind as well.
There are some more places in the code of this module where the orm is flooded by searches from within a for loop.
The _read_group
method was introduced in the orm in V17.
IMO that improvement could go into V17 and be forward ported here. Should not be blocking for this pr.
(But I've been told, there is even a more improved method in the V18 orm. But I don't know the details or have looked into that one.)
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.
I think :recordset
was added in 18.0.
In 17.0 a similar thing can be accomplished with :array_agg
, and then browsing the list of ids.
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.
FYI, _read_group
and ir.recordset
already exist in version 17.0, see: odoo/odoo#110737
and by the way I also applied the above code improvement from your suggestion, thank @ivantodorovich
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.
@xaviedoanhduy Thanks!
Actually there are still some places in the code where a search is performed inside a for loop.
(Bad practice for performance.)
https://github.com/OCA/server-ux/pull/992/files#diff-7cca2e2b43a392c79d13759687633b9d88cfe56e6c2238b762e2c8d461690607R123-R124
Maybe you can attend to this, or put it on the roadmap.
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.
FYI, _read_group and ir.recordset already exist in version 17.0, see: odoo/odoo#110737
Oh, indeed. Thanks!
base_tier_validation/static/src/components/tier_review_widget/tier_review_widget.esm.js
Outdated
Show resolved
Hide resolved
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.
Functional test looks good to me - no issues found
bc507f3
to
3108668
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.
Thanks for your efforts and work on this: 👍
Functional test:
Colors are not showing in review bar as mentioned by @celm1990 in #990 (review)
3108668
to
60977bf
Compare
hi, color issue on reviewers list has been fixed. thanks for the tests |
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.
/ocabot migration base_tier_validation |
60977bf
to
9aedf95
Compare
…on and validate if possible.
* able to restart validation * sudo() not needed anymore
Currently translated at 100.0% (143 of 143 strings) Translation: server-ux-17.0/server-ux-17.0-base_tier_validation Translate-URL: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-base_tier_validation/it/
Previous implementation was losing fields in some cases; new one properly merges dicts/tuples. This fixes odd "Missing field string information" errors in form-embedded lists. This cset also removes an obsolete `base_model_name` context key no longer used in Odoo 16. This cset adds a `test_get_view` test which checks for that `need_validation` field; it was failing with the previous impl. Fixes OCA#825.
Computed fields bypass `write`, so we need to override `_write` for that case. Also, the current value before the update needs to be fetched from the database because the new value is already set in the cache.
I just realized that a new author was added to the module during an improvement that merged the functionality of base_tier_validation_waiting. This was overlook during my review and not explicitly accepted. There have been many contributors adding new functionalities and this one was not specially big to be included as author.
…Validation support
TierReview status "waiting" has been added and is the default. Modified the tier review reminder search domain to accommodate invalidate_cache() replaced with invalidate_recordset()
Currently translated at 100.0% (150 of 150 strings) Translation: server-ux-17.0/server-ux-17.0-base_tier_validation Translate-URL: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-base_tier_validation/it/
Co-authored-by: Do Anh Duy <[email protected]>
Co-authored-by: Do Anh Duy <[email protected]>
9aedf95
to
e7545d3
Compare
hi @bosd, I'm not sure the error from your dev tool comes from this module. I also took this opportunity to improve the interface a bit. |
Thanks, If you want, you can include #991 |
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.
LGTM, just a minor change and let's go.
Additionally, please squash the administrative commits a bit. Thanks for the effort!
onToggleCollapse(ev) { | ||
const panelHeading = ev.currentTarget.closest(".panel-heading"); | ||
const collapseDiv = panelHeading.nextElementSibling.matches("div#collapse1") | ||
? panelHeading.nextElementSibling | ||
: null; | ||
if (!collapseDiv) return; | ||
this.state.collapse = !this.state.collapse; | ||
if (this.state.collapse) { | ||
collapseDiv.style.display = "none"; | ||
} else { | ||
collapseDiv.style.display = "block"; | ||
} | ||
} |
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.
The first time you click the widget, it does not open; a second click is needed to collapse it. Please take a look. On the second attempt, it works fine, but if you refresh the view again, it doesn't work. I think the initial state might be related.
supersedes: #966
changes are follow up from old PR:
TierReviewService
). don't use useState to calculate tierReviewCounter because the service will updateservices["mail.store"]
f-string
and placeholder formattingt-esc
)