feat(spp_drims): Donations review — creation, receipt, inspection and follow-up - #414
Open
emjay0921 wants to merge 11 commits into
Open
feat(spp_drims): Donations review — creation, receipt, inspection and follow-up#414emjay0921 wants to merge 11 commits into
emjay0921 wants to merge 11 commits into
Conversation
Adds a Draft start stage to the donation lifecycle (Draft -> Announced -> Received -> Inspected -> Stocked) with a "Mark Announced" action, and reshapes the form around it: - Cancel renamed to "Cancel Donation". - Donor limited to DRIMS organisations whose role is Donor; donations cannot be recorded against a closed incident (domain + constraint). - At least one item is required to save; the line Description field is removed and Pledged must be entered (no default, must be > 0). - Line columns appear progressively: Received (manual, mandatory) and Variance from Announced, Condition and Action from Inspected; Expiry Date only when product_expiry is installed. - Received quantities are entered manually instead of being auto-copied from Pledged. - Once inspected, items with a non-accept disposition are listed in a separate "Items Not Accepted for Stock" table.
Donation items can only be added or removed while the donation is in draft. The line table is read-only from the received state onward so the "Add a line" row no longer appears once a donation has been received, and donation-line create/unlink are guarded at the model level. The inspection wizard's split rows opt out of the guard so splitting an inspected donation still works.
A product added through "Add a line" on a donation was created non-storable, so it never tracked in inventory and did not appear in Stock on Hand. The donation-line product field now defaults inline product creation to a storable Good (type consu, Track Inventory on).
Items excluded from stock at stocking time (Return / Dispose / Quarantine) are now tracked to resolution instead of only being mentioned in a toast. - Donation lines gain a disposal status (Pending -> Resolved) with resolved date, user and notes; stocking seeds the excluded lines to Pending. - A 'Mark Resolved' action records who/when and posts an audit note to the donation's chatter for accountability. - A dedicated 'Non-Accepted Items' list + menu under Monitoring lists the excluded items (default Pending), filterable and groupable by action; the donation form's 'Items Not Accepted for Stock' table shows the disposal status and a resolve button.
…op empty rows (#1058)
…ons-review # Conflicts: # spp_drims/__manifest__.py # spp_drims/security/ir.model.access.csv
A new donation offered no way to add items. The stylesheet that hides Odoo's blank filler rows on the donation tables excluded .o_field_x2many_list_row_add from the rows it hid, on the assumption that class sits on the <tr>. In Odoo 19 it is on the <td> and the row itself is <tr class="d-print-none">, so the exclusion never matched and the rule hid the "Add a line" row along with the fillers. This was worse than being unable to add items. OP#1076 also requires at least one item before a donation can be saved, so with the add row hidden there was no way to satisfy that rule: a donation could not be created at all. The two rules closed the door on each other. Match the fillers by having no class instead, which is what actually distinguishes them - data rows carry o_data_row and the add row carries d-print-none. If Odoo ever gives fillers a class the rule stops applying and the blank rows come back, which is a cosmetic regression rather than a form nobody can enter data into. Also switches the donation line's hidden quantity field from invisible to column_invisible. Inside a list the former blanks the cells but still renders the column, which is why an empty "Quantity" column sat between Pledged and Unit.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 19.0 #414 +/- ##
==========================================
+ Coverage 72.66% 72.77% +0.10%
==========================================
Files 329 330 +1
Lines 24298 24407 +109
==========================================
+ Hits 17655 17761 +106
- Misses 6643 6646 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The SL demo generator could no longer produce donations. It assumed a donation is created in "announced" and that Mark Received copies the pledged quantity, both of which OP#1076 changed: donations now start in draft, and the received quantity is entered by hand and required before a donation can be marked received. Walk from draft with an explicit announce step, and record demo donations as arriving in full so the receive step has quantities to work with. Caught by CI, not locally: spp_drims_sl_demo is two levels down the dependency chain from spp_drims and a spp_drims-only run cannot see it.
emjay0921
marked this pull request as ready for review
August 13, 2026 09:17
gonzalesedwin1123
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this change needed?
OP#1076 (DRIMS - Full review - Donations) and all four of its children have passed QA — this raises the PR for that work, per the flow of opening PRs once QA signs off.
What is in here
New unit tests
Covering the lifecycle guards, the receive wizard, the follow-up states on non-accepted items, and the form structure.
spp_drimsruns 285 tests.Unit tests executed by the author
On the merged branch:
./spp lint --all-filesclean.How to test manually
Related links
https://openspp.openproject.com/work_packages/1076
Reviewer notes
Two rules in here close a door on each other if either is wrong, which is worth knowing while reviewing. A donation cannot be saved without at least one item, and the items table is state-bounded. During QA a CSS rule intended to hide Odoo's blank filler rows also hid the "Add a line" control — so there was no way to add an item and no way to save without one, and a donation could not be created at all. Fixed in
4751c7ee; the filler rows are now matched by having no class, which is what actually distinguishes them from the add row.The branch was brought up to date by merging
19.0, not rebasing, since it was already published.