Commit 8d1f6a7a authored by Fabien Morin's avatar Fabien Morin

use portal instead contex to access portal_categories, this avoid aquisition...

use portal instead contex to access portal_categories, this avoid aquisition problems (thanks to Jerome).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19318 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 90d70f30
No related merge requests found
...@@ -78,7 +78,7 @@ import pprint\n ...@@ -78,7 +78,7 @@ import pprint\n
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n
\n \n
\n portal = context.getPortalObject();\n
paysheet_line_list = context.contentValues(portal_type=\'Pay Sheet Line\')\n paysheet_line_list = context.contentValues(portal_type=\'Pay Sheet Line\')\n
if context.getPriceCurrencyValue():\n if context.getPriceCurrencyValue():\n
precision = context.getPriceCurrencyValue().getQuantityPrecision()\n precision = context.getPriceCurrencyValue().getQuantityPrecision()\n
...@@ -131,7 +131,7 @@ for paysheet_line in paysheet_line_list:\n ...@@ -131,7 +131,7 @@ for paysheet_line in paysheet_line_list:\n
for item in tuple:\n for item in tuple:\n
# the dict key is the base category and value is the category path\n # the dict key is the base category and value is the category path\n
tuple_dict[item.split(\'/\')[0]] = \\\n tuple_dict[item.split(\'/\')[0]] = \\\n
context.portal_categories.restrictedTraverse(item).getTitle()\n portal.portal_categories.restrictedTraverse(item).getTitle()\n
tuple_dict[item.split(\'/\')[0]+\'_relative_url\']=item\n tuple_dict[item.split(\'/\')[0]+\'_relative_url\']=item\n
\n \n
# we want to display as lines as a paysheet line as slices\n # we want to display as lines as a paysheet line as slices\n
...@@ -250,6 +250,7 @@ return line_list\n ...@@ -250,6 +250,7 @@ return line_list\n
<string>N_</string> <string>N_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string>
<string>paysheet_line_list</string> <string>paysheet_line_list</string>
<string>precision</string> <string>precision</string>
<string>line_list</string> <string>line_list</string>
......
...@@ -68,14 +68,15 @@ ...@@ -68,14 +68,15 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = paysheet.getPortalObject().portal_simulation\n portal = context.getPortalObject();\n
portal_simulation = portal.portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
paysheet.portal_categories.tax_category.employee_share.getUid(),\n portal.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n ...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>portal_simulation</string> <string>portal_simulation</string>
<string>DateTime</string> <string>DateTime</string>
<string>params</string> <string>params</string>
......
...@@ -68,14 +68,15 @@ ...@@ -68,14 +68,15 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = paysheet.getPortalObject().portal_simulation\n portal = context.getPortalObject();\n
portal_simulation = portal.portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
paysheet.portal_categories.tax_category.employee_share.getUid(),\n portal.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n ...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>portal_simulation</string> <string>portal_simulation</string>
<string>DateTime</string> <string>DateTime</string>
<string>params</string> <string>params</string>
......
...@@ -68,13 +68,14 @@ ...@@ -68,13 +68,14 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = paysheet.getPortalObject().portal_simulation\n portal = context.getPortalObject();\n
portal_simulation = portal.portal_simulation\n
\n \n
params = {\n params = {\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
paysheet.portal_categories.tax_category.employee_share.getUid(),\n portal.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -135,6 +136,7 @@ return net_pay\n ...@@ -135,6 +136,7 @@ return net_pay\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>portal_simulation</string> <string>portal_simulation</string>
<string>DateTime</string> <string>DateTime</string>
<string>params</string> <string>params</string>
......
...@@ -68,14 +68,15 @@ ...@@ -68,14 +68,15 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = paysheet.getPortalObject().portal_simulation\n portal = context.getPortalObject();\n
portal_simulation = portal.portal_simulation\n
\n \n
params = {\n params = {\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n \'mirror_section_uid\' : paysheet.getSourceSectionUid(),\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
paysheet.portal_categories.tax_category.employee_share.getUid(),\n portal.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n ...@@ -131,6 +132,7 @@ return portal_simulation.getInventoryAssetPrice(**params)\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>portal_simulation</string> <string>portal_simulation</string>
<string>DateTime</string> <string>DateTime</string>
<string>params</string> <string>params</string>
......
...@@ -68,13 +68,14 @@ ...@@ -68,13 +68,14 @@
<value> <string>if paysheet is None:\n <value> <string>if paysheet is None:\n
paysheet = context\n paysheet = context\n
\n \n
portal_simulation = paysheet.getPortalObject().portal_simulation\n portal = context.getPortalObject();\n
portal_simulation = portal.portal_simulation\n
\n \n
params = {\n params = {\n
\'section_uid\' : paysheet.getDestinationSectionUid(),\n \'section_uid\' : paysheet.getDestinationSectionUid(),\n
\'node_uid\' : paysheet.getSourceSectionUid(),\n \'node_uid\' : paysheet.getSourceSectionUid(),\n
\'tax_category_uid\' :\\\n \'tax_category_uid\' :\\\n
paysheet.portal_categories.tax_category.employee_share.getUid(),\n portal.portal_categories.tax_category.employee_share.getUid(),\n
\'to_date\' : paysheet.getStartDate(),\n \'to_date\' : paysheet.getStartDate(),\n
\'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n \'from_date\' : DateTime(paysheet.getStartDate().year(), 1, 1),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
...@@ -137,6 +138,7 @@ return taxable_net_pay\n ...@@ -137,6 +138,7 @@ return taxable_net_pay\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string>
<string>portal_simulation</string> <string>portal_simulation</string>
<string>DateTime</string> <string>DateTime</string>
<string>params</string> <string>params</string>
......
205 206
\ No newline at end of file \ No newline at end of file
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