From 605b56eeae103e176557f9df6ac8328e910a682f Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:53:04 +0100 Subject: [PATCH] FIX: asset: missing ref_ext field used in CommonObject::isExistingObject() --- htdocs/asset/class/assetmodel.class.php | 1 + htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_asset_model-asset.sql | 1 + 3 files changed, 6 insertions(+) diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 0e457761f9d2e..208e90efa5075 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -94,6 +94,7 @@ class AssetModel extends CommonObject public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => 0), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1,), 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetTypeIntangible', '1' => 'AssetTypeTangible', '2' => 'AssetTypeInProgress', '3' => 'AssetTypeFinancial'), 'validate' => 1,), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 0, 'validate' => 1,), diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 65901dcd91e9e..b2397e2069cf0 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -420,3 +420,7 @@ UPDATE llx_c_units SET short_label = 'mn' WHERE short_label = 'i' AND code = 'MI ALTER TABLE llx_c_holiday_types DROP INDEX uk_c_holiday_types; ALTER TABLE llx_c_holiday_types ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_c_holiday_types ADD UNIQUE INDEX uk_c_holiday_types (entity, code); + + +-- Add ref_ext to asset_model to use various CommonOjbect methods +ALTER TABLE llx_asset_model ADD COLUMN ref_ext varchar(255) AFTER ref; diff --git a/htdocs/install/mysql/tables/llx_asset_model-asset.sql b/htdocs/install/mysql/tables/llx_asset_model-asset.sql index 8c2855159868f..9a264204e58d2 100644 --- a/htdocs/install/mysql/tables/llx_asset_model-asset.sql +++ b/htdocs/install/mysql/tables/llx_asset_model-asset.sql @@ -25,6 +25,7 @@ CREATE TABLE llx_asset_model( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id ref varchar(128) NOT NULL, + ref_ext varchar(255), label varchar(255) NOT NULL, asset_type smallint NOT NULL, fk_pays integer DEFAULT 0,