From 84747245034b5b37e0e93c1dbc1bbf61c486b130 Mon Sep 17 00:00:00 2001 From: Henry Apolinario Date: Mon, 13 May 2024 00:35:17 -0500 Subject: [PATCH] [FIX] pre-commit ruff --- payroll/models/hr_payslip.py | 4 ++-- payroll/models/hr_salary_rule.py | 10 +++++----- payroll/report/report_payslip_details.py | 2 +- payroll/tests/common.py | 2 +- payroll/tests/test_hr_salary_rule.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/payroll/models/hr_payslip.py b/payroll/models/hr_payslip.py index ce75dbd9..88b0ae69 100644 --- a/payroll/models/hr_payslip.py +++ b/payroll/models/hr_payslip.py @@ -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() @@ -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]}) diff --git a/payroll/models/hr_salary_rule.py b/payroll/models/hr_salary_rule.py index be94a40e..3f37ff65 100644 --- a/payroll/models/hr_salary_rule.py +++ b/payroll/models/hr_salary_rule.py @@ -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: #------------------------------- @@ -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: #------------------------------- diff --git a/payroll/report/report_payslip_details.py b/payroll/report/report_payslip_details.py index e1c2d3f4..346167ba 100644 --- a/payroll/report/report_payslip_details.py +++ b/payroll/report/report_payslip_details.py @@ -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) ), } diff --git a/payroll/tests/common.py b/payroll/tests/common.py index 4c690e0e..9c7b0ffb 100644 --- a/payroll/tests/common.py +++ b/payroll/tests/common.py @@ -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( diff --git a/payroll/tests/test_hr_salary_rule.py b/payroll/tests/test_hr_salary_rule.py index 32935562..a4e34a19 100644 --- a/payroll/tests/test_hr_salary_rule.py +++ b/payroll/tests/test_hr_salary_rule.py @@ -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" )