Skip to content

Conversation

@tde-banana-odoo
Copy link
Contributor

@tde-banana-odoo tde-banana-odoo commented May 21, 2025

This PR removes the company_type field, which was previously used to distinguish
between 'Person' and 'Company' contacts.

The goal is to simplify the contact form and model by eliminating this distinction, as part
of an effort to streamline and simplify the contact information structure.

Changes in l10n* modules:

l10n_sa* : Use the vat field instead of is_company to determine whether a partner
is a company or an individual:

  • VAT filled (15 digits) → Company
  • VAT empty → Individual

The VAT field enforces a minimum length of 15 digits, ensuring only valid
Saudi VAT numbers can be entered.


l10n_tr* : Turkish electronic invoicing now uses VAT length to determine the schemeID:

  • 10-digit VAT → company (VKN)
  • 11-digit VAT → individual (TCKN)

l10n_es* : determine if a Spanish VAT number represents a legal entity based on
CIF structure: 1 letter + 8 digits (e.g., A12345678) → legal entity


l10n_ar* : determine a partner is a legal entity based on the AFIP identification type
and CUIT prefix.

Logic:
- AFIP code = '80' (CUIT)
- CUIT prefix in ('30', '33', '34', '51', '55') → considered a company

l10n_hu* : determine if a partner is a company based on VAT structure:

- VAT starts with 'HU' and is 10 digits, or
- Matches the Hungarian EU format: 8 digits - [2/4/5] - 2 digits

l10n_* : general : removed is_company / company_type from demo/tests

This change is in line with the broader initiative to remove legacy fields and make the model
more straightforward as possible.

It had a good run — well, not really — but it's dead for good now.

Removed fields:
base : is_company, company_type, company_name
crm : commercial_partner_id
survey : certifications_company_count
website_slides : slide_channel_company_count

Task-4714892

@robodoo
Copy link
Contributor

robodoo commented May 21, 2025

Pull request status dashboard

@C3POdoo C3POdoo added the RD research & development, internal work label May 21, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 5 times, most recently from f35a33f to 4d2465e Compare May 28, 2025 07:14
Copy link
Contributor

@mrsr-odoo mrsr-odoo left a comment

Choose a reason for hiding this comment

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

Hello @yagp-odoo 👋 ,

Left some comments
But it feels strange that we sometimes use vat or parent_id in place of is_company(earlier it was easy to distinguish)
It might cause undesirable behaviour to the many flows
Can't we rely on parent_id only?

Thanks

@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from 4d2465e to ab1ae35 Compare May 29, 2025 13:23
@yagp-odoo
Copy link
Contributor

Hello @mrsr-odoo 👋

But it feels strange that we sometimes use vat or parent_id in place of is_company
It might cause undesirable behavior to the many flows

Agreed it might cause unexpected outcome, but we mainly wants to check for VAT, as any registered company must have a VAT.

earlier it was easy to distinguish

Yes, but from what I understood, we're now wants to check its subject to VAT or not, not by distinguish its person or company.

Can't we rely on parent_id only?

In some cases YES, we can like for checking its root contact,..etc. A contact with False parent_id doesn't necessary have to be a Company, so checking VAT in most cases should do I think.

Though this can still be change when l10n modules come into play, Accounting Team/s may wants something different 🙃

@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 6 times, most recently from bdf5c9c to 8c6b21a Compare June 5, 2025 12:47
@tde-banana-odoo
Copy link
Contributor Author

@qdp-odoo I bet somehow this should interest you at some point. Draft and not finished in any way but hey.

@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 7 times, most recently from b85b531 to a813bc9 Compare June 12, 2025 13:03
Copy link
Contributor

@mrsr-odoo mrsr-odoo left a comment

Choose a reason for hiding this comment

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

Hello @yagp-odoo 👋 ,
Left some comments
Some conflicts to resolves
Thanks

