Skip to content

Commit

Permalink
[FIX] pre-commit ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hapolinario committed May 13, 2024
1 parent 122fb21 commit 8474724
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions payroll/models/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def get_inputs(self, contracts, date_from, date_to):
Inputs computation.
@returns: Returns a dict with the inputs that are fetched from the salary_structure
associated rules for the given contracts.
"""
""" # noqa: E501
res = []
current_structure = self.struct_id
structure_ids = contracts.get_all_structures()
Expand Down Expand Up @@ -653,7 +653,7 @@ def get_payslip_vals(
return res
contract = self.env["hr.contract"].browse(contract_ids[0])
res["value"].update({"contract_id": contract.id})
# We check if struct_id is already filled, otherwise we assign the contract struct.
# We check if struct_id is already filled, otherwise we assign the contract struct. # noqa: E501
# If contract don't have a struct, we return.
if struct_id:
res["value"].update({"struct_id": struct_id[0]})
Expand Down
10 changes: 5 additions & 5 deletions payroll/models/hr_salary_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class HrSalaryRule(models.Model):
# inputs: object containing the computed inputs.
# payroll: object containing miscellaneous values related to payroll
# current_contract: object with values calculated from the current contract
# result_rules: object with a dict of qty, rate, amount an total of calculated rules
# tools: object that contain libraries and tools that can be used in calculations
# result_rules: object with a dict of qty, rate, amount an total of calculated rules # noqa: E501
# tools: object that contain libraries and tools that can be used in calculations # noqa: E501
# Available compute variables:
#-------------------------------
Expand Down Expand Up @@ -130,15 +130,15 @@ class HrSalaryRule(models.Model):
# inputs: object containing the computed inputs.
# payroll: object containing miscellaneous values related to payroll
# current_contract: object with values calculated from the current contract
# result_rules: object with a dict of qty, rate, amount an total of calculated rules
# tools: object that contain libraries and tools that can be used in calculations
# result_rules: object with a dict of qty, rate, amount an total of calculated rules # noqa: E501
# tools: object that contain libraries and tools that can be used in calculations # noqa: E501
# Available compute variables:
#-------------------------------
# result: returned value have to be set in the variable 'result'
# result_rate: the rate that will be applied to "result".
# result_qty: the quantity of units that will be multiplied to "result".
# result_name: if this variable is computed, it will contain the name of the line.
# result_name: if this variable is computed, it will contain the name of the line. # noqa: E501
# Example:
#-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion payroll/report/report_payslip_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _get_report_values(self, docids, data=None):
"get_details_by_rule_category": self.get_details_by_rule_category(
payslips.mapped("line_ids").filtered(lambda r: r.appears_on_payslip)
),
"get_lines_by_contribution_register": self.get_lines_by_contribution_register( # noqa: disable=B950
"get_lines_by_contribution_register": self.get_lines_by_contribution_register( # noqa: E501
payslips.mapped("line_ids").filtered(lambda r: r.appears_on_payslip)
),
}
2 changes: 1 addition & 1 deletion payroll/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def setUp(self):
"condition_select": "none",
"amount_select": "fix",
"amount_fix": 10.0,
"quantity": "worked_days.WORK100 and worked_days.WORK100.number_of_days",
"quantity": "worked_days.WORK100 and worked_days.WORK100.number_of_days", # noqa: E501
}
)
self.rule_commission = self.SalaryRule.create(
Expand Down
2 changes: 1 addition & 1 deletion payroll/tests/test_hr_salary_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_parent_child_order(self):
payslip.onchange_employee()
payslip.compute_sheet()

# Parent and child rule should not be calculated even if child rule condition is true
# Parent and child rule should not be calculated even if child rule condition is true # noqa: E501
parent_line = payslip.line_ids.filtered(
lambda record: record.code == "PARENT_TEST"
)
Expand Down

0 comments on commit 8474724

Please sign in to comment.