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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
d90f82c4
Commit
d90f82c4
authored
Jun 26, 2013
by
Rafael Monnerat
👻
Committed by
Xiaowu Zhang
Feb 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_commerce: use context to get price and be able to customize it
parent
48691d96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
bt5/erp5_commerce/ExtensionTemplateItem/Ecommerce.py
bt5/erp5_commerce/ExtensionTemplateItem/Ecommerce.py
+10
-2
No files found.
bt5/erp5_commerce/ExtensionTemplateItem/Ecommerce.py
View file @
d90f82c4
...
@@ -3,9 +3,17 @@ from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
...
@@ -3,9 +3,17 @@ from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
import
urllib
import
urllib
import
mechanize
import
mechanize
def
getProductPrice
(
product
):
def
getProductPrice
(
product
,
date
=
None
):
getPrice
=
UnrestrictedMethod
(
product
.
getPrice
)
getPrice
=
UnrestrictedMethod
(
product
.
getPrice
)
return
getPrice
(
supply_path_type
=
[
"Sale Supply Line"
,
"Sale Supply Cell"
])
getDefaultContext
=
UnrestrictedMethod
(
product
.
Resource_getPriceCalculationDefaultContext
)
return
getPrice
(
supply_path_type
=
[
"Sale Supply Line"
,
"Sale Supply Cell"
],
context
=
getDefaultContext
(
date
=
date
))
def
getCurrentInventory
(
product
,
**
kw
):
return
UnrestrictedMethod
(
product
.
getCurrentInventory
)(
**
kw
)
def
getFutureInventory
(
product
,
**
kw
):
return
UnrestrictedMethod
(
product
.
getFutureInventory
)(
**
kw
)
def
submitPaypalNVPRequest
(
parameter_dict
,
nvp_url
):
def
submitPaypalNVPRequest
(
parameter_dict
,
nvp_url
):
request
=
mechanize
.
Request
(
nvp_url
)
request
=
mechanize
.
Request
(
nvp_url
)
...
...
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