private static string addGroupProperties(GroupData groupData, string decalage, ViewKind viewKind)
        {
            string render = "";
            List<PropertyData> properties = groupData.ListOfProperties;
            List<PropertyData> oe_properties = new List<PropertyData>();

            if ((groupData.Root) && (!groupData.Report))
            {
                List<PropertyData> no_oe_properties = new List<PropertyData>();
                foreach (PropertyData propertyData in properties)
                {
                    if (!propertyData.ShowInView)
                    {
                        continue;
                    }

                    if (propertyData.OEtitle > 0)
                    {
                        oe_properties.Add(propertyData);
                    }
                    else
                    {
                        no_oe_properties.Add(propertyData);
                    }
                }

                if (oe_properties.Count > 0)
                {
                    List<PropertyData> oe = new List<PropertyData>(oe_properties.Count);
                    foreach (PropertyData propertyData in oe_properties)
                    {
                        oe.Add(null);
                    }

                    foreach (PropertyData propertyData in oe_properties)
                    {
                        oe[propertyData.OEtitle - 1] = propertyData;
                    }
                    oe_properties = oe;

                    render += "\t\t\t\t" + decalage + "<group colspan=\"" + groupData.ClassData.Columns + "\" col=\"1\">\r\n";
                    render += "\t\t\t\t\t" + decalage + "<div class=\"oe_title\">\r\n";
                    render += "\t\t\t\t\t\t" + decalage + "<div class=\"oe_edit_only\">\r\n";

                    render += "\t\t\t\t\t\t\t" + decalage;

                    string suite = ", ";
                    for (int i = 0; i < oe_properties.Count; i++)
                    {
                        if (i == oe_properties.Count - 2)
                        {
                            suite = " et ";
                        }

                        if (i == oe_properties.Count - 1)
                        {
                            suite = "";
                        }

                        //render += "\t\t\t\t\t\t\t" + decalage + "<label for=\"" + oe_properties[i].Name + "\"/>" + suite + "\r\n";
                        render += "<b>" + oe_properties[i].Alias + "</b>" + suite;
                    }

                    render += "\r\n";

                    render += "\t\t\t\t\t\t" + decalage + "</div>\r\n";
                    render += "\t\t\t\t\t\t" + decalage + "<h1>\r\n";
                    render += "\t\t\t\t\t\t\t" + decalage + "<field name=\"" + oe_properties[0].Name + "\" default_focus=\"1\" placeholder=\"" +  Utils.ReplaceSpecialChar(oe_properties[0].Alias) + "\"/>\r\n";
                    render += "\t\t\t\t\t\t" + decalage + "</h1>\r\n";

                    for (int i = 1; i < oe_properties.Count; i++)
                    {
                        PropertyData propertyData = oe_properties[i];

                        if (!propertyData.Typage.Equals("many2many") && !propertyData.Typage.Equals("one2many"))
                        {
                            string nolabel = /*(propertyData.ShowLabel) ? "" :*/ " nolabel=\"1\"";

                            string colspan = "";
                            string unwritable = "";
                            string onchange = "";
                            string states = "";

                            if (!viewKind.Equals(ViewKind.ReportFilter))
                            {
                                //colspan = (propertyData.ColSpan.Equals("")) ? " colspan=\"2\"" : " colspan=\"" + propertyData.ColSpan + "\"";
                                unwritable = (propertyData.Readonly.Equals("")) ? "" : " readonly=\"" + propertyData.Readonly + "\"";
                                onchange = (propertyData.OnChange.Equals("")) ? "" : " on_change=\"" + propertyData.OnChange + "\"";
                                states = (propertyData.States.Equals("")) ? "" : " states=\"" + propertyData.States + "\"";
                            }

                            string select = (propertyData.Select.Equals("")) ? "" : " select=\"" + propertyData.Select + "\"";

                            string default_focus = "";
                            if (propertyData.Name.Equals("name"))
                            {
                                default_focus = " default_focus=\"1\"";
                            }

                            //render += "\t\t\t\t\t" + decalage + "<label for=\"" + propertyData.Name + "\"/>\r\n";
                            render += "\t\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "\" placeholder=\"" + Utils.ReplaceSpecialChar(propertyData.Alias) + "\" " + nolabel + select + colspan + unwritable + onchange + states + default_focus + "/>\r\n";

                            if (propertyData.Name.Equals("code"))
                            {
                                //render += "\t\t\t\t" + decalage + "<label colspan=\"4\"/>\r\n";
                                //render += "\t\t\t\t" + decalage + "<separator colspan=\"" + classData.Columns + "\"/>\r\n";
                                //render += "\t\t\t\t" + decalage + "<newline/>\r\n";
                            }
                        }
                    }

                    render += "\t\t\t\t\t" + decalage + "</div>\r\n";
                    render += "\t\t\t\t\t" + decalage + "<div style='border:1'></div>\r\n";
                    render += "\t\t\t\t" + decalage + "</group>\r\n";
                    render += "\t\t\t\t" + decalage + "<separator colspan=\"" + groupData.ClassData.Columns + "\" style=\"border-top: 1px solid gainsboro;\"/>\r\n";

                    properties = no_oe_properties;
                }
            }

            List<PropertyData> maxuse_properties = new List<PropertyData>();
            foreach (PropertyData propertyData in properties)
            {
                if (!propertyData.MaxUse.Equals(""))
                {
                    maxuse_properties.Add(propertyData);
                }
            }

            foreach (PropertyData propertyData in properties)
            {
                if (!propertyData.Typage.Equals("many2many") && !propertyData.Typage.Equals("one2many"))
                {
                    string nolabel = (propertyData.ShowLabel) ? "" : " nolabel=\"1\"";

                    string colspan = "";
                    string unwritable = "";
                    string onchange = "";
                    string states = "";

                    if (!viewKind.Equals(ViewKind.ReportFilter))
                    {
                        colspan = (propertyData.ColSpan.Equals("")) ? " colspan=\"2\"" : " colspan=\"" + propertyData.ColSpan + "\"";
                        unwritable = (propertyData.Readonly.Equals("")) ? "" : " readonly=\"" + propertyData.Readonly + "\"";
                        onchange = (propertyData.OnChange.Equals("")) ? "" : " on_change=\"" + propertyData.OnChange + "\"";
                        states = (propertyData.States.Equals("")) ? "" : " states=\"" + propertyData.States + "\"";
                    }

                    string select = (propertyData.Select.Equals("")) ? "" : " select=\"" + propertyData.Select + "\"";

                    string default_focus = "";
                    if (propertyData.Name.Equals("name"))
                    {
                        default_focus = " default_focus=\"1\"";
                    }

                    if (!propertyData.MaxUse.Equals(""))
                    {
                        string[] maxuse = propertyData.MaxUse.Split(new char[] { '.' });

                        onchange = " on_change=\"onchange_" + propertyData.Name + "(" + maxuse[0] + "_id, " + propertyData.Name + ")\"";

                        render += "\t\t\t\t" + decalage + "<label for=\"" + propertyData.Name + "\"/>\r\n";
                        render += "\t\t\t\t" + decalage + "<div>\r\n";
                        render += "\t\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "\"" + nolabel + select + unwritable + onchange + states + default_focus + "/>\r\n";
                        render += "\t\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "_label\"/>\r\n"; //string=\"Valeur maximum autorisee : \"/>\r\n";
                        render += "\t\t\t\t" + decalage + "</div>\r\n";
                    }
                    else
                    {
                        if (propertyData.Typage.Equals("many2one"))
                        {
                            foreach (PropertyData propData in maxuse_properties)
                            {
                                string[] maxuse = propData.MaxUse.Split(new char[] { '.' });
                                string[] linkmanyclass = propertyData.LinkManyClass.Split(new char[] { '.' });

                                if (maxuse[0].Equals(linkmanyclass[1]))
                                {
                                    onchange = " on_change=\"onchange_" + propertyData.Name + "(" + propertyData.Name + ", " + propData.Name + ")\"";
                                }
                            }
                        }

                        render += "\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "\"" + nolabel + select + colspan + unwritable + onchange + states + default_focus + "/>\r\n";
                    }
                    
                    if (propertyData.Name.Equals("code"))
                    {
                        //render += "\t\t\t\t" + decalage + "<label colspan=\"4\"/>\r\n";
                        //render += "\t\t\t\t" + decalage + "<separator colspan=\"" + classData.Columns + "\"/>\r\n";
                        //render += "\t\t\t\t" + decalage + "<newline/>\r\n";
                    }
                }
            }

            foreach (KeyValuePair<string, GroupData> group in groupData.ListOfGroups)
            {
                render += addFormGroup(group.Value, "\t\t", false, viewKind);
            }

            foreach (PropertyData propertyData in properties)
            {
                if (propertyData.Typage.Equals("many2many"))
                {
                    string colspan = (propertyData.ColSpan.Equals("")) ? " colspan=\"" + groupData.ClassData.Columns + "\"" : " colspan=\"" + propertyData.ColSpan + "\"";
                    string unwritable = (propertyData.Readonly.Equals("")) ? "" : " readonly=\"" + propertyData.Readonly + "\"";
                    string onchange = (propertyData.OnChange.Equals("")) ? "" : " on_change=\"" + propertyData.OnChange + "\"";
                    string select = (propertyData.Select.Equals("")) ? "" : " select=\"" + propertyData.Select + "\"";
                    string states = (propertyData.States.Equals("")) ? "" : " states=\"" + propertyData.States + "\"";

                    if (propertyData.ShowLabel)
                    {
                        render += "\t\t\t\t" + decalage + "<newline/>\r\n";
                        render += "\t\t\t\t" + decalage + "<separator string=\"" + Utils.ReplaceSpecialChar(propertyData.Alias) + "\"" + colspan + "/>\r\n";
                    }

                    //render += "\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "\"" + colspan + unwritable + onchange + " nolabel=\"1\"/>\r\n";

                    render += "\t\t\t\t" + decalage + "<field" + colspan + " name=\"" + propertyData.Name + "\" nolabel=\"1\" widget=\"one2many_list\"" + select + states + unwritable + onchange +">\r\n";

                    if (propertyData.ClassLink != null)
                    {
                        if (!propertyData.ClassLink.Parent.Native)
                        {
                            render += "\t\t\t\t\t" + decalage + "<form string=\"" + Utils.ReplaceSpecialChar(propertyData.Alias) + "\">\r\n";

                            foreach (PropertyData prop in propertyData.ClassLink.ListOfProperties)
                            {
                                if (!prop.Name.Equals(propertyData.ClassLink.Name + "_id"))
                                {
                                    if (prop.ShowInTree)
                                    {
                                        render += "\t\t\t\t\t\t" + decalage + "<field name=\"" + prop.Name + "\"/>\r\n";
                                    }
                                }
                            }

                            render += "\t\t\t\t\t" + decalage + "</form>\r\n";
                        }
                    }

                    render += "\t\t\t\t" + decalage + "</field>\r\n";
                }
            }

            foreach (PropertyData propertyData in properties)
            {
                if (propertyData.Typage.Equals("one2many"))
                {
                    string colspan = (propertyData.ColSpan.Equals("")) ? " colspan=\"" + groupData.ClassData.Columns + "\"" : " colspan=\"" + propertyData.ColSpan + "\"";
                    string unwritable = (propertyData.Readonly.Equals("")) ? "" : " readonly=\"" + propertyData.Readonly + "\"";
                    string onchange = (propertyData.OnChange.Equals("")) ? "" : " on_change=\"" + propertyData.OnChange + "\"";
                    string select = (propertyData.Select.Equals("")) ? "" : " select=\"" + propertyData.Select + "\"";
                    string states = (propertyData.States.Equals("")) ? "" : " states=\"" + propertyData.States + "\"";

                    if (propertyData.ShowLabel)
                    {
                        render += "\t\t\t\t" + decalage + "<newline/>\r\n";
                        render += "\t\t\t\t" + decalage + "<separator string=\"" + Utils.ReplaceSpecialChar(propertyData.Alias) + "\"" + colspan + "/>\r\n";
                    }

                    //render += "\t\t\t\t" + decalage + "<field name=\"" + propertyData.Name + "\"" + colspan + " nolabel=\"1\"/>\r\n";

                    if ((propertyData.ClassLink != null) && (!propertyData.ClassLink.Parent.Native))
                    {
                        if (!states.Equals(""))
                        {
                            states = "";

                            if (!propertyData.Readonly.Equals("1"))
                            {
                                string[] sts = propertyData.States.Split(new char[] { ',' });
                                string st = "";
                                for (int i = 0; i < sts.Length; i++)
                                {
                                    st = "'" + sts[i].Trim() + "'" + ((i == sts.Length - 1)? "":",");
                                }

                                unwritable = " attrs=\"{'readonly':[('state', 'not in', (" + st + "))]}\"";
                            }
                        }
                    }

                    render += "\t\t\t\t" + decalage + "<field" + colspan + " name=\"" + propertyData.Name + "\" nolabel=\"1\" widget=\"one2many_list\"" + select + states + unwritable + onchange + ">\r\n";

                    if (propertyData.ClassLink != null)
                    {
                        if (!propertyData.ClassLink.Parent.Native)
                        {
                            string editable = "";

                            if (propertyData.TreeEditable)
                            {
                                editable = " editable=\"top\"";
                            }

                            render += "\t\t\t\t\t" + decalage + "<tree string=\"" + Utils.ReplaceSpecialChar(propertyData.Alias) + "\"" + editable + ">\r\n";

                            foreach (PropertyData prop in propertyData.ClassLink.ListOfProperties)
                            {
                                if ((!prop.Name.Equals(propertyData.ClassLink.Name + "_id")) && (!prop.Name.Equals(propertyData.Parent.Name + "_id")))
                                {
                                    if (prop.ShowInTree)
                                    {
                                        render += "\t\t\t\t\t\t" + decalage + "<field name=\"" + prop.Name + "\"/>\r\n";
                                    }
                                }
                            }

                            render += "\t\t\t\t\t" + decalage + "</tree>\r\n";
                        }
                    }

                    render += "\t\t\t\t" + decalage + "</field>\r\n";
                }
            }

            return render;
        }
 public static string addFormGroup(GroupData groupData, string decalage, bool first, ViewKind viewKind)
 {
     return addFormGroup(null, groupData, decalage, first, viewKind);
 }
        public static string addFormGroup(ClassData classData, GroupData groupData, string decalage, bool first, ViewKind viewKind)
        {
            string render = "";

            if (classData != null)
            {
                if ((first) && (classData.StateWorkflow))
                {
                    render = "\t\t\t\t" + decalage + "<h1 colspan=\"" + classData.Columns + "\" col=\"" + classData.Columns + "\">\r\n";

                    foreach (KeyValuePair<string, string> state in classData.StateProperty.SelectionData.ListOfValues)
                    {
                        Program.ProjectData.addTraduction(classData, state.Value);
                        Program.ProjectData.addTraduction(classData, classData.Alias + " : " + state.Value);

                        render += "\t\t\t\t\t" + decalage + "<label string=\"" + Utils.ReplaceSpecialChar(classData.Alias + " : " + state.Value) + "\" attrs=\"{'invisible':[('state', 'not in', ['" + state.Key + "'])]}\"/>\r\n";
                    }

                    render += "\t\t\t\t" + decalage + "</h1>\r\n";
                }
            }

            render += "\t\t\t\t" + decalage + "<group colspan=\"" + groupData.ClassData.Columns + "\" col=\"" + groupData.ClassData.Columns + "\">\r\n";

            if (!groupData.Label.Equals("default"))
            {
                if (!first) render += "\t\t\t\t" + decalage + "<newline/>\r\n";
                render += "\t\t\t\t" + decalage + "<separator string=\"" + groupData.Label + "\" colspan=\"" + groupData.ClassData.Columns + "\"/>\r\n";
            }

            render += addGroupProperties(groupData, decalage + "\t", viewKind);

            int columns = int.Parse(groupData.ClassData.Columns);
            if ((groupData.ListOfProperties.Count < 3) && (columns >= 4))
            {
                int n = columns - groupData.ListOfProperties.Count * 2;
                render += "\t\t\t\t" + decalage + "<label colspan=\"" + n.ToString() + "\" string=\"\"/>\r\n";
            }

            render += "\t\t\t\t" + decalage + "</group>\r\n";

            render += addGroupPages(groupData.ListOfPages, decalage, viewKind);

            /*if ((!groupData.Report) && (groupData.Root))
            {
                render += addWidgetFormGroup(classData, groupData, decalage + "\t");
            }*/

            return render;
        }
        public void Create()
        {
            Name = Name.Replace(".", "_");

            List<PropertyData> listOfPropertyData_Code = new List<PropertyData>();
            List<PropertyData> listOfPropertyData_Name = new List<PropertyData>();
            List<PropertyData> listOfPropertyData_Others = new List<PropertyData>();

            foreach (PropertyData propertyData in ListOfProperties)
            {
                if (propertyData.Name.Equals("code"))
                {
                    listOfPropertyData_Code.Add(propertyData);
                }
                else if (propertyData.Name.Equals("name"))
                {
                    listOfPropertyData_Name.Add(propertyData);
                }
                else
                {
                    listOfPropertyData_Others.Add(propertyData);
                }
            }

            ListOfProperties = new List<PropertyData>();
            ListOfProperties.AddRange(listOfPropertyData_Code);
            ListOfProperties.AddRange(listOfPropertyData_Name);
            ListOfProperties.AddRange(listOfPropertyData_Others);


            ListOfGroups = new Dictionary<string, GroupData>();

            ListOfGroupsReport = new Dictionary<string, GroupData>();
            ListOfPropertiesReport = new List<PropertyData>();

            GroupData rootGroupData = new GroupData("default");
            rootGroupData.Root = true;
            rootGroupData.ClassData = this;
            rootGroupData.Report = false;
            ListOfGroups.Add("default", rootGroupData);

            GroupData rootReportGroupData = new GroupData("default");
            rootReportGroupData.Root = true;
            rootReportGroupData.ClassData = this;
            rootReportGroupData.Report = true;


            string sel = "";
            List<PropertyData> listOfDates = new List<PropertyData>();
            foreach (PropertyData propertyData in ListOfProperties)
            {
                if (propertyData.Typage.Equals("date") || propertyData.Typage.Equals("datetime") || propertyData.Typage.Equals("time"))
                {
                    listOfDates.Add(propertyData);
                    ListOfPropertiesReport.Add(propertyData);
                }
            }

            if (listOfDates.Count > 0) sel += "('date', 'Date'),";

            if (!sel.Equals(""))
            {
                PropertyData property = new PropertyData();
                property.Name = "filtrerpar";
                property.Alias = "Filtrer par";
                property.Typage = "selection";

                sel = sel.Substring(0, sel.Length - 1);
                property.Selection = "[" + sel + "]";


                PageData pageFilter = new PageData("Filtres");
                pageFilter.ListOfGroups["default"] = new GroupData("default");
                pageFilter.ListOfGroups["default"].ClassData = this;
                pageFilter.ListOfGroups["default"].ListOfProperties.Add(property);
                ListOfPropertiesReport.Add(property);

                if (listOfDates.Count > 0)
                {
                    pageFilter.ListOfGroups["default"].ListOfGroups.Add("dates", new GroupData("Dates", this));
                    pageFilter.ListOfGroups["default"].ListOfGroups["dates"].ListOfProperties = listOfDates;
                }

                rootReportGroupData.ListOfPages.Add("filter", pageFilter);
            }


            rootReportGroupData.ListOfPages.Add("avances", new PageData("Avancés"));
            rootReportGroupData.ListOfPages.Add("options", new PageData("Options"));

            ListOfGroupsReport.Add("default", rootReportGroupData);

            foreach (PropertyData propertyData in ListOfProperties)
            {
                bool dontthread = false;

                if (!propertyData.Name.Equals(Name + "_id"))
                {
                    propertyData.Update();


                    if ((propertyData.Name.Equals("state")) && (propertyData.Typage.Equals("selection")))
                    {
                        dontthread = true;
                        StateWorkflow = true;
                        StateProperty = propertyData;

                        propertyData.Readonly = "1";
                        propertyData.Select = "1";

                        ListOfWorkFlowButton = new Dictionary<string, ButtonData>();
                        ListOfWorkFlowFunction = new Dictionary<string, OperationData>();
                        foreach (KeyValuePair<string, string> KeyValue in propertyData.SelectionData.ListOfValues)
                        {
                            OperationData operationData = GetOperation(propertyData.TypageInitial, KeyValue.Key);

                            if (operationData != null)
                            {
                                ButtonData buttonData = new ButtonData();
                                buttonData.States = KeyValue.Key;
                                
                                if (operationData.CallBy.Equals("button"))
                                {
                                    buttonData.Text = KeyValue.Value;
                                    buttonData.Name = operationData.Name;
                                }
                                else if (operationData.CallBy.Equals(""))
                                {
                                    buttonData.RenderXML = false;
                                    ListOfWorkFlowFunction.Add(KeyValue.Key, operationData);

                                    operationData.ReturnType = "boolean";
                                }

                                ListOfWorkFlowButton.Add(KeyValue.Key, buttonData);
                            }
                        }
                    }
                    else if (propertyData.Name.Equals("name"))
                    {
                        //
                    }
                    else if (propertyData.Name.Equals("code"))
                    {
                        if (!Code.Equals(""))
                        {
                            CodeProperty = propertyData;
                            propertyData.Uniq = true;
                        }
                    }
                    else if (propertyData.Name.Equals("sequence"))
                    {
                        //
                    }
                    else if (propertyData.Name.Equals("parent_id"))
                    {
                        //
                    }



                    if (!dontthread)
                    {
                        if (propertyData.Typage.Equals("text"))
                        {
                            if (propertyData.Group.Equals("") && propertyData.Page.Equals(""))
                            {
                                propertyData.Page = propertyData.Alias;
                                propertyData.ColSpan = "6";
                                propertyData.ShowLabel = false;
                            }
                        }
                        else if (propertyData.Typage.Equals("selection") || (propertyData.LinkData != null))
                        {
                            ListOfGroupsReport["default"].ListOfProperties.Add(propertyData);
                            ListOfPropertiesReport.Add(propertyData);
                        }


                        if (propertyData.Group.Equals(string.Empty) && propertyData.Page.Equals(string.Empty))
                        {
                            ListOfGroups["default"].ListOfProperties.Add(propertyData);
                        }
                        else if (!propertyData.Group.Equals(string.Empty) && propertyData.Page.Equals(string.Empty))
                        {
                            if (!ListOfGroups["default"].ListOfGroups.ContainsKey(propertyData.Group)) ListOfGroups["default"].ListOfGroups.Add(propertyData.Group, new GroupData(propertyData.Group, this));

                            ListOfGroups["default"].ListOfGroups[propertyData.Group].ListOfProperties.Add(propertyData);
                        }
                        else if (propertyData.Group.Equals(string.Empty) && !propertyData.Page.Equals(string.Empty))
                        {
                            if (!ListOfGroups["default"].ListOfPages.ContainsKey(propertyData.Page))
                            {
                                ListOfGroups["default"].ListOfPages.Add(propertyData.Page, new PageData(propertyData.Page));
                                ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups.Add("default", new GroupData("default", this));
                            }

                            ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups["default"].ListOfProperties.Add(propertyData);
                        }
                        else if (!propertyData.Group.Equals(string.Empty) && !propertyData.Page.Equals(string.Empty))
                        {
                            if (!ListOfGroups["default"].ListOfPages.ContainsKey(propertyData.Page))
                            {
                                ListOfGroups["default"].ListOfPages.Add(propertyData.Page, new PageData(propertyData.Page));
                                ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups.Add("default", new GroupData("default", this));
                            }

                            if (!ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups.ContainsKey(propertyData.Group))
                            {
                                ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups.Add(propertyData.Group, new GroupData(propertyData.Group, this));
                            }

                            ListOfGroups["default"].ListOfPages[propertyData.Page].ListOfGroups[propertyData.Group].ListOfProperties.Add(propertyData);
                        }
                    }
                    else
                    {
                        if (propertyData.Typage.Equals("selection") || (propertyData.LinkData != null))
                        {
                            ListOfGroupsReport["default"].ListOfProperties.Add(propertyData);
                            ListOfPropertiesReport.Add(propertyData);
                        }
                    }
                }
            }

            foreach (PropertyData propertyData in ListOfProperties)
            {
                if (propertyData.Typage.Equals("one2many"))
                {
                    foreach (PropertyData property in ListOfProperties)
                    {
                        if (!propertyData.Equals(property))
                        {
                            if (!property.ShareTo.Equals(""))
                            {
                                string[] shareto = property.ShareTo.Split(new char[] { '.' });

                                string clssppt = Parent.ClassicName + "." + shareto[0];

                                if (clssppt.Equals(propertyData.LinkManyClass))
                                {
                                    ClassData clssData = Parent.GetClass(propertyData.LinkManyClass.Split(new char[] { '.' })[1]);

                                    PropertyData propData = clssData.GetProperty(shareto[1]);

                                    propData.MaxUse = Name + "." + propData.Name;
                                }
                            }
                        }
                    }
                }
            }

            Dictionary<string, PageData> ListOfPages = new Dictionary<string, PageData>();
            Dictionary<string, PageData> ListOfPages2 = new Dictionary<string, PageData>();
            foreach (KeyValuePair<string, PageData> pageData in ListOfGroups["default"].ListOfPages)
            {
                if ((pageData.Value.ListOfGroups != null) && (pageData.Value.ListOfGroups.Count > 0) &&
                    (pageData.Value.ListOfGroups.ContainsKey("default")) && (pageData.Value.ListOfGroups["default"].ListOfProperties != null) &&
                    (pageData.Value.ListOfGroups["default"].ListOfProperties.Count > 0) && (pageData.Value.ListOfGroups["default"].ListOfProperties[0].Typage.Equals("text")))
                {
                    ListOfPages2.Add(pageData.Value.Label, pageData.Value);
                }
                else
                {
                    ListOfPages.Add(pageData.Value.Label, pageData.Value);
                }
            }
            
            foreach(KeyValuePair<string, PageData> pageData in ListOfPages2)
            {
                ListOfPages.Add(pageData.Value.Label, pageData.Value);
            }

            ListOfGroups["default"].ListOfPages = ListOfPages;

            ListOfButton = new List<ButtonData>();
            foreach (KeyValuePair<string, OperationData> operationDataKV in ListOfOperations)
            {
                OperationData operationData = operationDataKV.Value;

                if ((operationData.CallBy.Equals("button")) && (operationData.State.Equals("")))
                {
                    ButtonData buttonData = new ButtonData(operationData);

                    ListOfButton.Add(buttonData);
                }
                else if ((operationData.CallBy.Equals("button")) && (!operationData.State.Equals("")))
                {
                    FunctionModel pythonCode = Utils.GetFunctionModel("function_caller_action_wkf", FunctionUsage.Classic);

                    string[] states = operationData.State.Split(new char[] { '.' });

                    string state = states[1].Trim(); //GetNextState(states[1].Trim());

                    if (!state.Equals(""))
                    {
                        /*Dictionary<string, string> pythonCode_values = new Dictionary<string, string>();
                        pythonCode_values["function_name"] = operationData.Name;
                        pythonCode_values["action_wkf"] = "action_" + state + "_wkf";

                        pythonCode.Content = Utils.replaceValues(pythonCode.Content, pythonCode_values) + "\r\n\t";*/

                        pythonCode.ReplaceValues(operationData.Name, "action_" + state + "_wkf");

                        operationData.PythonCode = pythonCode.Content;
                    }
                }
                else if (!operationData.CallBy.Equals("button") && !operationData.CallBy.Equals(""))
                {
                    PropertyData propertyData = GetProperty(operationData.CallBy);

                    string param = "";
                    foreach (ParameterData parameterData in operationData.ListOfParameter)
                    {
                        param += parameterData.Name + ", ";
                    }

                    if (!param.Equals("")) param = param.Substring(0, param.Length - 2);

                    propertyData.OnChange = operationData.Name + "(" + param + ")";
                }
            }

            ListOfGroups["default"].ListOfButtons = ListOfButton;

            PyGenerator.CreateClass(this);
            PyGenerator.CreateReportModel(this);
            PyGenerator.CreateReportWizardModel(this);

            XmlGenerator.CreateView(this);
            XmlGenerator.CreateReportView(this);
            XmlGenerator.CreateWizardReportView(this, MenuRapport);

            if (CodeProperty != null)
            {
                XmlGenerator.CreateDatas(this);
            }

            if (StateWorkflow)
            {
                XmlGenerator.CreateWorkFlow(this);
            }

            XslGenerator.CreateReport(this);
        }