NEW : Add llx_socpeople.use_thirdparty_address column (#39499)

Data structure only, submitted standalone as asked by CONTRIBUTING.md, so it can be
reviewed and accepted before the code that uses it.

A contact can either carry its own address or reuse the address of its thirdparty.
Today the choice is guessed from the content of the address fields, which cannot tell
an empty address from a deliberate "use the thirdparty address". The new column stores
the choice explicitly.

  0     = use the address of the contact
  1     = use the address of the linked thirdparty
  NULL  = legacy resolution, the value for every existing record, so an existing
          alternative address stays independent from its thirdparty address.

Code side: #38118.
This commit is contained in:
VIAL-GOUTEYRON Quentin 2026-08-19 02:41:55 +02:00 committed by GitHub
parent 1cafc092df
commit 5847c6b687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -78,4 +78,9 @@ UPDATE llx_commande_fournisseurdet SET subprice_ttc = 0 WHERE subprice_ttc <> 0
UPDATE llx_facture_fourn_det SET pu_ttc = 0 WHERE pu_ttc <> 0 AND EXISTS (SELECT c.rowid FROM llx_const as c WHERE c.name = 'MAIN_VERSION_LAST_UPGRADE' AND c.value < '25.0.0');
UPDATE llx_supplier_proposaldet SET subprice_ttc = 0 WHERE subprice_ttc <> 0 AND EXISTS (SELECT c.rowid FROM llx_const as c WHERE c.name = 'MAIN_VERSION_LAST_UPGRADE' AND c.value < '25.0.0');
-- Explicit contact address mode flag. NULL keeps the legacy resolution for existing records,
-- so an existing alternative contact address stays independent from its thirdparty address.
-- VMYSQL4.1 ALTER TABLE llx_socpeople ADD COLUMN use_thirdparty_address smallint DEFAULT NULL AFTER fk_soc;
-- VPGSQL8.2 ALTER TABLE llx_socpeople ADD COLUMN use_thirdparty_address smallint DEFAULT NULL;
-- end of migration

View file

@ -25,6 +25,7 @@ create table llx_socpeople
datec datetime,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_soc integer, -- lien vers la societe
use_thirdparty_address smallint DEFAULT NULL, -- 1=use linked thirdparty address, 0=use contact address, null=legacy resolution
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
name_alias varchar(255),