Skip to content

[18.0][MIG] hr_shift: Migration to version 18.0#25

Merged
OCA-git-bot merged 11 commits intoOCA:18.0from
Tecnativa:18.0-mig-hr_shift
Feb 3, 2026
Merged

[18.0][MIG] hr_shift: Migration to version 18.0#25
OCA-git-bot merged 11 commits intoOCA:18.0from
Tecnativa:18.0-mig-hr_shift

Conversation

@david-banon-tecnativa
Copy link
Contributor

Supersedes #17
Additional work done:

  • Fixed shift planning compute lines_data throwing an error on new records.
  • Fixed clicking on shift planning kanvan opening non existing form.
  • Creating a record on shift planning kanban now uses quick create.
  • Views now have names.
  • Squashed bot commits

@Tecnativa @victoralmau @eduezerouali-tecnativa
TT57629

chienandalu and others added 11 commits August 31, 2025 19:12
TT50623

Co-authored-by: chienandalu

[UPD] Update hr_shift.pot

[BOT] post-merge updates
Changes done:
- Add rules related to shift lines
- Add My shifts filter + group by fields
- Add template + employee fields to calendar view
- Set widget="many2one_avatar_employee" to employee_id field (tree view)
Co-authored-by: neitherkx <dpalancamartinez@gmail.com>
@david-banon-tecnativa
Copy link
Contributor Author

Also @mathben can you check if your issue was fixed?

@mathben
Copy link

mathben commented Jan 30, 2026

@david-banon-tecnativa Thanks, my problem is solved!

I propose this little check to reduce crash when missing data.
TechnoLibre@734bfcc


onWillStart(async () => {
this.isHrOfficer = await this.user.hasGroup("hr.group_hr_user");
this.showGeneratePlanning = this.isHrOfficer;
Copy link

Choose a reason for hiding this comment

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

showGeneratePlanning need to be false if has no records, the wizard is only useful when contain records, because it needs to copy from existing.

I try something like that, but it's not working

        Object.defineProperty(this, "hasRecords", {
            get: () => {
                const root = this.model?.root;
                const count = root?.count ?? root?.records?.length ?? 0;
                return count > 0;
            },
        });

        onWillStart(async () => {
            this.isHrOfficer = await this.user.hasGroup("hr.group_hr_user");
            this.showGeneratePlanning = this.isHrOfficer && this.hasRecords;
        });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What crash are you talking about? What steps need to be taken to reproduce it?

Copy link

Choose a reason for hiding this comment

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

@david-banon-tecnativa hide the button «Generate planning» on top when has no data, because it needs an old planning to generate a new one. The problem occur at first installation with no demo, no data.

Copy link

Choose a reason for hiding this comment

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

We can merge this pull request and fix this later, it's not a blocking bug, just a wrong user case.

Copy link

@eduezerouali-tecnativa eduezerouali-tecnativa left a comment

Choose a reason for hiding this comment

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

@david-banon-tecnativa code LGTM + runboat test. Just one thing we have two mig to 18.0 commits, shouldn't they be squash?

@pedrobaeza
Copy link
Member

Let's go with it and it can be improved later. Thanks to all the involved.

/ocabot migration hr_shift
/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-25-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 3, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 3, 2026
2 tasks
@OCA-git-bot OCA-git-bot merged commit 84fb8be into OCA:18.0 Feb 3, 2026
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c73be25. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 18.0-mig-hr_shift branch February 3, 2026 17:27
)
shift.line_ids.create(shift_lines)

def create(Self, vals_list):

Choose a reason for hiding this comment

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

is Self a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is, thanks for find it out, however as it is merged and it doesn't cause any trouble, we can leave as is, and it can be fixed when the module receives another change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.