Can't create a patient with a defined client

If create a patient without a client defined, it’s fine. However, if create a patient with a client, the error shows below. Any help would be appreciated.

Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFPlone.FactoryTool, line 478, in call
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 91, in call
Module Products.CMFFormController.BaseControllerPageTemplate, line 29, in _call
Module Products.CMFFormController.ControllerBase, line 232, in getNext
Module Products.CMFFormController.Actions.TraverseTo, line 38, in call
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 105, in call
Module Products.CMFFormController.Script, line 145, in call
Module Products.CMFCore.FSPythonScript, line 127, in call
Module Shared.DC.Scripts.Bindings, line 322, in call
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 1, in content_edit

  • <FSControllerPythonScript at /senaite/patients/portal_factory/Patient/patient.2019-12-15.1621405809/content_edit>
  • Line 1
    Module Products.CMFCore.FSPythonScript, line 127, in call
    Module Shared.DC.Scripts.Bindings, line 322, in call
    Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
    Module Products.PythonScripts.PythonScript, line 344, in _exec
    Module script, line 12, in content_edit_impl
  • <FSPythonScript at /senaite/patients/portal_factory/Patient/patient.2019-12-15.1621405809/content_edit_impl>
  • Line 12
    Module Products.Archetypes.BaseObject, line 642, in processForm
    Module zope.event, line 31, in notify
    Module zope.component.event, line 24, in dispatch
    Module zope.component._api, line 136, in subscribers
    Module zope.component.registry, line 321, in subscribers
    Module zope.interface.adapter, line 585, in subscribers
    Module zope.component.event, line 32, in objectEventNotify
    Module zope.component._api, line 136, in subscribers
    Module zope.component.registry, line 321, in subscribers
    Module zope.interface.adapter, line 585, in subscribers
    Module bika.health.subscribers.patient, line 40, in ObjectModifiedEventHandler
    Module OFS.CopySupport, line 332, in manage_pasteObjects
    Module OFS.CopySupport, line 208, in _pasteObjects
    Module Products.CMFCore.PortalFolder, line 421, in _verifyObjectPaste
    ValueError: Disallowed subobject type: Patient

Hi, can you provide more info? What versions are you running for health and core?

Also, what user is creating the patient?

Thanks,

Hi @zack, you have to run health’s upgrade step 1.2.2. As a rule-of-thumb for when you have senaite.health installed and you run an upgrade step of senaite.core, you have to do the same (update sources and run upgrade step) for senaite.health thereafter.

This issue was addressed here: https://github.com/senaite/senaite.health/pull/159
However, it is not yet in the current codebase and will be earliest available in senaite.health 1.2.3.

The workaround is to allow Patient in Client type manually in the ZMI via the portal_types tool.

Important: Hold the Ctrl key when selecting the Patient item from the list, otherwise all the other items will be deselected!

http://localhost:8080/senaite/portal_types/Client/manage_propertiesForm

1 Like

It works. Thanks a lot! @ramonski