100 Commits
Author SHA1 Message Date
Yannick Tivisse 110635a417 [FIX] account: Prevent master account tags removal
This data is used in the chart of account definition and could put
the end user into a bad situation.

Related ticket: 3790614

closes odoo/odoo#158875

X-original-commit: f48c30181e1335ef72c60ca9e7d14b7f4aa42359
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-25 10:00:48 +00:00
Yannick Tivisse c8456e2f3e [FIX] base: Prevent user_admin deletion
Purpose
=======

Tremendous amount of support tickets (ex: 3800405) are opened because the user_admin
has been removed and is referenced everywhere, leading to tracebacks or
the impossibility to install a new application as res.group configurations
all relies on this, like:

<record id="group_helpdesk_manager" model="res.groups">
    <field name="name">Administrator</field>
    <field name="category_id" ref="base.module_category_services_helpdesk"/>
    <field name="implied_ids" eval="[(4, ref('group_helpdesk_user'))]"/>
    <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>

We could adapt all the occurences (severeal hundreds) to ensure robustness
but this won't prevent developer from introducing new use cases + the user
can be archived instead if we want to remove him from the pricing.

closes odoo/odoo#158885

Taskid: 3802440
X-original-commit: b55994b4c5e737aae593eb0419f96347ad90bebb
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-25 08:33:15 +00:00
Yannick Tivisse a654c78b94 [FIX] website: Prevent default menu deletion
Purpose
=======

Lots of tickets (e.g. 3775298) are created because the default menu has been deleted,
leading to the impossibility to install a new module, as the parent_id
for new menus like /shop or /event are directly referencing the
website.main_menu record, or to the impossibility to create a new
website.

Task-3802440

closes odoo/odoo#158879

X-original-commit: adb1dcfd0a150ab4706a09a29ae8921fb94fa463
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-25 08:33:14 +00:00
Yannick Tivisse 23ea458a81 [FIX] account: Prevent deleting basic accounting pdf reports
Those master data would break the basic accounting pdf generation flow
as those are widely used and it is not expected from end users to delete
them.

Example of support ticket from that issue: 3790875

closes odoo/odoo#158637

Taskid: 3802440
X-original-commit: b1ecc922503ff3a9618e89afd13659e37eb3fbed
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-22 11:20:12 +00:00
Yannick Tivisse 091dcc31a5 [FIX] delivery: Prevent Deliveries product category deletion
Purpose
=======

Lots of tickets are issues when the end user deleted this product
category, leading to the impossibility to install another carrier
as this category is referenced by all the specific carriers products

Ticket example: 3789116

closes odoo/odoo#158626

Taskid: 3802440
X-original-commit: 9383b6f4a5ef0394588c522efcc92e6f37a245cb
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-22 11:20:11 +00:00
Yannick Tivisse 094ab73a2a [FIX] hr_work_entry_holidays: Prevent time off duration erasing
Purpose
=======

The time off duration is set to 0 when the related contract is set
as expired, then we remove the end date and set the contract back
to running.

That's because the check was done before calling super, hence the
contract is excluded from the candidates because it is still expired
without end date, which would make no sense when trying to retrieve
the related calendar.

closes odoo/odoo#157681

Taskid: 3806342
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-15 15:28:03 +00:00
Yannick Tivisse 8b3d1955ca [FIX] hr_holidays: Remove time off time on accrual plan list
In rework of accruals plan, we removed the possibility to set a time off type on the accrual plan directly.

The field has been removed from the form view, but not from the list view.

closes odoo/odoo#157366

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-13 09:14:09 +00:00
Yannick Tivisse e365e22485 [FIX] hr_contract: Track some missing fields on contracts
closes odoo/odoo#157012

Related: odoo/enterprise#58326
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-11 08:35:07 +00:00
Yannick Tivisse 86891b8e08 [FIX] hr_holidays: Avoid useless check_validity calls on payslip computation
closes odoo/odoo#152311

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-02-02 19:49:40 +00:00
Yannick Tivisse 9b44161ad9 [FIX] hr_holidays: Improve time off dashboard loading time
Purpose
=======

From O.6 to 0.04 seconds to call get_allocation_data_request (15x faster)
and 574 to 25 requests for an employee with 10 years of XP in odoo.com.

