[OCA PR #1746] [16.0][FIX] quality_control_oca: fix singleton error on batch deletion of inspections #2

Open
navigator wants to merge 2 commits from pr-1746 into 16.0
Owner

Original PR: https://github.com/OCA/manufacture/pull/1746
Author: @uolaizola (on GitHub)


Description

This PR fixes a ValueError: Expected singleton that occurs when attempting to delete multiple qc.inspection records simultaneously.

Technical Motivation

In Odoo 16, the @a


Mirrored automatically by OCA Neural Reviewer for AI-assisted code review.

**Original PR:** https://github.com/OCA/manufacture/pull/1746 **Author:** @uolaizola (on GitHub) --- **Description** This PR fixes a ValueError: Expected singleton that occurs when attempting to delete multiple qc.inspection records simultaneously. **Technical Motivation** In Odoo 16, the @a --- _Mirrored automatically by [OCA Neural Reviewer](https://git.pop.coop/pop/oca-reviewer) for AI-assisted code review._
The _unlink_except_autogenerated_and_non_draft method failed with a
"Expected singleton" error when attempting to delete multiple
inspections at once.

This commit:
- Fixes the singleton error by using recordset filtering.
- Improves UX by collecting all failing records into a single
  UserError message, rather than raising an error on the first
  failure found.
[16.0] [UPD] quality_control_oca: i18n, rename and update translation template
Some checks failed
tests / Detect unreleased dependencies (pull_request) Has been cancelled
pre-commit / pre-commit (pull_request) Has been cancelled
415d1b9e40
- Rename quality_control.pot to quality_control_oca.pot to match
  the module name.
- Update the template with new strings for the consolidated
  unlink error messages.
- Remove deprecated error strings.
Some checks failed
tests / Detect unreleased dependencies (pull_request) Has been cancelled
pre-commit / pre-commit (pull_request) Has been cancelled
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin pr-1746:pr-1746
git switch pr-1746

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 16.0
git merge --no-ff pr-1746
git switch pr-1746
git rebase 16.0
git switch 16.0
git merge --ff-only pr-1746
git switch pr-1746
git rebase 16.0
git switch 16.0
git merge --no-ff pr-1746
git switch 16.0
git merge --squash pr-1746
git switch 16.0
git merge --ff-only pr-1746
git switch 16.0
git merge pr-1746
git push origin 16.0
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
oca-mirror/manufacture!2
No description provided.