Uploaded image for project: 'LIMS'
  1. LIMS
  2. LIMS-1969

AR Add error when "Categorise analysis services" is disabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Aug 2015

      Description

      Analysis Request Add form throws an error if the option "Bika Setup > Analyses > Categorise analysis services" is disabled. I think is due to https://github.com/bikalabs/Bika-LIMS/pull/1511

      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 bika.lims.browser.analysisrequest.add, line 219, in __call__
        Module Products.Five.browser.pagetemplatefile, line 125, in __call__
        Module Products.Five.browser.pagetemplatefile, line 59, in __call__
        Module zope.pagetemplate.pagetemplate, line 132, in pt_render
         - Warning: Macro expansion failed
         - Warning: <type 'exceptions.NameError'>: name 'fieldName' is not defined
        Module zope.pagetemplate.pagetemplate, line 240, in __call__
        Module zope.tal.talinterpreter, line 271, in __call__
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 888, in do_useMacro
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 954, in do_defineSlot
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 858, in do_defineMacro
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 954, in do_defineSlot
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 954, in do_defineSlot
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 946, in do_defineSlot
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 888, in do_useMacro
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
        Module zope.tales.tales, line 696, in evaluate
         - URL: /home/jordi/dev/xispa/bikalims/zinstance/src/bika.lims/bika/lims/browser/analysisrequest/templates/ar_add_by_col.pt
         - Line 177, Column 8
         - Expression: <PythonExpr (view.services_widget_content('lab', ar_count=view.ar_count))>
         - Names:
            {'args': (),
             'container': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'context': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'default': <object object at 0x7f0fe9089b70>,
             'here': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'loop': {},
             'nothing': None,
             'options': {},
             'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x156e8838>,
             'request': <HTTPRequest, URL=http://localhost:8090/Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses/ar_add>,
             'root': <Application at >,
             'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xab2bb50>,
             'traverse_subpath': [],
             'user': <PropertiedUser 'admin'>,
             'view': <Products.Five.metaclass.AnalysisRequestAddView object at 0x16528d10>,
             'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x165ded90>}
        Module zope.tales.pythonexpr, line 59, in __call__
         - __traceback_info__: (view.services_widget_content('lab', ar_count=view.ar_count))
        Module <string>, line 1, in <module>
        Module bika.lims.browser.analysisrequest.add, line 287, in services_widget_content
        Module bika.lims.browser.bika_listing, line 925, in contents_table
        Module Products.Five.browser.pagetemplatefile, line 125, in __call__
        Module Products.Five.browser.pagetemplatefile, line 59, in __call__
        Module zope.pagetemplate.pagetemplate, line 132, in pt_render
        Module zope.pagetemplate.pagetemplate, line 240, in __call__
        Module zope.tal.talinterpreter, line 271, in __call__
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 531, in do_optTag_tal
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 531, in do_optTag_tal
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 821, in do_loop_tal
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 531, in do_optTag_tal
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
        Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
        Module zope.tales.tales, line 696, in evaluate
         - URL: /home/jordi/dev/xispa/bikalims/zinstance/src/bika.lims/bika/lims/browser/templates/bika_listing_table.pt
         - Line 209, Column 16
         - Expression: <PythonExpr (view.rendered_items(cat))>
         - Names:
            {'args': (<bika.lims.browser.analysisrequest.add.AnalysisServicesView object at 0x1671c790>,),
             'container': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'context': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'default': <object object at 0x7f0fe9089b70>,
             'here': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'loop': {},
             'nothing': None,
             'options': {},
             'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x156e8788>,
             'request': <HTTPRequest, URL=http://localhost:8090/Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses/ar_add>,
             'root': <Application at >,
             'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x9e39710>,
             'traverse_subpath': [],
             'user': <PropertiedUser 'admin'>,
             'view': <bika.lims.browser.bika_listing.BikaListingTable object at 0x1533eb50>,
             'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x16726a90>}
        Module zope.tales.pythonexpr, line 59, in __call__
         - __traceback_info__: (view.rendered_items(cat))
        Module <string>, line 1, in <module>
        Module bika.lims.browser.bika_listing, line 1090, in rendered_items
        Module Products.Five.browser.pagetemplatefile, line 125, in __call__
        Module Products.Five.browser.pagetemplatefile, line 59, in __call__
        Module zope.pagetemplate.pagetemplate, line 132, in pt_render
        Module zope.pagetemplate.pagetemplate, line 240, in __call__
        Module zope.tal.talinterpreter, line 271, in __call__
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 821, in do_loop_tal
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 821, in do_loop_tal
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 533, in do_optTag_tal
        Module zope.tal.talinterpreter, line 518, in do_optTag
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 531, in do_optTag_tal
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 852, in do_condition
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 531, in do_optTag_tal
        Module zope.tal.talinterpreter, line 513, in no_tag
        Module zope.tal.talinterpreter, line 343, in interpret
        Module zope.tal.talinterpreter, line 851, in do_condition
        Module Products.PageTemplates.Expressions, line 205, in evaluateBoolean
        Module zope.tales.tales, line 696, in evaluate
         - URL: /home/jordi/dev/xispa/bikalims/zinstance/src/bika.lims/bika/lims/browser/templates/bika_listing_table_items.pt
         - Line 154, Column 4
         - Expression: <PythonExpr (type(item[column]) == type({}))>
         - Names:
            {'args': (),
             'container': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'context': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'default': <object object at 0x7f0fe9089b70>,
             'here': <AnalysisRequest at /Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses used for /Plone/clients/client14-22>,
             'loop': {},
             'nothing': None,
             'options': {},
             'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x156e8ba8>,
             'request': <HTTPRequest, URL=http://localhost:8090/Plone/clients/client14-22/portal_factory/AnalysisRequest/Request new analyses/ar_add>,
             'root': <Application at >,
             'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x9e39750>,
             'traverse_subpath': [],
             'user': <PropertiedUser 'admin'>,
             'view': <bika.lims.browser.bika_listing.BikaListingTable object at 0x1533eb50>,
             'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x16755cd0>}
        Module zope.tales.pythonexpr, line 59, in __call__
         - __traceback_info__: (type(item[column]) == type({}))
        Module <string>, line 1, in <module>
      KeyError: 'CommercialID'
      
      

        Issue Links

          Activity

          Hide
          rockfruit Campbell added a comment -

          Cannot reproduce, and cannot see relation to https://github.com/bikalabs/Bika-LIMS/pull/1511.

          Any column who does not have a key/value pair specified in item[column_name] will cause this error; so I have placed these two entries in each AnalysisService item explicitly to prevent whatever condition was causing them to fail to be displayed.

          The bika_listing code should not have allowed this to happen: if you can reproduce it please tell me if you know how; I'd like to understand what happened here.

          Show
          rockfruit Campbell added a comment - Cannot reproduce, and cannot see relation to https://github.com/bikalabs/Bika-LIMS/pull/1511 . Any column who does not have a key/value pair specified in item [column_name] will cause this error; so I have placed these two entries in each AnalysisService item explicitly to prevent whatever condition was causing them to fail to be displayed. The bika_listing code should not have allowed this to happen: if you can reproduce it please tell me if you know how; I'd like to understand what happened here.

            People

            • Assignee:
              rockfruit Campbell
              Reporter:
              xispa Jordi (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Agile