public ViewData(string Id, ActionData refAction, string Name, ClassData classData, string sequence, string kind)
        {
            Kind = kind;

            ID = Id;
            Parent = classData;

            RefAction = refAction;

            Data = new Dictionary<string, object>();

            Data["name"] = Name;
            Data["sequence"] = sequence;
        }
        public ViewData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence, string kind)
        {
            Kind = kind;

            ID = refView.ID + "_" + Kind.ToLower();
            Parent = classData;

            RefView = refView;
            RefAction = refAction;

            Data = new Dictionary<string, object>();

            Data["name"] = Name;
            Data["sequence"] = sequence;
        }
        public ActionData(ActionData refAction, ClassData classData, string viewID, ViewKind viewKind, string sequence)
        {
            ID     = refAction.ID + "_" + viewKind.ToString().ToLower();
            Parent = classData;

            Data = new Dictionary <string, object>();

            Data["model"]          = "ir.actions.act_window.view";
            Data["name"]           = "";
            Data["view_id"]        = viewID;
            Data["domain"]         = "";
            Data["context"]        = "";
            Data["sequence"]       = sequence;
            Data["view_id"]        = "";
            Data["res_model"]      = "";
            Data["view_type"]      = "";
            Data["target"]         = "";
            Data["view_mode"]      = viewKind.ToString().ToLower();
            Data["search_view_id"] = "";
            Data["act_window_id"]  = refAction.ID;
        }
        public ActionData(ActionData refAction, ClassData classData, string viewID, ViewKind viewKind, string sequence)
        {
            ID = refAction.ID + "_" + viewKind.ToString().ToLower();
            Parent = classData;

            Data = new Dictionary<string, object>();

            Data["model"] = "ir.actions.act_window.view";
            Data["name"] = "";
            Data["view_id"] = viewID;
            Data["domain"] = "";
            Data["context"] = "";
            Data["sequence"] = sequence;
            Data["view_id"] = "";
            Data["res_model"] = "";
            Data["view_type"] = "";
            Data["target"] = "";
            Data["view_mode"] = viewKind.ToString().ToLower();
            Data["search_view_id"] = "";
            Data["act_window_id"] = refAction.ID;
        }
        public static string addAction(ActionData actionData)
        {
            string render = "<record model=\"" + (string)actionData.Data["model"] + "\" id=\"" + actionData.ID + "\">\r\n";

            Program.ProjectData.addTraduction(actionData.Parent, (string)actionData.Data["name"]);

            if (((string)actionData.Data["name"]).Length > 0) render += "\t\t\t<field name=\"name\">" + Utils.ReplaceSpecialChar((string)actionData.Data["name"]) + "</field>\r\n";
            if (((string)actionData.Data["view_id"]).Length > 0) render += "\t\t\t<field name=\"view_id\" ref=\"" + (string)actionData.Data["view_id"] + "\"/>\r\n";
            if (((string)actionData.Data["domain"]).Length > 0) render += "\t\t\t<field name=\"domain\">" + (string)actionData.Data["domain"] + "</field>\r\n";
            if (((string)actionData.Data["sequence"]).Length > 0) render += "\t\t\t<field name=\"sequence\">" + (string)actionData.Data["sequence"] + "</field>\r\n";
            if (((string)actionData.Data["context"]).Length > 0) render += "\t\t\t<field name=\"context\">" + (string)actionData.Data["context"] + "</field>\r\n";

            if (actionData.Parent.Inherit != null)
            {
                if (((string)actionData.Data["res_model"]).Length > 0) render += "\t\t\t<field name=\"res_model\">" + actionData.Parent.Inherit.ModuleName + "." + actionData.Parent.Inherit.Name + "</field>\r\n";
            }
            else
            {
                if (((string)actionData.Data["res_model"]).Length > 0) render += "\t\t\t<field name=\"res_model\">" + (string)actionData.Data["res_model"] + "</field>\r\n";
            }
            
            if (((string)actionData.Data["view_type"]).Length > 0) render += "\t\t\t<field name=\"view_type\">" + (string)actionData.Data["view_type"] + "</field>\r\n";
            if (((string)actionData.Data["view_mode"]).Length > 0) render += "\t\t\t<field name=\"view_mode\">" + (string)actionData.Data["view_mode"] + "</field>\r\n";
            if (((string)actionData.Data["target"]).Length > 0) render += "\t\t\t<!--<field name=\"target\">" + (string)actionData.Data["target"] + "</field>-->\r\n";

            if (actionData.Parent.Inherit == null)
            {
                if (((string)actionData.Data["search_view_id"]).Length > 0) render += "\t\t\t<field name=\"search_view_id\" ref=\"" + (string)actionData.Data["search_view_id"] + "\"/>\r\n";
            }

            if (((string)actionData.Data["act_window_id"]).Length > 0) render += "\t\t\t<field name=\"act_window_id\" ref=\"" + (string)actionData.Data["act_window_id"] + "\"/>\r\n";

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

            return render;
        }
Esempio n. 6
0
 public TreeData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Tree")
 {
     //
 }
 public TreeData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Tree")
 {
     //
 }
 public CalendarData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Calendar")
 {
     //
 }
 public SearchData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Search")
 {
     //
 }
Esempio n. 10
0
 public KanbanData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Kanban")
 {
     //
 }
 public KanbanData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Kanban")
 {
     //
 }
 public CalendarData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Calendar")
 {
     //
 }
 public CalendarData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Calendar")
 {
     //
 }
 public FormData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Form")
 {
     //
 }
 public KanbanData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Kanban")
 {
     //
 }
 public GanttData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Gantt")
 {
     //
 }
 public SearchData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Search")
 {
     //
 }
Esempio n. 18
0
 public KanbanData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Kanban")
 {
     //
 }
 public SearchData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Search")
 {
     //
 }
 public SearchData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Search")
 {
     //
 }
Esempio n. 21
0
 public TreeData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Tree")
 {
     //
 }
 public CalendarData(ActData refView, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(refView, refAction, Name, classData, sequence, "Calendar")
 {
     //
 }
 public FormData(string Id, ActionData refAction, string Name, ClassData classData, string sequence)
     : base(Id, refAction, Name, classData, sequence, "Form")
 {
     //
 }