From 9d2f1532434f7d0f5c0b46b3431346325c57c92f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Oct 2005 05:51:45 +0000 Subject: [PATCH] Fix: bug #14740 overview: Ajout details contrat sans produit impossible --- mysql/migration/1.1.0-2.0.0.sql | 4 ++++ mysql/tables/llx_contratdet.sql | 2 +- mysql/tables/llx_facturedet.sql | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mysql/migration/1.1.0-2.0.0.sql b/mysql/migration/1.1.0-2.0.0.sql index f47fbef6f36..62656d87f73 100644 --- a/mysql/migration/1.1.0-2.0.0.sql +++ b/mysql/migration/1.1.0-2.0.0.sql @@ -1886,3 +1886,7 @@ alter table llx_commande add ref_client varchar(30) after ref; alter table llx_facture add ref_client varchar(30) after facnumber; alter table llx_facture add date_valid date after datef; alter table llx_facture add model varchar(50) after note; + +alter table llx_facturedet modify fk_product integer NULL; +alter table llx_contratdet modify fk_product integer NULL; +update llx_facturedet set fk_product = null where fk_product=0; \ No newline at end of file diff --git a/mysql/tables/llx_contratdet.sql b/mysql/tables/llx_contratdet.sql index 9faf1c7928e..1f8f46e99e5 100644 --- a/mysql/tables/llx_contratdet.sql +++ b/mysql/tables/llx_contratdet.sql @@ -26,7 +26,7 @@ create table llx_contratdet tms timestamp, fk_contrat integer NOT NULL, - fk_product integer NOT NULL, + fk_product integer NULL, -- doit pouvoir etre nul pour ligne detail sans produits statut smallint DEFAULT 0, diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql index 644214d16c7..f22c914fc5b 100644 --- a/mysql/tables/llx_facturedet.sql +++ b/mysql/tables/llx_facturedet.sql @@ -1,6 +1,6 @@ -- =================================================================== -- Copyright (C) 2001-2005 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2004-2005 Laurent Destailleur -- -- 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 @@ -24,7 +24,7 @@ create table llx_facturedet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, - fk_product integer DEFAULT 0 NOT NULL, + fk_product integer NULL, -- doit pouvoir etre nul pour ligne detail sans produits description text, tva_taux real DEFAULT 19.6, -- taux tva qty real, -- quantité