Conversation
Contributor
|
Hi @appstogrow, |
The README told salary rule authors to call `payslip.time_parameter("mycode")`,
a method that does not exist in this module nor anywhere else: the helper it
adds is `rule_parameter(code, date=False, get="value")`, which defaults the date
to the start date of the payslip. Document it with its arguments, and give the
module the summary it was missing.
The menu was named "Time Parameters" while the action it opens is named "Rule
Parameters", so the breadcrumb renamed itself on click; the menu now uses the
name of the action, which is also the name of the helper.
The test called `get_time_parameter` twice -- the inherited method from
`base_time_parameter` -- so `rule_parameter` itself, and the date defaulting
that is this module's whole point, were never run. They are covered now, along
with an explicit date and `get="date"`.
The "Help" page of the salary rule form listed, in static XML, the objects a formula may use. That list duplicates `hr.payslip._get_baselocaldict()` by hand, so it drifts from it silently, and it offers no extension point: a module that injects its own object in the local dict -- through `_get_baselocaldict()`, `get_payroll_dict()`, `get_current_contract_dict()` or `_get_tools_dict()` -- had nowhere to document it, and the user writing the formula had no way to discover it. `hr.salary.rule._get_formula_help_sections()` now returns that content as an ordered list of `(title, [(identifier, description), ...])`, rendered by the computed `formula_help` field which the page shows instead of the static lists. A module extends the method with `super()` and appends its own section. Everything is escaped on render, so a section is data, not markup, and a translation cannot break the page. Two modules extend it with their own object: * `payroll_rule_time_parameter` documents `payslip.rule_parameter()`, the helper this module exists for, with its date argument and `get="date"`. * `payroll_contract_advantages` documents `current_contract.advantages`, which it adds to the formula's local dict and which was written down nowhere before.
nimarosa
force-pushed
the
18.0-imp-payroll-formula-help-docs
branch
from
September 22, 2026 16:25
75b8bee to
6822efc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[FIX] payroll_rule_time_parameter: the README told users to call apayslip.time_parameter()method that does not exist; documents the realrule_parameter(code, date=False, get="value")helper and covers it with a test.[IMP] payroll: the salary rule "Help" page duplicated_get_baselocaldict()byhand in static XML;
_get_formula_help_sections()now generates it and lets othermodules extend it with
super().payroll_rule_time_parameterandpayroll_contract_advantageseach add their ownsection through that extension point.