Skip to content
Snippets Groups Projects
Commit f041ab73 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #14383 TIME 0:20 fix custom fields tu

parent ea813dbb
No related branches found
No related tags found
No related merge requests found
...@@ -298,7 +298,7 @@ UPDATE res_attachments SET attachment_type = 'reply_record_management' WHERE att ...@@ -298,7 +298,7 @@ UPDATE res_attachments SET attachment_type = 'reply_record_management' WHERE att
ALTER TABLE custom_fields DROP COLUMN IF EXISTS mode; ALTER TABLE custom_fields DROP COLUMN IF EXISTS mode;
DROP TYPE IF EXISTS custom_fields_modes; DROP TYPE IF EXISTS custom_fields_modes;
CREATE TYPE custom_fields_modes AS ENUM ('form', 'technical'); CREATE TYPE custom_fields_modes AS ENUM ('form', 'technical');
ALTER TABLE custom_fields ADD COLUMN mode custom_fields_modes DEFAULT 'form'; ALTER TABLE custom_fields ADD COLUMN mode custom_fields_modes NOT NULL DEFAULT 'form';
/* RE CREATE VIEWS */ /* RE CREATE VIEWS */
CREATE OR REPLACE VIEW res_view_letterbox AS CREATE OR REPLACE VIEW res_view_letterbox AS
......
...@@ -1314,11 +1314,14 @@ CONSTRAINT acknowledgement_receipts_pkey PRIMARY KEY (id) ...@@ -1314,11 +1314,14 @@ CONSTRAINT acknowledgement_receipts_pkey PRIMARY KEY (id)
) )
WITH (OIDS=FALSE); WITH (OIDS=FALSE);
CREATE TYPE custom_fields_modes AS ENUM ('form', 'technical');
CREATE TABLE custom_fields CREATE TABLE custom_fields
( (
id serial NOT NULL, id serial NOT NULL,
label character varying(256) NOT NULL, label character varying(256) NOT NULL,
type character varying(256) NOT NULL, type character varying(256) NOT NULL,
mode custom_fields_modes NOT NULL DEFAULT 'form',
values jsonb, values jsonb,
CONSTRAINT custom_fields_pkey PRIMARY KEY (id), CONSTRAINT custom_fields_pkey PRIMARY KEY (id),
CONSTRAINT custom_fields_unique_key UNIQUE (label) CONSTRAINT custom_fields_unique_key UNIQUE (label)
......
...@@ -24,6 +24,7 @@ class CustomFieldControllerTest extends TestCase ...@@ -24,6 +24,7 @@ class CustomFieldControllerTest extends TestCase
$args = [ $args = [
'label' => 'mon custom', 'label' => 'mon custom',
'type' => 'select', 'type' => 'select',
'mode' => 'form',
'values' => ['one', 'two'] 'values' => ['one', 'two']
]; ];
$fullRequest = \httpRequestCustom::addContentInBody($args, $request); $fullRequest = \httpRequestCustom::addContentInBody($args, $request);
...@@ -43,6 +44,7 @@ class CustomFieldControllerTest extends TestCase ...@@ -43,6 +44,7 @@ class CustomFieldControllerTest extends TestCase
$args = [ $args = [
'label' => 'mon custom', 'label' => 'mon custom',
'type' => 'select', 'type' => 'select',
'mode' => 'form',
'values' => ['one', 'two'] 'values' => ['one', 'two']
]; ];
$fullRequest = \httpRequestCustom::addContentInBody($args, $request); $fullRequest = \httpRequestCustom::addContentInBody($args, $request);
...@@ -76,6 +78,7 @@ class CustomFieldControllerTest extends TestCase ...@@ -76,6 +78,7 @@ class CustomFieldControllerTest extends TestCase
$args = [ $args = [
'label' => 'mon custom22', 'label' => 'mon custom22',
'mode' => 'form',
'values' => ['one', 'two', 'trois'] 'values' => ['one', 'two', 'trois']
]; ];
$fullRequest = \httpRequestCustom::addContentInBody($args, $request); $fullRequest = \httpRequestCustom::addContentInBody($args, $request);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment