dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] pattern for adding tables in dolibarr's module


From: Régis Houssin
Subject: Re: [Dolibarr-dev] pattern for adding tables in dolibarr's module
Date: Tue, 28 Aug 2012 11:45:02 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:14.0) Gecko/20120713 Thunderbird/14.0

désolé je le fait en français :

tu as besoin d'un champ entité sur toutes les tables des objets principaux (le lien avec la table llx_societe ou llx_socpeople ne compte pas)
mais par contre tu n'as pas besoin de l'ajouter sur la ou les tables de détails de cette objet si cette table est liée avec la clé étrangère de cette objet

exemple :

llx_facture contient un champ entity
mais llx_facturedet non car liée via fk_facture

lorsque tu as un index unique :

UNIQUE INDEX (code)

tu dois rajouter le champ entity

UNIQUE INDEX (code, entity)

pour autoriser les doublons entre entité

lors d'un create() tu dois avoir un "global $conf" et tu utilises "$conf->entity" pour remplir ce champ


Le 28/08/12 11:31, Marc-Henri Pamiseux a écrit :
Hi Régis,

You mean that if i create a table that is linked with the llx_societe
table or with the llx_socpeople table, then it isn't necessary to add
the entity column in the created table.

But if the table is not created in connection with a table containing
the column entity, then it is necessary to add that column in my table
definition.

To be valid, there must be an SQL constraint binding the tables,
otherwise the link between tables is not an obligation.

To be valid, there must be an SQL constraint binding the tables,
otherwise the link between tables is not an obligation. Otherwise, the
created table must contain the entity column.

Is it what you mean ?

Le 28/08/2012 09:59, Régis Houssin a écrit :
you can add "entity" field for multicompany module in object table but
not in detail table (already linked with foreign key)
Hope to read you,


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Cordialement,
-- 
Régis Houssin
---------------------------------------------------------
Cap-Networks
Cidex 1130
34, route de Gigny
71240 MARNAY
FRANCE
VoIP: +33 1 83 62 40 03
GSM: +33 6 33 02 07 97
Web: http://www.cap-networks.com/
Email: address@hidden

Dolibarr developer: address@hidden
Web Portal: http://www.dolibarr.fr/
SaaS offers: http://www.dolibox.fr/
Shop: http://www.dolistore.com/
Development platform: https://doliforge.org/
---------------------------------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]