Commit 50d98c5a authored by Douglas's avatar Douglas

Improving getInventoryList filters

parent 46d59961
...@@ -92,11 +92,14 @@ ...@@ -92,11 +92,14 @@
" demo_clothes = self.portal_catalog(title='Demo Clothes', portal_type='Organisation')[0]\n", " demo_clothes = self.portal_catalog(title='Demo Clothes', portal_type='Organisation')[0]\n",
" columns = ['date', 'quantity']\n", " columns = ['date', 'quantity']\n",
" quantity_list = (\n", " quantity_list = (\n",
" [item['date'], item['total_quantity']] \n", " [item['date'], item['total_quantity']*(-1)] \n",
" for item in self.portal_simulation.getInventoryList(\n", " for item in self.portal_simulation.getInventoryList(\n",
" mirror_node_uid=demo_clothes.getUid(),\n",
" resource_uid=swimsuit.getUid(),\n", " resource_uid=swimsuit.getUid(),\n",
" group_by='date',\n", " section_uid=demo_clothes.getUid(),\n",
" simulation_state='planned',\n",
  • Usually, we prefer to use getFutureInventoryList over getInventoryList(simulation_state='planned'), this way we do not have to hardcode simulation state.

Please register or sign in to reply
" omit_input=True,\n",
" only_accountable=True,\n",
Please register or sign in to reply
" group_by='date'\n",
" )\n", " )\n",
" ) \n", " ) \n",
" \n", " \n",
...@@ -678,7 +681,7 @@ ...@@ -678,7 +681,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython2", "pygments_lexer": "ipython2",
"version": "2.7.10" "version": "2.7.9"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment