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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
2c407c9f
Commit
2c407c9f
authored
Dec 18, 2018
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: implement directly in getSource/DestionAssetPrice methods
parent
1ca645f1
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
25 additions
and
659 deletions
+25
-659
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getAssetPrice.py
...emplateItem/portal_skins/erp5_trade/Base_getAssetPrice.py
+0
-19
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getAssetPrice.xml
...mplateItem/portal_skins/erp5_trade/Base_getAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getDestinationAssetPrice.py
...trade/PurchasePackingListCell_getDestinationAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getDestinationAssetPrice.xml
...rade/PurchasePackingListCell_getDestinationAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getSourceAssetPrice.py
...erp5_trade/PurchasePackingListCell_getSourceAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getSourceAssetPrice.xml
...rp5_trade/PurchasePackingListCell_getSourceAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getDestinationAssetPrice.py
...trade/PurchasePackingListLine_getDestinationAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getDestinationAssetPrice.xml
...rade/PurchasePackingListLine_getDestinationAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getSourceAssetPrice.py
...erp5_trade/PurchasePackingListLine_getSourceAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getSourceAssetPrice.xml
...rp5_trade/PurchasePackingListLine_getSourceAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getDestinationAssetPrice.py
...rp5_trade/SalePackingListCell_getDestinationAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getDestinationAssetPrice.xml
...p5_trade/SalePackingListCell_getDestinationAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getSourceAssetPrice.py
...ins/erp5_trade/SalePackingListCell_getSourceAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getSourceAssetPrice.xml
...ns/erp5_trade/SalePackingListCell_getSourceAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getDestinationAssetPrice.py
...rp5_trade/SalePackingListLine_getDestinationAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getDestinationAssetPrice.xml
...p5_trade/SalePackingListLine_getDestinationAssetPrice.xml
+0
-62
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getSourceAssetPrice.py
...ins/erp5_trade/SalePackingListLine_getSourceAssetPrice.py
+0
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getSourceAssetPrice.xml
...ns/erp5_trade/SalePackingListLine_getSourceAssetPrice.xml
+0
-62
product/ERP5/Document/Movement.py
product/ERP5/Document/Movement.py
+25
-2
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
from
Products.ERP5Type.Document
import
newTempAccountingTransactionLine
if
source_currency
:
temp_transaction
=
newTempAccountingTransactionLine
(
context
.
getPortalObject
(),
"accounting_line"
,
source_section
=
section
.
getRelativeUrl
(),
resource
=
source_currency
.
getRelativeUrl
(),
start_date
=
delivery
.
getStartDate
(),
)
exchange_rate
=
source_currency
.
getPrice
(
context
=
temp_transaction
.
asContext
(
categories
=
[
temp_transaction
.
getResource
(
base
=
True
),
section
.
getPriceCurrency
(
base
=
True
)],
)
)
if
exchange_rate
:
return
exchange_rate
*
context
.
getPrice
()
return
context
.
getPrice
()
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string>
section, source_currency, delivery
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getDestinationAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
().
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Purchase Packing List"
:
return
None
section
=
delivery
.
getDestinationSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getDestinationAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PurchasePackingListCell_getDestinationAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getSourceAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
().
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Purchase Packing List"
:
return
None
section
=
delivery
.
getSourceSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListCell_getSourceAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PurchasePackingListCell_getSourceAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getDestinationAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Purchase Packing List"
:
return
None
section
=
delivery
.
getDestinationSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getDestinationAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PurchasePackingListLine_getDestinationAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getSourceAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Purchase Packing List"
:
return
None
section
=
delivery
.
getSourceSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchasePackingListLine_getSourceAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PurchasePackingListLine_getSourceAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getDestinationAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
().
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Sale Packing List"
:
return
None
section
=
delivery
.
getDestinationSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getDestinationAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingListCell_getDestinationAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getSourceAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
().
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Sale Packing List"
:
return
None
section
=
delivery
.
getSourceSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListCell_getSourceAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingListCell_getSourceAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getDestinationAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Sale Packing List"
:
return
None
section
=
delivery
.
getDestinationSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getDestinationAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingListLine_getDestinationAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getSourceAssetPrice.py
deleted
100644 → 0
View file @
1ca645f1
line
=
context
delivery
=
line
.
getParentValue
()
if
delivery
.
getPortalType
()
!=
"Sale Packing List"
:
return
None
section
=
delivery
.
getSourceSectionValue
()
source_currency
=
delivery
.
getPriceCurrencyValue
()
return
line
.
Base_getAssetPrice
(
section
=
section
,
source_currency
=
source_currency
,
delivery
=
delivery
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SalePackingListLine_getSourceAssetPrice.xml
deleted
100644 → 0
View file @
1ca645f1
<?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>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SalePackingListLine_getSourceAssetPrice
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/Document/Movement.py
View file @
2c407c9f
...
...
@@ -487,7 +487,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
type_based_script
=
self
.
_getTypeBasedMethod
(
'getSourceAssetPrice'
)
if
type_based_script
:
return
type_based_script
()
return
self
.
getPrice
(
)
return
self
.
_getAssetPrice
(
section
=
self
.
getSourceSectionValue
()
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDestinationAssetPrice'
)
...
...
@@ -498,7 +498,30 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
type_based_script
=
self
.
_getTypeBasedMethod
(
'getDestinationAssetPrice'
)
if
type_based_script
:
return
type_based_script
()
return
self
.
getPrice
()
return
self
.
_getAssetPrice
(
section
=
self
.
getDestinationSectionValue
())
def
_getAssetPrice
(
self
,
section
):
from
Products.ERP5Type.Document
import
newTempAccountingTransactionLine
price
=
self
.
getPrice
()
source_currency
=
self
.
getPriceCurrencyValue
()
section_source_currency
=
section
.
getPriceCurrency
(
base
=
True
)
if
source_currency
and
section_source_currency
:
temp_transaction
=
newTempAccountingTransactionLine
(
self
.
getPortalObject
(),
"accounting_line"
,
source_section
=
section
.
getRelativeUrl
(),
resource
=
source_currency
.
getRelativeUrl
(),
start_date
=
self
.
getStartDate
(),
)
exchange_rate
=
source_currency
.
getPrice
(
context
=
temp_transaction
.
asContext
(
categories
=
[
temp_transaction
.
getResource
(
base
=
True
),
section_source_currency
],
)
)
if
exchange_rate
and
price
:
return
exchange_rate
*
price
return
price
# Causality computation
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
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