Commit 22fea21f authored by Tatuya Kamada's avatar Tatuya Kamada

Inventory: Change the default inventory parameter for Inventory indexing.

Before:

default_inventory_calculation_list = ({"inventory_params" :
                                        {"node" : self.getDestination(),
                                         "group_by_sub_variation" : 1,
                                         "group_by_variation" : 1,
                                         "group_by_resource" : 1,
                                         }
                                         ..

After:

default_inventory_calculation_list = ({"inventory_params" :
                                       {"section": self.getDestinationSection(),
                                        "node" : self.getDestination(),
                                        "group_by_sub_variation" : 1,
                                        "group_by_variation" : 1,
                                        "group_by_resource" : 1,
                                         }
                                        ..

This is because Inventory_view of erp5_trade has both 'section' and 'node'
fields, so users can input both values, but due to the old default parameter,
the section will be ignored for inventory indexing. This is inconsitent.
parent 8d331c55
......@@ -123,7 +123,8 @@ class Inventory(Delivery):
connection_id = method.connection_id
break
default_inventory_calculation_list = ({ "inventory_params" : {"node" : self.getDestination(),
default_inventory_calculation_list = ({ "inventory_params" : {"section": self.getDestinationSection(),
"node" : self.getDestination(),
"group_by_sub_variation" : 1,
"group_by_variation" : 1,
"group_by_resource" : 1,
......
......@@ -2680,6 +2680,7 @@ class TestInventory(TestOrderMixin, ERP5TypeTestCase):
to_date=DateTime(self.two_resource_full_inventory2_start_date)
self.getPortalObject().portal_simulation.getCurrentInventoryList(
to_date=to_date,
section=section_value.getRelativeUrl(),
node=node_value.getRelativeUrl(),
group_by_variation=1,
group_by_sub_variation=1,
......
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