moqui / HiveMind

HiveMind is a project management and ERP application for services organizations. It features project/task management, request tracking, time tracking, expenses, invoices/payments, general ledger, and content management (wiki). HiveMind is based on Moqui Framework, Mantle Business Artifacts, and Simple Screens.
Other
56 stars 48 forks source link

Changed iteration on entity-find-one to entity-find. #33

Closed jenshp closed 6 years ago

jenshp commented 6 years ago

This updates pull request #32 regarding the doubt you had on the condition "!statusItem.statusId?.startsWith('We')".

First of all, the condition should have been "!statusItem.statusTypeId == 'WorkEffort'", which is also more robust. Second, the condition is already present in the entity-find-one that sets the variable statusItem in the first place, but as statusTypeId is not a PK field, it was being ignored in the entity-find-one and results of types other than WorkEffort were being seen. In the end, the cleaner and more robust solution is to do one single DB query that under normal circumstances will always return the single statusItem needed.

jonesde commented 6 years ago

Wow that code is old... I don't remember the reason for the filter on statusTypeId=WorkEffort and the check for starting with 'We', seems like it had something to do with custom status flows for projects but I don't remember and it probably doesn't matter. These changes look fine.