Skip to content

feat: add work assignment doctype with member hour tracking (LAN-885)#294

Open
MarcCon wants to merge 30 commits intoversion-15-hotfixfrom
lan-885
Open

feat: add work assignment doctype with member hour tracking (LAN-885)#294
MarcCon wants to merge 30 commits intoversion-15-hotfixfrom
lan-885

Conversation

@MarcCon
Copy link
Copy Markdown
Collaborator

@MarcCon MarcCon commented Jan 12, 2026

This PR enables tracking of work hours for members through work assignments.

Features:

  • Work Assignment DocType
  • Work Hours Report
  • button to create work assignments directly from a member record

Open Questions:
Do we need a hourly account for a member? It is not necessary for the report.

@MarcCon MarcCon requested a review from barredterra January 12, 2026 08:45
MarcCon and others added 3 commits January 16, 2026 09:23
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>
Copy link
Copy Markdown
Member

@barredterra barredterra left a comment

Choose a reason for hiding this comment

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

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.

@MarcCon
Copy link
Copy Markdown
Collaborator Author

MarcCon commented Jan 26, 2026

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.

@MarcCon MarcCon requested a review from barredterra January 26, 2026 09:39
@barredterra
Copy link
Copy Markdown
Member

See my alternative proposal in LAN-885

@barredterra barredterra assigned barredterra and unassigned MarcCon Feb 11, 2026
@barredterra barredterra assigned MarcCon and unassigned barredterra Feb 11, 2026
@MarcCon MarcCon requested a review from barredterra February 18, 2026 11:31
organization_name: DF.Data | None
work_assignment: DF.Link | None
# end: auto-generated types
pass

Check warning

Code scanning / CodeQL

Unnecessary pass Warning

Unnecessary 'pass' statement.

Copilot Autofix

AI 24 days ago

To fix this, remove the unnecessary pass statement from the WorkLedgerEntry class body while leaving the auto-generated types block untouched. This preserves all existing behavior (including type-checker-only hints) and simply eliminates a redundant no-op.

Concretely, in landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py, delete line 27 (pass) from the WorkLedgerEntry class definition. No additional imports, methods, or definitions are needed.

Suggested changeset 1
landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py b/landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py
--- a/landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py
+++ b/landa/organization_management/doctype/work_ledger_entry/work_ledger_entry.py
@@ -24,7 +24,6 @@
 		organization_name: DF.Data | None
 		work_assignment: DF.Link | None
 	# end: auto-generated types
-	pass
 
 
 def create_yearly_negative_entries():
EOF
@@ -24,7 +24,6 @@
organization_name: DF.Data | None
work_assignment: DF.Link | None
# end: auto-generated types
pass


def create_yearly_negative_entries():
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link
Copy Markdown
Member

@barredterra barredterra left a comment

Choose a reason for hiding this comment

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

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'
    

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