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][IMP]add seq to inspection template #160

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

rpsjr
Copy link

@rpsjr rpsjr commented Oct 28, 2024

add seq widget to inspection templates allowing template itens reorder

Original template:
image
Inspection made with original template:
image
Reordered template:
image
Inspection made with reordered template:
image

@OCA-git-bot
Copy link
Contributor

Hi @marcelsavegnago,
some modules you are maintaining are being modified, check this out!

@rpsjr rpsjr mentioned this pull request Oct 28, 2024
1 task
@rpsjr
Copy link
Author

rpsjr commented Oct 29, 2024

ping @marcelsavegnago @ivantodorovich

Comment on lines +29 to +33
# Sort the lines by sequence before appending
for line in sorted(
self.inspection_template_id.inspection_template_line_ids,
key=lambda linei: linei.sequence,
):

Choose a reason for hiding this comment

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

Suggested change
# Sort the lines by sequence before appending
for line in sorted(
self.inspection_template_id.inspection_template_line_ids,
key=lambda linei: linei.sequence,
):
for line in self.inspection_template_id.inspection_template_line_ids.sorted("sequence"):

💡 tip: you can just use the model's sorted method

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.

3 participants