Part-of: odoo/odoo#152311
2024-02-02 19:49:40 +00:00
Yannick Tivisse 43285ebc96 [FIX] hr_holidays: Compute resource_calendar_id even without work entries
Part-of: odoo/odoo#152311
2024-02-02 19:49:40 +00:00
Yannick Tivisse 02e0bcb10f [FIX] hr_recruitment: Improve application_count field computation time
From 120 seconds to 0.5 seconds for 10000 applicants on odoo.com

closes odoo/odoo#151303

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-02-01 14:30:02 +00:00
Yannick Tivisse f209536348 [FIX] hr_recruitment: Improve job kanban view loading time
Purpose
=======

From 800ms to 6ms to execute _compute_new_application_count on odoo.com

Part-of: odoo/odoo#151303
2024-02-01 14:30:02 +00:00
Yannick Tivisse b1acba35a2 [FIX] hr_contract: Fix undeterministic test crash
closes odoo/odoo#144266

X-original-commit: 517f2ad627fcaa7382271c7792b4dc3523dbe399
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-02-01 14:30:00 +00:00
Yannick Tivisse 13549b56f5 [FIX] project_timesheet_holidays: Fix company right issues
Before this commit, when the company of the employees updated is not
in the allowed_company_ids of the current user (could happen in the
execution of a cron), an error is triggered saying we are not allowed
to create a timesheet for an employee inactive. The reason is because the
employee is not fetched in the check made in the timesheet creation because
of the company of that employee is not in the companies contained in the
environment.

This commit makes sure the companies in the environment are the ones
set on the employees created/updated, to be sure those employees are fetched
in the check made in timesheet creation.

closes odoo/odoo#151656

X-original-commit: ed6b02b6323691f79aa4ff466541eeb9768de1c9
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-31 08:43:43 +00:00
Yannick Tivisse 39d3da451c [FIX] resource: Improve _leave_intervals_batch performances
On N elements resource.calendar.leave and M elements resource.resource recordsets,
the __get__ calls to 4 leave fields were done M time per loop, aka 4*N*M times.

This commit reduces the number of call to 4*N times, reducing the method executing
time for grid_unavailability from 9 seconds to +- 4.5 on odoo.com while displaying
all timesheets on Month view.

closes odoo/odoo#150408

Related: odoo/enterprise#54830
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-26 12:45:40 +00:00
Yannick Tivisse 5e1a6e6a72 [FIX] hr_holidays: Improve dashboard loading time
closes odoo/odoo#150857

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-24 14:02:19 +00:00
Yannick Tivisse 1cc423954c [FIX] hr_work_entry_contract: Don't recompute work entries on salary simulation
closes odoo/odoo#150648

Related: odoo/enterprise#54928
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-24 10:44:39 +00:00
Yannick Tivisse f18faee970 [FIX] hr_contract: Improve list view loading time
Hidden message_needaction fields was taking 2.1 over 2.2 seconds on odoo.com
(+- 5000 contracts in running state)

closes odoo/odoo#148581

X-original-commit: de983bdd038e19703f461d5e529455f957ff842a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-16 13:15:20 +00:00
Yannick Tivisse b749816f91 [FIX] project: Make tests demo data independent
closes odoo/odoo#146649

Related: odoo/enterprise#52936
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-12-18 23:32:05 +00:00
Yannick Tivisse f22084638e [FIX] website_slides: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 478146f80e [FIX] utm,product: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 7466ecd400 [FIX] website: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 533df43e67 [FIX] web: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse efb722c2af [FIX] stock: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 1d094d70f4 [FIX] sale: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse b5ab8fb73b [FIX] purchase: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse de4fc8bb2f [FIX] point_of_sale: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse b1f392ce58 [FIX] payment: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse be58bb0586 [FIX] mrp: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 45db144ffe [FIX] mass_mailing: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 285541e9dd [FIX] mail: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse a8e010c7b5 [FIX] hr_holidays: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 0ba65e908a [FIX] event: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 58a32832c2 [FIX] delivery: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 7d9824d3d6 [FIX] crm: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 043a60b59f [FIX] calendar: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 0f447989d1 [FIX] base_automation: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 2aa2d2655c [FIX] auth_totp,auth_signup: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse b1537a0868 [FIX] account: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse a913272136 [FIX] base: Make tests demo data independent
Part-of: odoo/odoo#146649
2023-12-18 23:32:05 +00:00
Yannick Tivisse 7ebafb1eb7 [IMP] base: Remove manager rights to user demo
closes odoo/odoo#139731

Related: odoo/enterprise#49562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-25 20:56:11 +00:00
Yannick Tivisse 4396f05296 [FIX] base: Allow saving My Profile if not group on field
Purpose
=======

Cannot currently save My Profile due to those 2 fields
- attendance_manager_id (allowed for groups 'Attendances / Administrator')
- employee_cars_count (allowed for groups 'Fleet / Administrator')

They are in the SELF_READABLE_FIELDS property, but the method
check_field_access_rights is not taking that information into account.

Part-of: odoo/odoo#139731
2023-10-25 20:56:11 +00:00
Yannick Tivisse d68696e11e [IMP] hr: Make work address computed before save
closes odoo/odoo#138381

Related: odoo/enterprise#48295
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-20 09:35:14 +00:00
Yannick Tivisse ba3d6356ab [IMP] hr_contract: Add country_code on structure type
closes odoo/odoo#135508

Related: odoo/enterprise#37928
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-28 15:48:23 +00:00
Yannick Tivisse aa4ebe072b [IMP] l10n_au: Add payroll related accounts
Part-of: odoo/odoo#135508
2023-09-28 15:48:22 +00:00
Yannick Tivisse 9de40b92ee [IMP] hr_holidays: Add hourly frequency on accruals
closes odoo/odoo#133441

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-27 14:57:01 +00:00
Yannick Tivisse 60c596fe0a [FIX] hr_holidays: Fix label visibily on accrual levels
Part-of: odoo/odoo#133441
2023-09-27 14:57:01 +00:00
Yannick Tivisse c2ebe70ed4 [IMP] *: Remove todos we won't do
closes odoo/odoo#134836

Related: odoo/enterprise#47144
Related: odoo/upgrade#5129
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-12 17:16:23 +00:00
Yannick Tivisse fb29d7623c [IMP] hr_work_entry: Remove deprecated method
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Yannick Tivisse 681a09a749 [IMP] ir_http: Remove company_id from session_info
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Yannick Tivisse 0a88ae45d6 [IMP] l10n_be_hr_payroll: Move departure reason to hr
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Yannick Tivisse 2e2c43119c [IMP] account: Add method to retrieve valid payment account types
Purpose
=======

Allow inheritance to register payment per payslip in Payroll application

closes odoo/odoo#132495

Related: odoo/enterprise#45994
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-29 09:11:57 +00:00
Yannick Tivisse d6f574058e [FIX] hr: Use real group separator
closes odoo/odoo#105119

Related: odoo/upgrade#4879
Related: odoo/enterprise#32888
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-25 13:58:25 +02:00
Yannick Tivisse a93472a4b2 [FIX] l10n_ch: Unlink res.config.settings after init
Purpose
=======

If not unlinked, it could make it impossible to create a not null
constraint on columns that are installed after l10n_ch before the
garbage collector dropped the existing wizard, leading to an error
like the following:

Table 'res_config_settings': unable to set NOT NULL on column 'ebay_currency'

Part-of: odoo/odoo#105119
2023-08-25 13:58:23 +02:00
Yannick Tivisse 33c299a4fc [FIX] hr_recruitment: Fix _track_template override in case of record deletion
Part-of: odoo/odoo#105119
2023-08-25 13:58:22 +02:00
Yannick Tivisse c0aabf3682 [FIX] hr_contract: Fix access issue on structure type
Part-of: odoo/odoo#105119
2023-08-25 13:58:21 +02:00
Yannick Tivisse 4694bd1c03 [IMP] l10n_ch: Add new accounts to manage payroll
Part-of: odoo/odoo#105119
2023-08-25 13:58:20 +02:00
Yannick Tivisse 3c63396e07 [IMP] hr: Add multi company rule on contract types
Part-of: odoo/odoo#105119
2023-08-25 13:58:18 +02:00
Yannick Tivisse 743d75206c [IMP] fleet: Improve vehicle creation + general UX
Purpose
=======

When you create a vehicle, there is no sense in adding it to the
"registered column", you always start at the first stage. And this
is also very subjective to create a contract for one year. Why ?
In addition, the contract is empty, excepted for the date.

Specification
=============

- When you create a vehicle, his stage is : New Request

- On the contract form view, make the vehicle's field editable,
  the driver is always related to the vehicle.

- Allow to add property fields on vehicle and model

closes odoo/odoo#127298

Taskid: 3349871
Related: odoo/enterprise#43627
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 18:42:15 +02:00
Yannick Tivisse 186f804a25 [IMP] hr_attendance,planning: Manage overtime generation
closes odoo/odoo#127244

Taskid: 3102448
Related: odoo/enterprise#43602
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 18:42:03 +02:00
Yannick Tivisse c1ce7afcef [IMP] hr_recruitment: Avoid copying applicants private phone on partner
Purpose
=======

The partner is not private anymore, so avoid copying the private information
like phone and mobile when creating a partner (from the chatter for instance).

Only copy needed and unavoidable pieces of information like the partner name
and the email address.

closes odoo/odoo#130982

Taskid: 3414035
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 11:48:18 +02:00
Yannick Tivisse b9b165db7d [FIX] hr_work_entry_contract: Correctly compute work entries for edge timezones
closes odoo/odoo#124222

Related: odoo/upgrade#4699
Related: odoo/enterprise#41253
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 10:32:54 +02:00
Yannick Tivisse 8a83cbeb28 [IMP] account: Add salary accounts to generic CoA
Part-of: odoo/odoo#124222
2023-08-17 10:32:53 +02:00
Yannick Tivisse 3312657294 [FIX] hr_payroll_acccount: Make default account configurable on journal
Purpose
=======

2 commits were making impossible to define a default account on a
miscellaneous account journal. However, this is used in payroll
to auto-balance unbalanced moves.

After a discussion with the related team, it has been decided to
revert both commits, which were breaking other use cases as well.

Revert "[FIX] account: fix the domain of default_account_id from account_journal"
This reverts commit b09f06f986.

Revert "[IMP] account: remove default account on misc journal form view"
This reverts commit f2c0bc321b.

Part-of: odoo/odoo#124222
2023-08-17 10:32:52 +02:00
Yannick Tivisse d0e2d1365c [IMP] hr: Expose Social Security Number of employee forms
Part-of: odoo/odoo#124222
2023-08-17 10:32:50 +02:00
Yannick Tivisse b634498fc0 [IMP] hr: Make contract type country specific
Part-of: odoo/odoo#124222
2023-08-17 10:32:49 +02:00
Yannick Tivisse e7ba02b1b1 [IMP] hr_payroll: Move wage_type/schedule_pay on contract
Purpose
=======

Currently the wage_type and the schedule pay are defined on the
salary structure type level, preventing users paying different
employees on the same structure with different salary types or
periodicity, which is a employee choice on certain countries,
like Mexico or the USA.

Specification
=============

Move the logic at the contract level, but keep the structure
type field definition to be used as default values.

Part-of: odoo/odoo#124222
2023-08-17 10:32:48 +02:00
Yannick Tivisse 79e05e16ec [FIX] hr: Allow deleting departure reasons
closes odoo/odoo#131327

X-original-commit: 5db1538af8c3381ab7c9006e11db0844d8d365c1
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-09 19:27:23 +02:00
Yannick Tivisse 9aced74696 [FIX] hr_skills: Allow deleting skill, skill levels and skill types
PURPOSE
=======

Starting from 16.0 we introduced some reports to log skills history, skills evolution.

It means that the skill model is linked to another model, preventing us to delete it.

Usually, we use the message "link to x, archive it instead", but archiving a skill will only be possible from v17 (new task)

So, we need to be able to delete a skill on v16

closes odoo/odoo#131300

Taskid: 3456843
X-original-commit: d9672b55e7a596778fd542541f39e5216c06cb40
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-09 19:27:15 +02:00
Yannick Tivisse 84e8aa90dd [IMP] hr: Prevent non HR people from accessing employees bank accounts
- Billing officers / HR officers have access to all bank accounts
- Internal users only have access to bank accounts that are not linked to an employee
- Portal/Public users have access to nothing.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse 5f93474570 [IMP] web: Allow displaying simple json fields
Purpose
=======

It is currently impossible to display a json field on a form view without
defining a specific widget.

Allow displaying the json field in its simplest form, aka the stringified
content in readonly mode.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse fda7ec5f1f [FIX] mail: Fix truncated template field on mail.composer
TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse 7bd2327d79 [IMP] hr_recruitment: Remove restrictive and confusing ir.rule
No need to hide the chatter to recruiters, as the salary configurator
has been improved to avoid posting sensitive data on the application
form itself.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse 71b9933411 [IMP] hr_recruitment: Avoid partner duplication
Use the application form partner as work contact when converting him into
and employee.

Use the employee work contact as user partner on user creation.

The goal is to have only 1 partner over the whole recruitment process
flow, instead of three, thus reducing the confusion for end users who
don't really know who to choose.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse b1f7e56f79 [IMP] base: Remove private res.partner type
- Improve performances, as the ir.rule restricting private partners
  visibility is also applied on res.users by inheritance, on each
  prefetch.
- Solve the issue of partners set as followers on records (eg: application
  form) and then made private, making them impossible to contact via the
  chatter.
- Solve the multiple access issues when trying to access the bank
  account, or the private address for non HR people like the accountants
  forcing the usage of sudo in the business code.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse e8c48f824e [IMP] hr: Remove address_home_id field
Improve usability of employee form. It is confusing for end users
to create another record to encode the employee address.

Move all the private information on the hr.employee record itself.

Remove the M2O address_home_id.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
Yannick Tivisse 7fa78e68b0 [IMP] hr_work_entry_contract: Add index for performance improvement
From 7s to 2ms for this query with 2.6M records

explain (analyze, verbose, buffers)
SELECT "hr_work_entry"."id" FROM "hr_work_entry" WHERE
(
    ("hr_work_entry"."active" = true) AND
    (
    (
      ("hr_work_entry"."state" in ('validated', 'draft')) AND
      ("hr_work_entry"."contract_id" in (548259))
    )
    AND
    (
     (
      (
       (("hr_work_entry"."date_start" >= '2023-05-01 00:00:00') AND (
        "hr_work_entry"."date_start" < '2023-05-31 23:59:59.999999')
       ) AND
       ("hr_work_entry"."date_stop" > '2023-05-31 23:59:59.999999')
      )
         OR
       ((("hr_work_entry"."date_start" < '2023-05-01 00:00:00') AND
        ("hr_work_entry"."date_stop" <= '2023-05-31 23:59:59.999999')) AND
        ("hr_work_entry"."date_stop" > '2023-05-01 00:00:00'))
    ) OR
      (("hr_work_entry"."date_start" < '2023-05-01 00:00:00') AND
       ("hr_work_entry"."date_stop" > '2023-05-01 23:59:59.999999'))
    )
  )
)
ORDER BY COALESCE("hr_work_entry"."conflict", false) DESC,
         "hr_work_entry"."state" ,"hr_work_entry"."date_start"
;

closes odoo/odoo#124108

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-06-07 15:58:51 +02:00
Yannick Tivisse 1191b5733f [IMP] hr: Improve trial onboarding
PURPOSE
=======

When you start a new trial of an app without demo data, you
want to have everything perfect and ready for your own configuration

closes odoo/odoo#122308

Taskid: 3328654
Related: odoo/enterprise#41423
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-06-06 16:22:45 +02:00
Yannick Tivisse ad0a4faa7d [IMP] calendar: Ensure a warning is properly displayed on private chatter
Purpose
=======

Currently the chatter of a private event is unavailable to excluded users
but a end user might be confused as no explanation message is currently
displayed on the chatter.

closes odoo/odoo#120545

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-05-04 23:30:49 +02:00
Yannick Tivisse d7deac81e9 [IMP] sale: Allow partner removal if linked to draft/cancelled SO
closes odoo/odoo#116881

Taskid: 3233204
X-original-commit: 70686d7482d718776fc1ac9c4bad579e1b5c0f9f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-28 18:46:17 +02:00
Yannick Tivisse 663d708c3b [IMP] project: Remove personal stage garbage collector
Will be reintroduced properly afterward. Currently, even if the
field is defined using ondelete='set null', the M2M relation
doesn't handle the fact that the target table is a real model
and not a simple relational table.

closes odoo/odoo#116880

X-original-commit: f58d2ad669710a353263e418bbf69f5f49145cac
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-28 18:46:14 +02:00
Yannick Tivisse dcbdb6e690 [IMP] project: Remove commercial_partner_id from task/project model
closes odoo/odoo#115155

Taskid: 3231143
Related: odoo/enterprise#38142
Related: odoo/upgrade#4432
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-17 13:43:14 +01:00
Yannick Tivisse c002e4176a [IMP] project: Remove project_color field
Taskid: 3231143
Part-of: odoo/odoo#115155
2023-03-17 13:43:14 +01:00
Yannick Tivisse 0658de98a9 [IMP] bus: Garbage collect bus.presence for archived users
closes odoo/odoo#114656

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-13 13:13:50 +01:00
Yannick Tivisse e79b1a79bc [IMP] base: Garbage collect ir.cron.triggers
Part-of: odoo/odoo#114656
2023-03-13 13:13:49 +01:00
Yannick Tivisse 1c36ad76e8 [IMP] project: Garbage collect personal note stages for archived users
Part-of: odoo/odoo#114656
2023-03-13 13:13:49 +01:00
Yannick Tivisse a573c985e0 [IMP] note: Garbage collect personal note stages for archived users
Part-of: odoo/odoo#114656
2023-03-13 13:13:49 +01:00
Yannick Tivisse 0f66456d75 [IMP] calendar: Allow partner unlink if linked to calendar.attendee
Part-of: odoo/odoo#114656
2023-03-13 13:13:49 +01:00
Yannick Tivisse 9aa04f18d9 [FIX] base: Make user apikeys ondelete cascade on user_id
This could prevent the user deletion if linked to a record of this
type, like a auth_totp.device which inherits from this model.

Part-of: odoo/odoo#114656
2023-03-13 13:13:48 +01:00
Yannick Tivisse 4518a768eb [IMP] website_forum: Allow user deletion if linked to post vote
Purpose
=======

Currently the on_delete='restrict' implicit constraint prevents
the user deletion in case it's linked to a forum post vote.

Set the on_delete attribute to 'cascade' as the record is not
really a critical data.

Taskid: 3222941
Part-of: odoo/odoo#114656
2023-03-13 13:13:48 +01:00
Yannick Tivisse 1223705bbc [IMP] calendar,hr_work_entry: Allow user deletion if linked to filter
Purpose
=======

Currently the on_delete='restrict' implicit constraint prevents
the user deletion in case it's linked to a personal calendar filter
record.

Set the on_delete attribute to 'cascade' as the record is not
of any usage without the user anyway.

Taskid: 3222941
Part-of: odoo/odoo#114656
2023-03-13 13:13:48 +01:00
Yannick Tivisse 2e51c2b5f4 [IMP] mail: Allow user deletion if linked to mail.activity
Purpose
=======

Currently the on_delete='restrict' implicit constraint prevents
the user deletion in case it's linked to a mail.activity record.

Set the on_delete attribute to 'cascade' as the record is not
of any usage without the user anyway.

Taskid: 3222941
Part-of: odoo/odoo#114656
2023-03-13 13:13:48 +01:00
Yannick Tivisse d8c9c8d10b [FIX] base: Handle portal user deletion separately
Purpose
=======

Improve the portal user deletion by preventing timeouts and
avoiding several rollbacks causes.

Specifications
==============

- Move the portal users deletions from autovacuum to its own cron.
  On big databases such as odoo.com, deleting a res.users takes
  more than 1 minute. Move the whole process into its own scheduled
  tasks.
- Commit the deletion at each user. As said previously the deletion
  can be expensive, so commit what has been done to avoid having to
  delete the same user again in case of rollbacks or timeout.
- Delete the user and the partner separately. If the partner is used
  in a sales order for instance, the unlink is possible for the user
  and not the parner. It allows to unlink the user and keep the
  partner in case it cannot be deleted.
- Re-call the cron into another transaction in case there are too many
  users to delete, instead of waiting next call, that is supposed
  to occur the day after.

Taskid: 3222941
Part-of: odoo/odoo#114656
2023-03-13 13:13:47 +01:00
Yannick Tivisse 3a10ef856d [IMP] l10n_mx: Add additional accounts to manage payroll
closes odoo/odoo#112916

Taskid: 3062275
Related: odoo/enterprise#36833
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-02-23 16:08:26 +01:00
Yannick Tivisse 3c4af0cd08 [IMP] hr_skills: Print CV
closes odoo/odoo#101639

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-02-15 17:59:07 +01:00
Yannick Tivisse 3ee6b735fe [FIX] hr_work_entry_contract: Improve work entries generation perf 2023-02-03 10:25:00 +01:00
Yannick Tivisse 3bdfbe31c0 [IMP] hr_attendance: Take lunch time into account on work hours count 2023-02-03 10:25:00 +01:00
Yannick Tivisse 394014f679 [IMP] hr_work_entry_contract: Add method to retrieve lunch intervals 2023-02-03 10:25:00 +01:00
Yannick Tivisse 2e4f399e90 [IMP] hr_work_entry_contract: Add method to ease inheritance 2023-02-03 10:25:00 +01:00