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

Odoo 16: Old "Done" Payslip are Changing due to change in Payslip Batch Status to "Done" #138

Open
abhinavvaidya-tsd opened this issue Jun 5, 2024 · 1 comment

Comments

@abhinavvaidya-tsd
Copy link

abhinavvaidya-tsd commented Jun 5, 2024

Hi Team,

Odoo version: 16

I am encountering an issue where the amounts on my old payslips change when I set the Payslip Batch to Done.

For example below is the rule used:

image

Here is the formula: where 23 represents the number of working days in the month. We update this value manually each month based on the actual number of working days.

worked_days.WORK100.number_of_days * contract.wage / 23

For example, an employee with a salary of 1000 had 21 working days in a particular month, and the payslip is in a 'done' state. However, when I change the payslip batch to "Done" status the salary amount on the old payslip changes to approximately 933.

My general expectation is that the amount on a finalized payslip should not change.

Could you please advise on what might be causing this issue and what steps I can take to prevent it?

Thank you.

@abhinavvaidya-tsd
Copy link
Author

You can fix this by below code

def action_payslip_done(self):
    if self.state in ['draft']:
        self.compute_sheet()
        return self.write({'state': 'done'})

@abhinavvaidya-tsd abhinavvaidya-tsd changed the title Odoo 16: Old Done Payslip are Changing due to change in Payslip rules Odoo 16: Old "Done" Payslip are Changing due to change in Payslip Batch Status to "Done" Jun 11, 2024
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

No branches or pull requests

1 participant