diff --git a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py index fa5d8bdf3499ba1899436db21bfdadca7382d494..ddb3847926ad8d7c6e9bcdcac470335c468d3512 100644 --- a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py +++ b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.py @@ -284,10 +284,14 @@ class TrackingListBrain(InventoryListBrain): class MovementHistoryListBrain(InventoryListBrain): """Brain for getMovementHistoryList """ - def _date(self): + + def _convertDateToZone(self, date_utc): # Convert the date in the movement's original timezone. - # ZSQL method selects date as date_, and here we find the object to get the - # timezone and convert the date to this timezone + # ZSQL method selects date as date_utc or mirror_date_utc, and here we find + # the object to get the timezone and convert the date to this timezone + # It could be better to index the timezone in SQL table so that we do + # need to retrieve object all the time + date = date_utc obj = self.getObject() if obj is not None: timezone = None @@ -300,8 +304,15 @@ class MovementHistoryListBrain(InventoryListBrain): if stop_date is not None: timezone = stop_date.timezone() if timezone is not None: - return self.date_utc.toZone(timezone) - return self.date_utc + date = date_utc.toZone(timezone) + return date + + def _mirror_date(self): + return self._convertDateToZone(self.mirror_date_utc) + mirror_date = ComputedAttribute(_mirror_date, 1) + + def _date(self): + return self._convertDateToZone(self.date_utc) date = ComputedAttribute(_date, 1) def getListItemUrl(self, cname_id, selection_index, selection_name): diff --git a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.xml b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.xml index 3ae1fa2a1e307145d5e6fed42693839c2dc71ada..c71db5db5918febd1c31b4b9a9af4050a61bf3fe 100644 --- a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.xml +++ b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.InventoryBrain.xml @@ -6,6 +6,12 @@ </pickle> <pickle> <dictionary> + <item> + <key> <string>_recorded_property_dict</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> <item> <key> <string>default_reference</string> </key> <value> <string>InventoryBrain</string> </value> @@ -49,13 +55,28 @@ <item> <key> <string>workflow_history</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> </value> </item> </dictionary> </pickle> </record> <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> <pickle> <global name="PersistentMapping" module="Persistence.mapping"/> </pickle> @@ -68,7 +89,7 @@ <item> <key> <string>component_validation_workflow</string> </key> <value> - <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> </dictionary> @@ -77,7 +98,7 @@ </dictionary> </pickle> </record> - <record id="3" aka="AAAAAAAAAAM="> + <record id="4" aka="AAAAAAAAAAQ="> <pickle> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> </pickle> @@ -90,33 +111,6 @@ <key> <string>action</string> </key> <value> <string>validate</string> </value> </item> - <item> - <key> <string>actor</string> </key> - <value> <string>ERP5TypeTestCase</string> </value> - </item> - <item> - <key> <string>comment</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>time</string> </key> - <value> - <object> - <klass> - <global name="DateTime" module="DateTime.DateTime"/> - </klass> - <tuple> - <none/> - </tuple> - <state> - <tuple> - <float>1384253447.9</float> - <string>GMT+1</string> - </tuple> - </state> - </object> - </value> - </item> <item> <key> <string>validation_state</string> </key> <value> <string>validated</string> </value> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetMovementHistoryList.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetMovementHistoryList.xml index 39a1753a0599973f8c821fb1a314862f3dd949d0..c3acb3da9881e6ac1fc1ca74fb4b121a37bf9a29 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetMovementHistoryList.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetMovementHistoryList.xml @@ -490,6 +490,7 @@ SELECT\n catalog.uid as uid,\n catalog.relative_url as relative_url,\n stock.date AS date_utc,\n + stock.mirror_date AS mirror_date_utc,\n <dtml-if expr="precision is not None">\n <dtml-if group_by_expression>SUM</dtml-if>(ROUND(stock.quantity, <dtml-var precision>)) AS total_quantity,\n <dtml-if group_by_expression>SUM</dtml-if>(ROUND(stock.total_price, <dtml-var precision>)) AS total_price,\n diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 71d3b264e9640cdb61bddffe9d9791e4503fdac1..0382bf898a887e9c289096e94015087a3beafdb8 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -41157 \ No newline at end of file +41158 \ No newline at end of file