Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] hr_employee_calendar_planning #1242

Closed

Conversation

jterolc
Copy link

@jterolc jterolc commented Jun 5, 2023

Standard migration to 16.0

pedrobaeza and others added 30 commits June 5, 2023 12:17
This module allows to manage employee working time with profiles by date
intervals.

The profiles are regular working time calendars, but they are treated as
master ones here, allowing you to compose complexes working times by dates.

Under the hook, a unique working time is created for each employee with the
proper composition for not affecting the rest of the functionality linked to
this model.

Installation
============

During the installation of the module, current working times are split by
start/end dates for having consistent data, and the potential new composed
calendar planning is saved instead on the employee.

Configuration
=============

1. Go to *Employees > Employees*.
2. Open or create a new one.
3. On the "Public Information" page, fill the section "Calendar planning" with:

   * Starting date (optional).
   * Ending date (optional).
   * Working time to apply during that date interval.

Known issues / Roadmap
======================

* Add a wizard for generating next year calendar planning based on current one
  in batch.
* Add constraint for avoiding planning lines overlapping.
* Avoid the regeneration of whole private calendars each time a change is
  detected.

[UPD] README.rst
[UPD] Update hr_employee_calendar_planning.pot
Add _description for model hr.employee.calendar to make it pass runbot.

[UPD] Update hr_employee_calendar_planning.pot
[UPD] Update hr_employee_calendar_planning.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-13.0/hr-13.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-13-0/hr-13-0-hr_employee_calendar_planning/
- On the module init, existing employee calendar leaves should be linked
to the employee's new autocalendar.

hr_employee_calendar_planning 13.0.1.0.1
[UPD] README.rst
[UPD] Update hr_employee_calendar_planning.pot

[UPD] README.rst
Currently translated at 94.4% (17 of 18 strings)

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/fr/
…r when is related to some employee

[UPD] Update hr_employee_calendar_planning.pot

hr_employee_calendar_planning 14.0.1.0.2

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/
… field in to show only allowed records according to company. Add constraint to prevent change avoid changing the company when the calendar is linked to an employee of another company.

[UPD] Update hr_employee_calendar_planning.pot

hr_employee_calendar_planning 14.0.1.1.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/
…even when calendar is not active.

TT31606

[UPD] Update hr_employee_calendar_planning.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/
…weeks.

Regenerate automatic calendar correctly when calendars are 2 weeks old (or any of them are 2 weeks old).
TT32425
…r if calendars have been defined in employee creation.

TT32425

[UPD] README.rst
Currently translated at 100.0% (22 of 22 strings)

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/ca/
…void create employees without calendar planing.

TT35897
hr_employee_calendar_planning 14.0.1.3.1

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/
Parent is not necessary on context, this returns the next error when you
try to select a calendar planning on the employee:
``Uncaught Error: NameError: name 'parent' is not defined``

hr_employee_calendar_planning 14.0.1.4.0
Currently translated at 100.0% (23 of 23 strings)

Translation: hr-14.0/hr-14.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_employee_calendar_planning/es_AR/

hr_employee_calendar_planning 14.0.1.4.1
jonasbuchholz and others added 18 commits June 5, 2023 12:17
When another module was installed with demo data but without testing mode, if the demo data includes some `hr.employee` record, it was impossible to install it after `hr_employee_calendar_planning` was installed.

@moduon MT-1622
Currently translated at 100.0% (23 of 23 strings)

Translation: hr-15.0/hr-15.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_employee_calendar_planning/it/
Currently translated at 100.0% (23 of 23 strings)

Translation: hr-15.0/hr-15.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_employee_calendar_planning/it/
Currently translated at 100.0% (23 of 23 strings)

Translation: hr-15.0/hr-15.0-hr_employee_calendar_planning
Translate-URL: https://translation.odoo-community.org/projects/hr-15-0/hr-15-0-hr_employee_calendar_planning/it/
We should only fill the calendar with sync_user if and only if you don't have one

Sync user is used also when we modify the user of an employee
@jterolc jterolc mentioned this pull request Jun 5, 2023
27 tasks
<attribute name="invisible">1</attribute>
</field>
<field name="resource_calendar_id" position="after">
<field name="calendar_ids">

Choose a reason for hiding this comment

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

@jterolc Hi! Does not seem to be displayed correctly. I tried with a label for the field but doesn't work fine.
image

Copy link
Author

@jterolc jterolc Jun 7, 2023

Choose a reason for hiding this comment

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

The problem is the css rule that is applying a right and left marge to table who is not needed. I can't change this rule because is sourced from core/web...

Can you or someone help to found a clean solution?
Captura desde 2023-06-07 13-17-48

Choose a reason for hiding this comment

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

I think that you can put a new page with full width and put there the field. What do you think about that?

@victoralmau
Copy link
Member

Please, cherry-pick #1253

@victoralmau
Copy link
Member

Please, cherry-pick #1266

@rafaelbn
Copy link
Member

@jterolc , please could you review comments and cherry-pick them? Thank you ! 😄

@jonasbuchholz
Copy link
Contributor

I have checked out and tested this migration. There seems to be an issue with the global leaves when creating a new employee.
Steps to reproduce:

  • create a new employee with working times that contain any global leave

This is due to the fact the upon creation of the new auto-generated calendar, the global leaves are copied from the original calendar. However, they are initially created with the same field values as the original global leaves, including the calendar_id, before they get linked to the auto-generated calendar. Having overlapping global leaves for the same calendar is prevented by this constrain: https://github.com/odoo/odoo/blob/55cd29c5f2cb7787752d77103dbcc4c4007ff504/addons/hr_holidays/models/resource.py#L15-L33

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 18, 2024
@github-actions github-actions bot closed this Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.