Files
Petru Conduraru 694a44e638 ifc4d: tolerate activities without a CalendarObjectId in P6 import (#5617)
Importing a Primavera P6 XML crashed with
`AttributeError: 'NoneType' object has no attribute 'text'` in
P62Ifc.parse_activity_xml, which read
activity.find("pr:CalendarObjectId").text unconditionally. CalendarObjectId
is optional on a P6 Activity; when omitted, the activity inherits the
project's ActivityDefaultCalendarObjectId.

Capture the project default in parse_xml and fall back to it when an
activity has no CalendarObjectId (`calendar_id or self.default_calendar_id`).

Verified on the reporter's attached file (20241021 Cronograma.xml): 3 of 14
activities lack a CalendarObjectId and reproduced the exact crash on
v0.8.0; after the fix parse_xml completes and those activities resolve to
the project default calendar "2" (a valid calendar in the file). An
activity with an explicit CalendarObjectId keeps its own value.

Fixes the P6 re-import crash reported in #5617 (that issue tracks several
Gantt items; this addresses the import AttributeError).

Generated with the assistance of an AI coding tool.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 17:15:36 +10:00
..
2026-01-26 17:13:18 +05:00
2024-06-27 11:49:12 +10:00

ifc4d

Ifc4D contains a series of utilities for converting to and from various 4D software. Currently supported:

  • Microsoft Project to IFC
  • Oracle Primavera 6 (P6) XML to IFC
  • Oracle Primavera 6 (P6) XER to IFC
  • Asta Powerproject to IFC
  • IFC to Oracle Primavera 6 (P6) XML
  • IFC to Microsoft Project

Planned (would you like to contribute? Please reach out!):

  • IFC to Oracle Primavera 6 (P6) XER
  • IFC to Oracle Primavera 6 (P6) XLS
  • IFC to Asta Powerproject
  • LibreProject to IFC
  • IFC to LibreProject
  • IFC to Gantt