Skip to content

Indian l10n modification for hr_payroll #649

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

Draft
wants to merge 3 commits into
base: 18.0
Choose a base branch
from

Conversation

jmra-odoo
Copy link

With This Commit

  • Added default configurations for deductions and allowances in setting.
  • Added salary components and deductions section in hr_contract.
  • Implemented dynamic percentage-based calculations for payroll allowances.
  • Added computation logic to ensure real-time updates based on wage.
  • Improved salary structure display in payroll & employee contracts.

…ayroll

With This Commit
========================================================

- Added default configurations for deductions and allowances in setting.
- Added salary components and deductions section in `hr_contract`.
- Implemented dynamic percentage-based calculations for payroll allowances.
- Added computation logic to ensure real-time updates based on wage.
- Improved salary structure display in payroll & employee contracts.
@robodoo
Copy link

robodoo commented Mar 19, 2025

Pull request status dashboard

@jmra-odoo jmra-odoo force-pushed the 18.0-payroll-indian-l10n-jmra branch from 946edf8 to 90d148b Compare April 9, 2025 05:41
With This Commit
========================================================

- Added Test Cases for salary component calculations
- Modified some fields to make them monetary
- Minor changes in views according above changes
@jmra-odoo jmra-odoo force-pushed the 18.0-payroll-indian-l10n-jmra branch from 90d148b to b405a19 Compare April 9, 2025 05:55
Copy link

@kais-odoo kais-odoo left a comment

Choose a reason for hiding this comment

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

Hola! thanks for your work this is first round of review.


@api.depends("l10n_in_basic_salary_percent", "wage")
def _compute_l10n_in_basic_salary(self):
for record in self:

Choose a reason for hiding this comment

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

Suggested change
for record in self:
for contract in self:

Copy link
Author

Choose a reason for hiding this comment

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

done!

@api.depends("l10n_in_basic_salary_percent", "wage")
def _compute_l10n_in_basic_salary(self):
for record in self:
record.l10n_in_basic_salary = record.wage * (record.l10n_in_basic_salary_percent / 100)

Choose a reason for hiding this comment

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

Have you checked percentage widget to avoid percentage logic on backend?

Also what if there is an hourly wage instead of a fixed wage on contract?

Copy link
Author

Choose a reason for hiding this comment

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

checked percentage widget how it works and also implemented it.
As of now if there is hourly wages then it set all fields to 0 as PO sir said that these fields are for fixed wages only. If we want, we can calculate the monthly wage from hourly wage by given working schedule hours.

Choose a reason for hiding this comment

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

make code more readable so avoid using record instead of use contract

Copy link
Author

Choose a reason for hiding this comment

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

Okay, I will take care of it from now.

Choose a reason for hiding this comment

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

Did you check those fields that are not related to multi-company environment each company has different value in it. so those fields should be company dependant.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, they were not working with multiple company with different values.
Modified to work with multiple companies with different values.

Comment on lines 19 to 20
<field name="l10n_in_basic_salary_percent" groups="base.group_no_one"/>
<div groups="base.group_no_one">%</div>

Choose a reason for hiding this comment

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

again percentage widget

Copy link
Author

Choose a reason for hiding this comment

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

checked percentage widget how it works and implemented it.

</div>

<label for="l10n_in_house_rent_allowance" />
<div class="o_row mw-80" name="l10n_in_house_rent_allowance">

Choose a reason for hiding this comment

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

did you check this in mobile view

Copy link
Author

Choose a reason for hiding this comment

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

Yes it looks perfect i think,
2025-04-10_17-08

<div groups="base.group_no_one">%</div>
</div>

<label for="l10n_in_leave_days" />

Choose a reason for hiding this comment

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

Suggested change
<label for="l10n_in_leave_days" />
<label for="l10n_in_leave_days"/>

Copy link
Author

Choose a reason for hiding this comment

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

done!

<div groups="base.group_no_one">%</div>
</div>

<label for="l10n_in_supplementary_allowance" />

Choose a reason for hiding this comment

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

Suggested change
<label for="l10n_in_supplementary_allowance" />
<label for="l10n_in_supplementary_allowance"/>

check this in all files

Copy link
Author

Choose a reason for hiding this comment

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

done!, I will take care of formatting.

With this commit
====================================================

- Made salary structure company dependent
- Added percentage widget to required fields & code formatting
@jmra-odoo jmra-odoo force-pushed the 18.0-payroll-indian-l10n-jmra branch from c2c114d to 69d698a Compare April 11, 2025 12:01
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