*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ include_once("./inc.php");
if (file_exists($conffile)) include_once($conffile);
require_once($dolibarr_main_document_root."/core/lib/admin.lib.php");
require_once($dolibarr_main_document_root."/core/class/extrafields.class.php");
-
+require_once("lib/repair.lib.php");
$grant_query='';
$etape = 2;
@@ -262,6 +262,29 @@ foreach($listofmodulesextra as $tablename => $elementtype)
}
+// Check and clean linked elements
+if (GETPOST('clean_linked_elements'))
+{
+ // propal => order
+ print "| ".checkLinkedElements('propal', 'commande')." | \n";
+
+ // propal => invoice
+ print "".checkLinkedElements('propal', 'facture')." | \n";
+
+ // order => invoice
+ print "".checkLinkedElements('commande', 'facture')." | \n";
+
+ // order => shipping
+ print "".checkLinkedElements('commande', 'shipping')." | \n";
+
+ // shipping => delivery
+ print "".checkLinkedElements('shipping', 'delivery')." | \n";
+
+ // order_supplier => invoice_supplier
+ print "".checkLinkedElements('order_supplier', 'invoice_supplier')." | \n";
+}
+
+
// Run purge of directory
if (GETPOST('purge'))
{
diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang
index 74e18ff8822..83553a53b5b 100644
--- a/htdocs/langs/fr_FR/install.lang
+++ b/htdocs/langs/fr_FR/install.lang
@@ -155,7 +155,10 @@ MigrationShippingDelivery2=Mise à jour stockage des expéditions 2
MigrationFinished=Migration terminée
LastStepDesc=Dernière étape: Définissez ici le compte et mot de passe du premier utilisateur que vous allez utiliser pour vous connecter à l'application. Ne perdez pas ces identifiants, il s'agit du compte permettant d'administrer les autres.
ActivateModule=Activation du module %s
-
+LinkedElementsInvalidDeleted=%s liaisons invalides ont été supprimées
+NothingToDelete=Aucune liaison invalide trouvée
+SourceType=Source
+TargetType=Cible
#########
# upgrade
diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 57bb0c8aa09..1b8a4aa8bca 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -126,7 +126,7 @@ if (empty($reshook))
$action="";
}
- if ($action == 'setaccountancy_code_buy')
+ if ($action == 'setaccountancy_code_sell')
{
$object->fetch($id,$ref);
$result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']);