feat: add work assignment doctype with member hour tracking (LAN-885)#294
feat: add work assignment doctype with member hour tracking (LAN-885)#294MarcCon wants to merge 42 commits into
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Good start!
I think in the requirements I read that each Organization should be able to specify a number of working hours per year and we need to track the members´ actual working hours against that. And, ideally, also allow carrying over excess working hours to the next year.
Let's also add the Work Assignment to the connections in the LANDA Member form.
My idea would be to add a DocType "Organization Work Hours" with a child table to show members of the organization with their hours from the Work Assignment DocType and validate them against the target hours. |
|
See my alternative proposal in LAN-885 |
There was a problem hiding this comment.
Ich habe in "Work Ledger Balance" die Spaltenbreiten angepasst und die Logik so angepasst, dass Work Ledger Entries ohne Work Assignment in der "Expected"-Spalte landen, und solche mit Work Assignment in der "Hours Worked"-Spalte (statt unter/über Null). Dadurch wird eine Verringerung der Expected Hours via Organization nicht mehr als geleistete Arbeit angezeigt.
Weitere nötige Arbeiten:
-
Work Assignment:
- Connections mit Link auf Work Ledger Entry hinzufügen
- DocType ist submittable, aber niemand hat Submit-Rechte (auch Cancel, Amend, usw)
-
Bericht "Arbeitsstunden"
- Für Zeilen ohne Work Assignment sollten wir eine hilfreiche Beschreibung ausgeben, z.B. "Anpassung der erwarteten Arbeitszeit".
- Spalte "Gesamtstunden" umbenennen zu "Stundensaldo"
-
Berichte zu Workspace "Vereinsverwaltung" hinzufügen
-
Als normaler Nutzer (Rolle "Mitgliederverwaltung Verein") durchtesten
-
TypeError beheben:
File "/home/runner/frappe-bench/apps/landa/landa/organization_management/doctype/organization/organization.py", line 105, in on_update create_expected_hours_adjustment_entries(self.name, old - new) ~~~~^~~~~ TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
@barredterra Was ist der Sinn dahinter, es muss doch submitted werden können um die Work Ledger Entrys zu erstellen? |
|
@MarcCon exactly, die Rechte haben gefehlt, sodass niemand buchen kann. Das müsste noch gefixt werden. |
|
Ah habs falsch verstanden, alles klar. |
|
Die offenen Issues sind erledigt, ich teste es noch als normaler Nutzer durch. Edit: In beiden Reports kann ich in den Filtern auch nur den eigenen Verein auswählen und ansehen. |
There was a problem hiding this comment.
Should date and organization be fetched from Work Assignment as well? Seems odd if the user can edit these in the ledger entry.
There was a problem hiding this comment.
So when Work Ledger Entry is created manually and a work assignment is selected, the date and organization field should be read only and fetched from the Work Assignment, correct? And if no Work Assignment is selected, both fields can be edited.
There was a problem hiding this comment.
When a Ledger Entry is created from a Work Assignment all fields should be read only. Only Manual entries without a linked Work Assignment should remain editable? But should we even allow manual Ledger Entrys without a Work Assignment?
There was a problem hiding this comment.
Yes, sounds good. I think manual entries could be used for any necessary individual corrections., i.e. all special cases we didn't think about.
There was a problem hiding this comment.
But what should happen when someone manually creates a Ledger Entry AND selects an existing Work Assignment. In that case the Ledger Entry is not created from a Work Assignment but is connected to one. Should it be editable afterwards or treated like an Entry automatically created from a Work Assignment (not editable)?
|
@greptile |
Confidence Score: 3/5The submission path is correct, but the cancellation path silently leaves orphaned Work Ledger Entries for all but the first member on multi-member assignments, corrupting every affected member's hours balance permanently. Cancellation of any Work Assignment with more than one member will leave orphaned ledger entries that inflate balances going forward. This is a data-integrity defect on a core operation of the new feature. The reporting and scheduler logic are sound, but the flawed delete call needs to be fixed before the feature is used in production. landa/organization_management/doctype/work_assignment/work_assignment.py (cancellation logic) and landa/organization_management/doctype/work_assignment_member/work_assignment_member.json + .py (manual-edit indicators)
|
This PR enables tracking of work hours for members through work assignments.
Features:
Open Questions:
Do we need a hourly account for a member? It is not necessary for the report.