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
Mikolaï Krol
erp5
Commits
feb60a37
Commit
feb60a37
authored
May 23, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amount_generator: AggregatedAmountList -> GeneratedAmountList
parent
1abc4bac
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
product/ERP5/Document/TradeCondition.py
product/ERP5/Document/TradeCondition.py
+1
-1
product/ERP5/GeneratedAmountList.py
product/ERP5/GeneratedAmountList.py
+2
-2
product/ERP5/mixin/amount_generator.py
product/ERP5/mixin/amount_generator.py
+3
-3
product/ERP5/tests/testApparelTransformation.py
product/ERP5/tests/testApparelTransformation.py
+2
-2
product/ERP5/tests/testERP5Interfaces.py
product/ERP5/tests/testERP5Interfaces.py
+1
-1
No files found.
product/ERP5/Document/TradeCondition.py
View file @
feb60a37
...
@@ -39,7 +39,7 @@ from Products.ERP5Type import Permissions, PropertySheet, interfaces
...
@@ -39,7 +39,7 @@ from Products.ERP5Type import Permissions, PropertySheet, interfaces
from
Products.ERP5Type.Utils
import
deprecated
from
Products.ERP5Type.Utils
import
deprecated
from
Products.ERP5.mixin.composition
import
_getEffectiveModel
from
Products.ERP5.mixin.composition
import
_getEffectiveModel
from
Products.ERP5.Document.Transformation
import
Transformation
from
Products.ERP5.Document.Transformation
import
Transformation
from
Products.ERP5.
AggregatedAmountList
import
Aggreg
atedAmountList
from
Products.ERP5.
GeneratedAmountList
import
Gener
atedAmountList
from
Products.ERP5.Document.MappedValue
import
MappedValue
from
Products.ERP5.Document.MappedValue
import
MappedValue
from
Products.ERP5.mixin.amount_generator
import
AmountGeneratorMixin
from
Products.ERP5.mixin.amount_generator
import
AmountGeneratorMixin
from
Products.ERP5.mixin.variated
import
VariatedMixin
from
Products.ERP5.mixin.variated
import
VariatedMixin
...
...
product/ERP5/
Aggreg
atedAmountList.py
→
product/ERP5/
Gener
atedAmountList.py
View file @
feb60a37
...
@@ -31,7 +31,7 @@ import zope.interface
...
@@ -31,7 +31,7 @@ import zope.interface
from
AccessControl
import
allow_class
from
AccessControl
import
allow_class
from
Products.ERP5Type
import
interfaces
from
Products.ERP5Type
import
interfaces
class
Aggreg
atedAmountList
(
list
):
class
Gener
atedAmountList
(
list
):
"""
"""
Temporary object needed to aggregate Amount value
Temporary object needed to aggregate Amount value
And to calculate some report or total value
And to calculate some report or total value
...
@@ -60,4 +60,4 @@ class AggregatedAmountList(list):
...
@@ -60,4 +60,4 @@ class AggregatedAmountList(list):
result
+=
duration
result
+=
duration
return
result
return
result
allow_class
(
Aggreg
atedAmountList
)
allow_class
(
Gener
atedAmountList
)
product/ERP5/mixin/amount_generator.py
View file @
feb60a37
...
@@ -32,7 +32,7 @@ import zope.interface
...
@@ -32,7 +32,7 @@ import zope.interface
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
from
Acquisition
import
aq_base
,
Implicit
from
Acquisition
import
aq_base
,
Implicit
from
Products.ERP5.
AggregatedAmountList
import
Aggreg
atedAmountList
from
Products.ERP5.
GeneratedAmountList
import
Gener
atedAmountList
from
Products.ERP5Type
import
Permissions
,
interfaces
from
Products.ERP5Type
import
Permissions
,
interfaces
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5.Document.MappedValue
import
MappedValue
from
Products.ERP5.Document.MappedValue
import
MappedValue
...
@@ -281,7 +281,7 @@ class AmountGeneratorMixin:
...
@@ -281,7 +281,7 @@ class AmountGeneratorMixin:
portal
.
getPortalAmountGeneratorCellTypeList
()
portal
.
getPortalAmountGeneratorCellTypeList
()
# Set empty result by default
# Set empty result by default
result
=
Aggreg
atedAmountList
()
result
=
Gener
atedAmountList
()
args
=
(
getTransactionalVariable
().
setdefault
(
args
=
(
getTransactionalVariable
().
setdefault
(
"amount_generator.BaseAmountDict"
,
{}),
"amount_generator.BaseAmountDict"
,
{}),
...
@@ -517,7 +517,7 @@ class AmountGeneratorMixin:
...
@@ -517,7 +517,7 @@ class AmountGeneratorMixin:
# XXX: Do we handle rounding correctly ?
# XXX: Do we handle rounding correctly ?
# What to do if only total price is rounded ??
# What to do if only total price is rounded ??
aggregate_dict
=
{}
aggregate_dict
=
{}
result_list
=
Aggreg
atedAmountList
()
result_list
=
Gener
atedAmountList
()
for
amount
in
generated_amount_list
:
for
amount
in
generated_amount_list
:
key
=
(
amount
.
getPrice
(),
amount
.
getEfficiency
(),
key
=
(
amount
.
getPrice
(),
amount
.
getEfficiency
(),
amount
.
getReference
(),
amount
.
categories
)
amount
.
getReference
(),
amount
.
categories
)
...
...
product/ERP5/tests/testApparelTransformation.py
View file @
feb60a37
...
@@ -529,7 +529,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
...
@@ -529,7 +529,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
def
stepVerifySpecialisedTransformationAggregatedAmountList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepVerifySpecialisedTransformationAggregatedAmountList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
"""
"""
Verify the return of
Aggreg
atedAmountList for a transformation which includes another one
Verify the return of
Gener
atedAmountList for a transformation which includes another one
"""
"""
expected_list
=
[
expected_list
=
[
{
'id'
:(
'size/Baby'
,
'colour/apparel_model_module/1/1'
,
'morphology/apparel_model_module/1/4'
),
{
'id'
:(
'size/Baby'
,
'colour/apparel_model_module/1/1'
,
'morphology/apparel_model_module/1/4'
),
...
@@ -672,7 +672,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
...
@@ -672,7 +672,7 @@ class TestApparelTransformation(TestOrderMixin, ERP5TypeTestCase):
# Check global quantity
# Check global quantity
total_price
=
aggregated_amount_list
.
getTotalPrice
()
total_price
=
aggregated_amount_list
.
getTotalPrice
()
error_msg
=
'Total price for
Aggreg
atedAmountList differs between '
\
error_msg
=
'Total price for
Gener
atedAmountList differs between '
\
'expected (%s) and aggregated (%s) (%s)'
%
\
'expected (%s) and aggregated (%s) (%s)'
%
\
(
total_price
,
expected
[
'total'
],
expected
[
'id'
])
(
total_price
,
expected
[
'total'
],
expected
[
'id'
])
self
.
assertEqual
(
round
(
total_price
,
10
),
round
(
expected
[
'total'
],
10
),
self
.
assertEqual
(
round
(
total_price
,
10
),
round
(
expected
[
'total'
],
10
),
...
...
product/ERP5/tests/testERP5Interfaces.py
View file @
feb60a37
...
@@ -55,7 +55,7 @@ implements_tuple_list = [
...
@@ -55,7 +55,7 @@ implements_tuple_list = [
((
'Products.ERP5.Document.EmailDocument'
,
'EmailDocument'
),
'IDocument'
),
((
'Products.ERP5.Document.EmailDocument'
,
'EmailDocument'
),
'IDocument'
),
((
'Products.ERP5.Document.Event'
,
'Event'
),
'IDocument'
),
((
'Products.ERP5.Document.Event'
,
'Event'
),
'IDocument'
),
# IAmountList
# IAmountList
((
'Products.ERP5.
AggregatedAmountList'
,
'Aggreg
atedAmountList'
),
'IAmountList'
),
((
'Products.ERP5.
GeneratedAmountList'
,
'Gener
atedAmountList'
),
'IAmountList'
),
]
]
# IMovementGroup
# IMovementGroup
for
movement_group_class_name
in
[
'MovementGroup'
,
'BaseVariantMovementGroup'
,
for
movement_group_class_name
in
[
'MovementGroup'
,
'BaseVariantMovementGroup'
,
...
...
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