Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
0e91e25f
Commit
0e91e25f
authored
Jan 24, 2013
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add price context script"
This reverts commit
706ee9e9
.
parent
0cc0204e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
112 deletions
+0
-112
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_getPriceCalculationDefaultContext.xml
...5_commerce/Resource_getPriceCalculationDefaultContext.xml
+0
-112
No files found.
bt5/erp5_commerce/SkinTemplateItem/portal_skins/erp5_commerce/Resource_getPriceCalculationDefaultContext.xml
deleted
100644 → 0
View file @
0cc0204e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""\n
Create a temporary movement with properties and categories\n
needed to provide a default price for a given resource\n
\n
TODO:\n
- add support to input parameters (**kw) so that it\n
is possible specialize price calculation\n
"""\n
from Products.ERP5Type.Document import newTempMovement\n
\n
# Try to find out the current web site\n
web_site_value = context.REQUEST.get(\'current_web_site\', None)\n
if web_site_value is None:\n
web_site_value = context.getWebSiteValue() \n
if web_site_value is None:\n
raise ValueError("Could not determine the current web site to compute default currency of price")\n
\n
# If this resource is variated, initialize the default\n
# variation context\n
variation_dict = {}\n
if len(context.getVariationRangeCategoryList()):\n
request = context.REQUEST\n
# Set each category of variation either to the default value\n
# or to the value provided by the REQUEST object\n
for variation_base_category in context.getVariationBaseCategoryList():\n
default_variation = context.getVariationCategoryList(base_category_list=[variation_base_category])\n
# circumvent inconsistency for individual variations\n
default_variation = default_variation or \\\n
context.getVariationRangeCategoryList(base_category_list=[variation_base_category])\n
if len(default_variation):\n
default_variation = default_variation[0]\n
variation_category = request.get(variation_base_category, default_variation)\n
variation_dict[variation_base_category] = variation_category\n
\n
movement = newTempMovement(context, "temp_pricing_movement", resource_value=context,\n
price_currency_value=web_site_value.WebSite_getShoppingCartDefaultCurrency(),\n
**variation_dict)\n
return movement\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Resource_getPriceCalculationDefaultContext
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment