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

Automatic include_all fixed for Deduction form and Allowance form #564

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

Conversation

unreal0901
Copy link
Contributor

@unreal0901 unreal0901 commented Mar 8, 2025

Issue #552 fixed
Moved the logic of setting include_active_employees from Deduction Model save method to Deduction Form save method.

Haven't tested completely.

Moved logic here in DeductionForm save method.

  def save(self, commit: bool = ...) -> Any:
        specific_employees = self.data.getlist("specific_employees")
        include_all = self.data.get("include_active_employees")
        condition_based = self.data.get("is_condition_based")
        if not specific_employees and not include_all and not condition_based:
            self.instance.include_active_employees = True
        super().save(commit)
.
.
.

From DeductionModel save method.

    def save(self):
        super().save()

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.

1 participant