Skip to content

[18.0][IMP] payroll: list/form/search view fixes and batch UX - #309

Open
nimarosa wants to merge 5 commits into
OCA:18.0from
nimarosa:18.0-imp-payroll-views
Open

nimarosa wants to merge 5 commits into
OCA:18.0from
nimarosa:18.0-imp-payroll-views

Conversation

@nimarosa

Copy link
Copy Markdown
Contributor
  • Drops list columns that were dead or duplicated (decorations on states hr.payslip.run does not have, sequence declared twice, invisible="1" leaving empty columns, a contextual action bound to the wrong model), so the lists stop rendering stray or misleading columns.
  • Stops truncating the salary rule name: code and category_id get a fixed width, register_id becomes optional and rule_ids a many2many_tags column, leaving the name the remaining space.
  • Adds sum="Total" to the payslip line lists, opens the computation details grouped by salary rule category and completes the pivot, so amounts no longer have to be added up by hand.
  • Gives hr.payslip.run a chatter (the model already tracks its state), a payslip count smart button and nocontent helpers on the payroll actions, and makes the rule-derived payslip line columns follow allow_edit_payslip_lines.
  • Adds the missing search filters and group-bys (batch start date and status, payslip structure, "My Payslips" and activity filters, salary rule category parent) and disambiguates two pairs of views that shared a name.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @appstogrow,
some modules you are maintaining are being modified, check this out!

Several view definitions referenced states, fields and labels that do not
exist any more:

* the payslip batch list decorated rows on `confirm`, `hr_check`,
  `accont_check` and `cancel`, none of which are values of
  `hr.payslip.run.state` (only `draft` and `close` are), so the whole
  decoration was dead; closed batches are now muted;
* `hr_salary_rule_view_tree_children` declared `sequence` twice, once
  `optional="hide"` and once `column_invisible`, which renders a stray
  column; a single handle column is kept instead;
* `currency_id` was hidden with `invisible="1"` inside `<list>`, which in
  Odoo 18 hides the cell content but keeps the (empty) column and its
  header; only `column_invisible` removes the column;
* the "Payslip Lines" contextual action filters on `register_id` but was
  bound to `hr.payslip`, so it never appeared on a contribution register
  and was meaningless where it did appear;
* the batch kanban labelled the `credit_note` box "Is a Blocking Reason?";
* the salary structure form was titled "Employee Function".
The salary rule lists gave every column the same share of the available
width, so the rule name -- the only column a user reads to identify a rule
-- was truncated while `code` and `register_id` kept space they do not
need.

* the rule lists (both the children list and the one embedded in the
  salary structure form) pin `code` and `category_id` to a fixed width and
  leave `name` unconstrained, so it takes whatever is left;
* `register_id` is rarely set and becomes an optional column;
* `sequence` becomes a handle, which is what the order of the rules in a
  structure is actually edited with;
* the salary structure list rendered `rule_ids` as a comma separated blob
  of every rule name, which pushed the other columns out of view; it is
  now an optional `many2many_tags` column;
* the main salary rule list hid `category_id` with `column_invisible`,
  even though the search view offers grouping by it; it is an ordinary
  optional column now;
* the salary structure form gets the usual `oe_title` heading for `name`,
  like the salary rule form.
Payslip line lists showed no aggregate at all, so reading a payslip or a
batch meant adding the amounts up by hand:

* `total` now carries `sum="Total"` in the payslip line lists (the global
  list, the child lines of a line and the computation details embedded in
  the payslip form). Note that the `sum` attribute is the label of the
  aggregate, not the field it aggregates -- the child lines list asked for
  `sum="total_net"`, which only renamed the column footer;
* the "Payslip Computation Details" action opens grouped by salary rule
  category (the group-by already existed in the search view), so each
  category shows its own subtotal;
* the pivot view gains the salary rule category as the outer row group and
  the employee as the column group, which is what makes it usable on a
  whole batch instead of a single payslip.
@nimarosa
nimarosa force-pushed the 18.0-imp-payroll-views branch from 898c8a3 to 5e0e0db Compare September 22, 2026 16:25
… batches

`hr.payslip.run` inherits `mail.thread` and `mail.activity.mixin` and
tracks its state, but the form had no chatter, so the tracking was written
and never shown and the activities could not be scheduled from the batch.

* the batch form gets a chatter and a button box with the number of
  payslips in the batch and a shortcut to its payslip lines (the action
  already existed as a contextual action);
* the payslip, batch, salary structure and salary rule actions get a
  nocontent helper, so an empty list explains what the record is instead
  of showing nothing;
* the payslip name is read-only outside `draft` in the multi-edit list,
  as it already is in the form;
* in the payslip line list the columns that come from the salary rule
  (`name`, `code`, `sequence`, `category_id`) follow the same
  `allow_edit_payslip_lines` setting as `quantity`, `rate` and `amount`,
  instead of being editable while the amounts are locked;
* the payslip line and contribution register forms are wrapped in a
  `<sheet>`, which is what gives a form its standard layout;
* the contribution register list shows the third party (`partner_id`).
@nimarosa

nimarosa commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping, could someone take a look at this one? It's been a couple of weeks. Thanks.

@nimarosa
nimarosa requested a review from dreispt November 10, 2026 22:26
Comment thread payroll/__manifest__.py Resolved
Comment thread payroll/views/hr_salary_rule_views.xml Resolved
The payroll search views offered little beyond a name search, so the usual
questions ("which batches are still open this quarter", "which payslips
are mine", "how many payslips per structure") could not be answered from
the UI.

* payslip batches: a date filter on the start date and group by status,
  company and start date;
* payslips: the salary structure as a searchable field and a group-by, a
  "My Payslips" filter and the standard activity filters (the model
  inherits `mail.activity.mixin` and the list already shows the activity
  widget);
* salary rule categories: the parent category is searchable and groupable,
  and it is an ordinary optional column instead of being removed from the
  list with `column_invisible`;
* two pairs of views shared the same `name`, which makes them impossible
  to tell apart in the view list; the children variants are suffixed.
@nimarosa
nimarosa force-pushed the 18.0-imp-payroll-views branch from cea8e02 to 279f49f Compare November 11, 2026 13:44
@nimarosa

Copy link
Copy Markdown
Contributor Author

Thanks @dreispt!

  1. Version: reverted, the bot will bump it.
  2. Widths: only on code and category_id, which are short. Without them the columns get the same share and the rule name is cut, which is the one column people read. Core does the same in the invoice lines list. Happy to drop them if you prefer.

@OCA/payroll-maintainers could someone give it a second review?

@dreispt

dreispt commented Nov 11, 2026

Copy link
Copy Markdown
Member

@nimarosa No need to remove the widths, just making sure it wasn't residual slop. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants