Skip to content

Conversation

@Andrii9090
Copy link

@Andrii9090 Andrii9090 commented Oct 16, 2025

The date.range model currently supports only a single company (company_id).
This requires creating multiple date ranges for different companies, which complicates management.
To resolve this, we replace the field company_id with company_ids (Many2many) in the model date.range

It's a short video with funcional test
https://www.loom.com/share/f1a0719eafa443058e3a0befc0eed9b4?sid=fbbd55c0-f75d-48aa-b9ec-d93e28af320f

Issue
@moduon
MT-10678

@OCA-git-bot
Copy link
Contributor

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

@Andrii9090 Andrii9090 marked this pull request as draft October 16, 2025 13:50
@Andrii9090 Andrii9090 changed the title [IMP] date_range: Set multicompanies support for the date.range model [18.0][IMP] date_range: Set multicompanies support for the date.range model Oct 16, 2025
@Andrii9090 Andrii9090 marked this pull request as ready for review October 16, 2025 14:10
Copy link

@cav-adhoc cav-adhoc left a comment

Choose a reason for hiding this comment

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

LGTM

@Andrii9090
Copy link
Author

Hi @lmignon can you review this PR?

Thanks ❤️

@rafaelbn
Copy link
Member

Hello @StefanRijnhart , @sbidoul @lmignon ✋🏼

Please could you please take a look here just a quick review? 🙏🏼 😄

Thank you!!!! ❤️
Rafael

@EmilioPascual
Copy link

@Andrii9090 can you rebase it for review it functionally? Thank you.

@Andrii9090 Andrii9090 force-pushed the 18.0-imp-date_range-multi_companies branch from 9145b7e to 11d2e14 Compare January 7, 2026 11:54
@Andrii9090
Copy link
Author

@EmilioPascual runboat is available, you can functionally review it.

Copy link

@EmilioPascual EmilioPascual left a comment

Choose a reason for hiding this comment

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

LGTM. Functional and code review.

Good work @Andrii9090

@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). 🤖

@Andrii9090
Copy link
Author

Hello @StefanRijnhart , @sbidoul @lmignon

Please could you take a look this PR just a quick review?

Copy link

@Gelojr Gelojr left a comment

Choose a reason for hiding this comment

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

Congratulations on the great work on this PR @Andrii9090 .
The following functional tests have been performed with the results indicated below.

  • Test 1: Creation of a minimal Date Range Type – OK
  • Test 2: Multi-company Date Range creation using company_ids – OK
  • Test 3: Creation of a global Date Range without companies – OK
  • Test 4: Overlap blocking when Date Ranges share at least one company and overlap is not allowed – OK
  • Test 5: Overlap allowed when Date Ranges do not share any company – OK
  • Test 6: Consistency check between Date Range Type company_id and Date Range company_ids – OK
  • Test 7: Generate Date Ranges wizard creates Date Ranges with company_ids correctly set – OK
  • Test 8: Multi-company record rule visibility based on company_ids – OK
  • Test 9: Generate Date Ranges wizard with empty Company field generates global Date Ranges only (no duplication per company) – OK

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Code review.

@Andrii9090 Andrii9090 force-pushed the 18.0-imp-date_range-multi_companies branch from 11d2e14 to 11c63e8 Compare January 8, 2026 15:37
@Andrii9090 Andrii9090 requested a review from yajo January 8, 2026 15:41
@Andrii9090 Andrii9090 force-pushed the 18.0-imp-date_range-multi_companies branch from 11c63e8 to f6c266d Compare January 8, 2026 15:54
Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Some comments to improve code. Mostly OK. Thanks!

The date.range model currently supports only a single company (company_id).
This requires creating multiple date ranges for different companies,
which complicates management.
To resolve this, replace the company_id field with company_ids (Many2many).

MT-10678
@Andrii9090 Andrii9090 force-pushed the 18.0-imp-date_range-multi_companies branch from f6c266d to f63cdf8 Compare January 9, 2026 15:25
@Andrii9090 Andrii9090 requested a review from yajo January 9, 2026 15:25
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.

7 participants