@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 5 times, most recently from 2a54909 to ba2b5a5 Compare July 1, 2025 09:28
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from b39a0a4 to 1ab8f12 Compare September 25, 2025 10:43
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Sep 26, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from 1ab8f12 to 372a087 Compare September 26, 2025 13:04
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Sep 29, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from 372a087 to ccfcbaf Compare September 29, 2025 12:28
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Oct 6, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 2 times, most recently from 9a519e7 to 7629199 Compare October 6, 2025 06:38
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Oct 14, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from 7629199 to 8426487 Compare October 14, 2025 12:25
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Oct 15, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from 8426487 to dba053c Compare October 15, 2025 05:40
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Oct 16, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from dba053c to 4224884 Compare October 16, 2025 12:22
yagp-odoo pushed a commit to odoo-dev/upgrade-util that referenced this pull request Oct 27, 2025
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch 3 times, most recently from 9726837 to fca5a3a Compare October 27, 2025 09:38
This commit removes the 'company_type' field, which was previously used to
distinguish between 'Person' and 'Company' contacts.

We'll now use computed `is_company` based on VAT and Commercial Partner to
distinguish Individual/Company.

The goal is to simplify the contact form and model by eliminating this distinction,
as part of an effort to streamline and simplify the contact information structure.

This change is in line with the broader initiative to remove legacy fields and
make the model more straightforward as possible.

It had a good run — well, not really — but it's dead for good now.

Removed fields:
base  : company_type, company_name
crm : commercial_partner_id
survey : certifications_company_count
website_slides : slide_channel_company_count

Task-4714892
This commit removes 'company_name'. Now 'parent_name' will replace
'company_name' in places like website form, crm, portal address etc.

Task-4714892
Computed the field 'is_company' to determine if a partner is a
legal entity in Argentina, based on the AFIP identification type
and CUIT prefix.

This replaces reliance on the deprecated 'is_company' field, in line with
contact model simplification.

Logic:
- AFIP code = '80' (CUIT)
- CUIT prefix in ('30', '33', '34', '51', '55') → considered a company

Task-4714892
Use the `vat` field instead of `is_company` to determine whether a partner
is a company or an individual:

- VAT filled (15 digits) → Company
- VAT empty → Individual

The VAT field enforces a minimum length of 15 digits, ensuring only valid
Saudi VAT numbers can be entered.

Task-4714892
Turkish electronic invoicing now uses VAT length to determine the schemeID:
- 10-digit VAT → company (VKN)
- 11-digit VAT → individual (TCKN)

Task-4714892
Compute 'is_company' to determine if a Spanish VAT number
represents a legal entity based on CIF structure:
- Format: 1 letter + 7 digits + checksum (digit or letter)

If VAT is not following CIF Format or False, we'll take it as Individual.

Task-4714892
Computed field 'is_company' to determine if a partner
is a company in Hungary, based on VAT structure.

Logic considers a partner a company if:
- VAT starts with 'HU' and Followed by 8 digits (European format), or
- Matches the Hungarian format: 8 digits - [2/4/5] - 2 digits

Task-4714892
For Romanian CIUS RO invoices, set `is_b2b` / Compute `is_company`
based on VAT checks:
- CNP-like or `9000...` → individual (B2C)
- Valid CUI via `stdnum` → company (B2B)

Task-4714892
Compute 'is_company' by checking the 'l10n_it_codice_fiscale':
 - 11 digits → companies/legal entities
 - 16 digits → individuals

Task-4714892
Use the 'vat' field to compute 'is_company' to determine whether a partner
is a company or an individual:

The Unified Business Number (UBN, 統一編號) is the number assigned to businesses
within Taiwan for tax (VAT) purposes. The number consists of 8 digits, the
last being a check digit.

Task-4714892
Updates demo data and tests across various l10n_* modules to reflect
the removal of the 'is_company/company_type' field from the contact model.

Task-4714892
@yagp-odoo yagp-odoo force-pushed the master-rem-base-sayonara-company-type-yagp branch from fca5a3a to 7e4481d Compare October 27, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.