I'm in the process of producing a module for OpenERP that exports (and imports) to OpenProj for project management purposes, but I'm having some grief getting OpenProj to read my files correctly.
I am using Microsoft's XML schema as a reference, as well as frequent tests with OpenProj.
The module uses Python's xml.dom.minidom module as its XML generator and parser.
Problem #1: OpenProj won't recognise the start date
In <Project> tag, I dudiciously make a note of when each sub task starts and ends, and try to ensure that the <Project> start and end dates span all the tasks. The project looks like this:
<?xml version="1.0" encoding="UTF-8"?><Projectxmlns="http://schemas.microsoft.com/project"><Name>Export of all projects' tasks</Name><Title>Export of all projects' tasks</Title><Manager>OpenERP</Manager><ScheduleFromStart>1</ScheduleFromStart><StartDate>2011-07-18T19:00:00</StartDate><FinishDate>2012-09-02T03:00:00</FinishDate><FYStartDate>1</FYStartDate><CriticalSlackLimit>0</CriticalSlackLimit><CurrencyDigits>2</CurrencyDigits><CurrencySymbol>$</CurrencySymbol><CurrencySymbolPosition>0</CurrencySymbolPosition><CalendarUID>1</CalendarUID>
Note that it very clearly says <StartDate>, in the very same place that OpenProj would put it. Yet, I get this on the console when opening this file:
0 earliest start for project. Forward = true using proj start Thu Jan 01 10:00:00 EST 1970
0 earliest start for project. Forward = true using proj start Thu Jan 01 10:00:00 EST 1970
And no, it doesn't even use the Unix epoch as the start date, it gives me a Gantt chart that starts no earlier than the 11th February. The only way to fix this is to go into the Project Information and tell it *again* what the start date is.
Problem #2: Extended Attributes
The "tasks" I generate need to be matched up to OpenERP objects when I do the import back in. Thus I have extended attributes, I use "Text1" (the first one) to store the type of object, and "Number1" to store the database ID.
For ease of use I add an Alias in, so that other readers of the file know what these magical numbers are:
Open in OpenProj, Save as XML, and magically, they disappear. I do believe this was previously reported as a bug.
Problem #3: Calendars
It seems OpenProj is hell-bent on creating its own, even if identical calendars to the ones it generates, are already present in the XML. I noticed that it would always move my custom calendars down and create its own standard 3 at the top, so I decided I'd save it the effort. The following is the XML my code generates for the <Calendars> section:
diff can't even tell the difference. Yet, for some funny reason, OpenProj sees it necessary to not only make copies of these, but also copy them wrong:
<Calendars><Calendar><UID>1</UID><Name>Standard</Name><!-- typical calendar output here --></Calendar><Calendar><UID>2</UID><Name>24 Hours</Name><!-- typical calendar output here --></Calendar><Calendar><UID>3</UID><Name>Night Shift</Name><!-- typical calendar output here --></Calendar><!-- My original "Standard" calendar, err, how's it different? --><Calendar><UID>4</UID><Name>Standard [Export of all projects' tasks]</Name><IsBaseCalendar>1</IsBaseCalendar><WeekDays><WeekDay><DayType>1</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>2</DayType><DayWorking>1</DayWorking><WorkingTimes><WorkingTime><FromTime>08:00:00</FromTime><ToTime>12:00:00</ToTime></WorkingTime><WorkingTime><FromTime>13:00:00</FromTime><ToTime>17:00:00</ToTime></WorkingTime></WorkingTimes></WeekDay><WeekDay><DayType>3</DayType><DayWorking>1</DayWorking><WorkingTimes><WorkingTime><FromTime>08:00:00</FromTime><ToTime>12:00:00</ToTime></WorkingTime><WorkingTime><FromTime>13:00:00</FromTime><ToTime>17:00:00</ToTime></WorkingTime></WorkingTimes></WeekDay><WeekDay><DayType>4</DayType><DayWorking>1</DayWorking><WorkingTimes><WorkingTime><FromTime>08:00:00</FromTime><ToTime>12:00:00</ToTime></WorkingTime><WorkingTime><FromTime>13:00:00</FromTime><ToTime>17:00:00</ToTime></WorkingTime></WorkingTimes></WeekDay><WeekDay><DayType>5</DayType><DayWorking>1</DayWorking><WorkingTimes><WorkingTime><FromTime>08:00:00</FromTime><ToTime>12:00:00</ToTime></WorkingTime><WorkingTime><FromTime>13:00:00</FromTime><ToTime>17:00:00</ToTime></WorkingTime></WorkingTimes></WeekDay><WeekDay><DayType>6</DayType><DayWorking>1</DayWorking><WorkingTimes><WorkingTime><FromTime>08:00:00</FromTime><ToTime>12:00:00</ToTime></WorkingTime><WorkingTime><FromTime>13:00:00</FromTime><ToTime>17:00:00</ToTime></WorkingTime></WorkingTimes></WeekDay><WeekDay><DayType>7</DayType><DayWorking>0</DayWorking></WeekDay></WeekDays></Calendar><!-- OpenProj's "copy" of my "24 Hours" calendar. This would be more appropriately labelled the "0 Hours" calendar, or more aptly, the "Public Servant" calendar. --><Calendar><UID>5</UID><Name>24 Hours [Export of all projects' tasks]</Name><IsBaseCalendar>1</IsBaseCalendar><WeekDays><WeekDay><DayType>1</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>2</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>3</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>4</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>5</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>6</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>7</DayType><DayWorking>0</DayWorking></WeekDay></WeekDays></Calendar><!-- Same thing here, seems all the nightshift people will get work-enforced sickies tonight. --><Calendar><UID>6</UID><Name>Night Shift [Export of all projects' tasks]</Name><IsBaseCalendar>1</IsBaseCalendar><WeekDays><WeekDay><DayType>1</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>2</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>3</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>4</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>5</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>6</DayType><DayWorking>0</DayWorking></WeekDay><WeekDay><DayType>7</DayType><DayWorking>0</DayWorking></WeekDay></WeekDays></Calendar>
Problem #4: "No, that start date and duration can't possibly be right!"
It seems OpenProj knows better about when a task was scheduled to start, and how long it will take. Rather than just displaying to the user how the data is reported in the file, and allowing the user to manipulate it, it sees it fit to misread what is written in the file:
Note that Work seems to have gone from 24 hours (which is 3 working days) to 0 hours. Is there some documentation on how OpenProj interprets these? Clearly there's a misunderstanding because I'm doing it wrong, but it's hard to know how it's wrong? The dutiful reader will note that I am using the <Notes> section to emit the Python dict that is used to construct each task and project.
For some things there isn't a direct 1:1 correlation, but the Start and Finish dates are as marked, but that's not how OpenProj sees them.
Problem #5: NullPointerException
Yes, if I get a tag out of place, or remove a supposedly optional tag (according to the Microsoft spec), I get this exception on the console, with no explaination as to where and why the XML is bad. All I do know is that it's bad, and that I have to try and hunt for the thing that is breaking it.
I think that's enough problems to deal with for now, if need be I can generate further test data and submit that in bug reports. It is a bit concerning to see that the last commit was back in 2009, and moreover, the bits I seem to have the most problems with are magical .jar files in the source code, so are impossible-to-debug black boxes.
My biggest problem is that I cannot see *inside* some parts of OpenProj to know what is the matter. I do not know if it is a bug in my XML, or a bug in OpenProj. I am also targetting Microsoft Project, and I figure if I get it working here, it should mostly work the way we want in the other package, however OpenProj gives me more potential for debugging as it is in theory, open-source.
I hope through this head-banging, I can help OpenProj improve, but I need your assistance first.
Thanks in advance.
Regards,
Stuart Longland
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is your code for openerp export of project information somewhere and opensource where i can get it becuase i am interested to explore and continue from what you left out. i am thinking to integrate to gantter for own use... need to save some time if possible...
Thanks.
Kalmen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm in the process of producing a module for OpenERP that exports (and imports) to OpenProj for project management purposes, but I'm having some grief getting OpenProj to read my files correctly.
I am using Microsoft's XML schema as a reference, as well as frequent tests with OpenProj.
The module uses Python's xml.dom.minidom module as its XML generator and parser.
Problem #1: OpenProj won't recognise the start date
In <Project> tag, I dudiciously make a note of when each sub task starts and ends, and try to ensure that the <Project> start and end dates span all the tasks. The project looks like this:
Note that it very clearly says <StartDate>, in the very same place that OpenProj would put it. Yet, I get this on the console when opening this file:
And no, it doesn't even use the Unix epoch as the start date, it gives me a Gantt chart that starts no earlier than the 11th February. The only way to fix this is to go into the Project Information and tell it *again* what the start date is.
Problem #2: Extended Attributes
The "tasks" I generate need to be matched up to OpenERP objects when I do the import back in. Thus I have extended attributes, I use "Text1" (the first one) to store the type of object, and "Number1" to store the database ID.
For ease of use I add an Alias in, so that other readers of the file know what these magical numbers are:
Open in OpenProj, Save as XML, and magically, they disappear. I do believe this was previously reported as a bug.
Problem #3: Calendars
It seems OpenProj is hell-bent on creating its own, even if identical calendars to the ones it generates, are already present in the XML. I noticed that it would always move my custom calendars down and create its own standard 3 at the top, so I decided I'd save it the effort. The following is the XML my code generates for the <Calendars> section:
diff can't even tell the difference. Yet, for some funny reason, OpenProj sees it necessary to not only make copies of these, but also copy them wrong:
Problem #4: "No, that start date and duration can't possibly be right!"
It seems OpenProj knows better about when a task was scheduled to start, and how long it will take. Rather than just displaying to the user how the data is reported in the file, and allowing the user to manipulate it, it sees it fit to misread what is written in the file:
The following is a task in my original file:
And this is what OpenProj coughs up:
Note that Work seems to have gone from 24 hours (which is 3 working days) to 0 hours. Is there some documentation on how OpenProj interprets these? Clearly there's a misunderstanding because I'm doing it wrong, but it's hard to know how it's wrong? The dutiful reader will note that I am using the <Notes> section to emit the Python dict that is used to construct each task and project.
For some things there isn't a direct 1:1 correlation, but the Start and Finish dates are as marked, but that's not how OpenProj sees them.
Problem #5: NullPointerException
Yes, if I get a tag out of place, or remove a supposedly optional tag (according to the Microsoft spec), I get this exception on the console, with no explaination as to where and why the XML is bad. All I do know is that it's bad, and that I have to try and hunt for the thing that is breaking it.
I think that's enough problems to deal with for now, if need be I can generate further test data and submit that in bug reports. It is a bit concerning to see that the last commit was back in 2009, and moreover, the bits I seem to have the most problems with are magical .jar files in the source code, so are impossible-to-debug black boxes.
My biggest problem is that I cannot see *inside* some parts of OpenProj to know what is the matter. I do not know if it is a bug in my XML, or a bug in OpenProj. I am also targetting Microsoft Project, and I figure if I get it working here, it should mostly work the way we want in the other package, however OpenProj gives me more potential for debugging as it is in theory, open-source.
I hope through this head-banging, I can help OpenProj improve, but I need your assistance first.
Thanks in advance.
Regards,
Stuart Longland
Hello Stuart,
It has been a while since you posted this, have you suceeded?
I am interested in this integration too and could try to help where did it stopped.
Thanks,
Ademar Arvati
No unfortunately, we abandoned this method in place of using the Faces integration in OpenERP 6.1, building on that instead.
Hello Stuart,
Is your code for openerp export of project information somewhere and opensource where i can get it becuase i am interested to explore and continue from what you left out. i am thinking to integrate to gantter for own use... need to save some time if possible...
Thanks.
Kalmen