Skip to content

[18.0][ADD] hr_collective_agreement#1544

Draft
Anxo82 wants to merge 1 commit intoOCA:18.0from
sygel-technology:18.0-add-hr_collective_agreement
Draft

[18.0][ADD] hr_collective_agreement#1544
Anxo82 wants to merge 1 commit intoOCA:18.0from
sygel-technology:18.0-add-hr_collective_agreement

Conversation

@Anxo82
Copy link

@Anxo82 Anxo82 commented Feb 4, 2026

Copy link

@NL66278 NL66278 left a comment

Choose a reason for hiding this comment

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

👍 Thank you for your contribution. Just purge copyright lines from the init files and add some help or explanation and it will be good to go.

@Anxo82 Anxo82 force-pushed the 18.0-add-hr_collective_agreement branch 2 times, most recently from a93336b to 3f34e24 Compare February 5, 2026 10:32
Copy link

@NL66278 NL66278 left a comment

Choose a reason for hiding this comment

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

👍 Actually I am not quite sure whether the domain on the partner_id field is still needed with _check_company_auto, but it will not hurt anyway. Thanks again!

Copy link

@Jaimermaccione Jaimermaccione left a comment

Choose a reason for hiding this comment

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

@Anxo82


The module has been reviewed functionally in a local environment. It works as expected and no issues were found in normal usage. Below are a few improvement ideas mainly related to usability and basic access control.

1. Unified search

Current situation
Users need to choose whether they want to search by code or name.

Proposal
Use a single search that checks both fields at the same time.

Value
Faster and more comfortable to use, especially when there are many agreements.


2. State management

Current situation
The state field is shown as a regular selection field inside the form.

Proposal
Move it to the header and show it as a status bar.

Extra note
In the current Spanish and Catalan translations, the state field is translated as “province”. It should simply be “state”.

Value
Makes it easier to understand the agreement status at a glance and follows the usual Odoo patterns.


3. Access rights

Current situation
Any internal user can create or edit collective agreements.

Proposal
Limit creation and editing to HR admin users, keeping read access for all internal users.

Optional
Adding separate configuration menus (scope, official publication) would be nice, but if that’s too much, the access rights change alone already helps a lot.

Value
Prevents accidental changes and ensures only users with the right level of access can modify this data.


Conclusion

Functionally, the module is fine. These are small improvements that would make it clearer and safer to use.

@Anxo82 Anxo82 force-pushed the 18.0-add-hr_collective_agreement branch from 3f34e24 to 77ab40e Compare February 9, 2026 14:52
@Anxo82
Copy link
Author

Anxo82 commented Feb 9, 2026

@Jaimermaccione All requested changes have been applied. Could you please review again?
Thanks

Copy link

@Jaimermaccione Jaimermaccione left a comment

Choose a reason for hiding this comment

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

@Anxo82 The module has been functionally reviewed in a local environment and tested according to the requested changes.

Verified points:

  • Unified search: search by code and name works correctly.
  • State management: the state is shown as a status bar and behaves as expected.
  • Access rights: creation and editing are correctly restricted by permissions.
  • Automatic state updates: state changes based on publication date and expiration date work correctly.
  • Translations: the “state” translation issue has been fixed.

All tested scenarios behave as expected.

Conclusion
LGTM. Good job — the module is in a very solid shape.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@Anxo82 Anxo82 force-pushed the 18.0-add-hr_collective_agreement branch 2 times, most recently from 28083b2 to 96db0af Compare February 11, 2026 11:48
if expired:
raise ValidationError(
_(
"The collective agreement cannot be activated because its "

Choose a reason for hiding this comment

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

If more than one register fails, how do you know which one is failing?

def action_finish(self):
invalid = self.filtered(lambda r: r.state != "active")
if invalid:
raise ValidationError(_("Only active agreements can be finished."))

Choose a reason for hiding this comment

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

If more than one register fails, how do you know which one is failing?

self.write({"state": "finished"})

def action_cancel(self):
self.write({"state": "cancelled"})

Choose a reason for hiding this comment

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

Here, states are not checked, or can anyone cancel from anywhere?

@Anxo82 Anxo82 force-pushed the 18.0-add-hr_collective_agreement branch from 96db0af to 1ccf9c0 Compare February 12, 2026 11:18
Copy link

@Jaimermaccione Jaimermaccione left a comment

Choose a reason for hiding this comment

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

@Anxo82 Hi Anxo,

I have functionally reviewed the new mass actions for cancelling and/or finishing collective agreements.

From a functional perspective, both actions work correctly and behave as expected depending on the agreement state. Good job on that.

1. README clarification (mass actions behavior)

I would suggest refining the README to better specify how the mass actions behave depending on the agreement state.

Instead of:

Additionally, multiple agreements can be selected from the list view and
processed simultaneously using the action menu.

I would propose something more explicit, such as:

Additionally, multiple agreements can be selected from the list view and
processed simultaneously using the action menu.

From this action menu, users can:

  • Cancel agreements that are in Draft or Active state.
  • Finish agreements that are in Active state only.

Please review this wording in case anything does not exactly match the implemented behavior.

As a small UX improvement suggestion:
currently, when selecting agreements in mixed states, the action is shown and a warning is displayed if some records are not eligible, which is perfectly fine.

As a possible enhancement, it might be worth considering enabling or displaying mass actions only when all selected agreements are in compatible states (or showing them disabled with a tooltip). This would make the behavior more predictable and prevent invalid selections upfront.

That said, since the current behavior is already correct, this would only make sense if it can be implemented as a very lightweight change; otherwise, the existing approach is perfectly acceptable.

2. Duplication behavior (small usability improvement)

Apologies if this goes slightly beyond the current scope.

While testing the feature, I needed to duplicate some agreements and noticed that duplication is currently blocked because the code field cannot be repeated (which is correct).

However, it might improve usability if, when duplicating a record, the code is not copied to the new record. This would allow users to reuse most of the configuration values while still being forced to define a new unique code.

Could you please review whether it would be feasible to override the duplication behavior so that code is cleared on copy?

Let me know your thoughts.

Thanks!

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.

5 participants