Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Titouan Soulard
slapos.core
Commits
9ff1462a
Commit
9ff1462a
authored
Feb 20, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: update testSlapOSAccountingRule
parent
a71f8e70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
29 deletions
+74
-29
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingRule.py
...m/portal_components/test.erp5.testSlapOSAccountingRule.py
+71
-5
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingRule.xml
.../portal_components/test.erp5.testSlapOSAccountingRule.xml
+3
-24
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingRule.py
View file @
9ff1462a
...
@@ -40,6 +40,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
...
@@ -40,6 +40,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
destination
=
self
.
portal
.
person_module
.
template_member
\
destination
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
self
.
addProject
()
aggregate
=
self
.
portal
.
instance_tree_module
\
aggregate
=
self
.
portal
.
instance_tree_module
\
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
...
@@ -60,6 +61,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
...
@@ -60,6 +61,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
source_section_value
=
source
,
source_section_value
=
source
,
destination_value
=
destination
,
destination_value
=
destination
,
destination_section_value
=
destination
,
destination_section_value
=
destination
,
destination_project_value
=
project
,
resource_value
=
resource
,
resource_value
=
resource
,
aggregate_value
=
aggregate
,
aggregate_value
=
aggregate
,
start_date
=
start_date
,
start_date
=
start_date
,
...
@@ -68,6 +70,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
...
@@ -68,6 +70,7 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
ledger
=
'automated'
,
trade_phase
=
'slapos/invoicing'
,
trade_phase
=
'slapos/invoicing'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
specialise
=
specialise
=
...
@@ -121,6 +124,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
...
@@ -121,6 +124,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
self
.
assertEqual
(
destination
,
simulation_movement
.
getDestination
())
self
.
assertEqual
(
destination
,
simulation_movement
.
getDestination
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
simulation_movement
.
getDestinationSection
())
simulation_movement
.
getDestinationSection
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationProject
(),
simulation_movement
.
getDestinationProject
())
self
.
assertEqual
(
1
,
simulation_movement
.
getPrice
())
self
.
assertEqual
(
1
,
simulation_movement
.
getPrice
())
self
.
assertEqual
(
root_simulation_movement
.
getTotalPrice
()
*
\
self
.
assertEqual
(
root_simulation_movement
.
getTotalPrice
()
*
\
quantity_sign
,
simulation_movement
.
getQuantity
())
quantity_sign
,
simulation_movement
.
getQuantity
())
...
@@ -136,6 +141,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
...
@@ -136,6 +141,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
self
.
assertEqual
(
None
,
simulation_movement
.
getUse
())
self
.
assertEqual
(
None
,
simulation_movement
.
getUse
())
self
.
assertEqual
(
'slapos/accounting'
,
self
.
assertEqual
(
'slapos/accounting'
,
simulation_movement
.
getTradePhase
())
simulation_movement
.
getTradePhase
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
simulation_movement
.
getQuantityUnit
())
simulation_movement
.
getQuantityUnit
())
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
...
@@ -172,6 +179,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
...
@@ -172,6 +179,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
destination
=
self
.
portal
.
person_module
.
template_member
\
destination
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
self
.
addProject
()
resource
=
self
.
portal
.
service_module
.
slapos_account_validation
resource
=
self
.
portal
.
service_module
.
slapos_account_validation
start_date
=
DateTime
(
'2011/02/16'
)
start_date
=
DateTime
(
'2011/02/16'
)
stop_date
=
DateTime
(
'2011/02/16'
)
stop_date
=
DateTime
(
'2011/02/16'
)
...
@@ -190,6 +198,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
...
@@ -190,6 +198,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
source_section_value
=
source
,
source_section_value
=
source
,
destination_value
=
destination
,
destination_value
=
destination
,
destination_section_value
=
destination
,
destination_section_value
=
destination
,
destination_project_value
=
project
,
resource_value
=
resource
,
resource_value
=
resource
,
start_date
=
start_date
,
start_date
=
start_date
,
stop_date
=
stop_date
,
stop_date
=
stop_date
,
...
@@ -198,6 +207,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
...
@@ -198,6 +207,7 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
trade_phase
=
'slapos/invoicing'
,
trade_phase
=
'slapos/invoicing'
,
ledger
=
'automated'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/invoice_path'
,
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/invoice_path'
,
...
@@ -246,6 +256,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
...
@@ -246,6 +256,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
destination
=
self
.
portal
.
person_module
.
template_member
\
destination
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
self
.
addProject
()
aggregate
=
self
.
portal
.
instance_tree_module
\
aggregate
=
self
.
portal
.
instance_tree_module
\
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
...
@@ -266,6 +277,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
...
@@ -266,6 +277,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
source_section_value
=
source
,
source_section_value
=
source
,
destination_value
=
destination
,
destination_value
=
destination
,
destination_section_value
=
destination
,
destination_section_value
=
destination
,
destination_project_value
=
project
,
resource_value
=
resource
,
resource_value
=
resource
,
aggregate_value
=
aggregate
,
aggregate_value
=
aggregate
,
start_date
=
start_date
,
start_date
=
start_date
,
...
@@ -275,6 +287,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
...
@@ -275,6 +287,7 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
trade_phase
=
'slapos/delivery'
,
trade_phase
=
'slapos/delivery'
,
ledger
=
'automated'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/delivery_path'
,
'business_process_module/slapos_aggregated_business_process/deliver'
])
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/delivery_path'
,
'business_process_module/slapos_aggregated_business_process/deliver'
])
...
@@ -313,6 +326,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
...
@@ -313,6 +326,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
simulation_movement
.
getDestination
())
simulation_movement
.
getDestination
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
simulation_movement
.
getDestinationSection
())
simulation_movement
.
getDestinationSection
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationProject
(),
simulation_movement
.
getDestinationProject
())
self
.
assertEqual
(
root_simulation_movement
.
getPrice
(),
self
.
assertEqual
(
root_simulation_movement
.
getPrice
(),
simulation_movement
.
getPrice
())
simulation_movement
.
getPrice
())
self
.
assertEqual
(
root_simulation_movement
.
getQuantity
(),
self
.
assertEqual
(
root_simulation_movement
.
getQuantity
(),
...
@@ -333,6 +348,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
...
@@ -333,6 +348,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
simulation_movement
.
getUse
())
simulation_movement
.
getUse
())
self
.
assertEqual
(
'slapos/invoicing'
,
self
.
assertEqual
(
'slapos/invoicing'
,
simulation_movement
.
getTradePhase
())
simulation_movement
.
getTradePhase
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
simulation_movement
.
getQuantityUnit
())
simulation_movement
.
getQuantityUnit
())
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
...
@@ -366,6 +383,7 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
...
@@ -366,6 +383,7 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
destination
=
self
.
portal
.
person_module
.
template_member
\
destination
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
self
.
addProject
()
resource
=
self
.
portal
.
currency_module
.
EUR
resource
=
self
.
portal
.
currency_module
.
EUR
start_date
=
DateTime
(
'2011/02/16'
)
start_date
=
DateTime
(
'2011/02/16'
)
stop_date
=
DateTime
(
'2011/03/16'
)
stop_date
=
DateTime
(
'2011/03/16'
)
...
@@ -384,11 +402,13 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
...
@@ -384,11 +402,13 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
source_section_value
=
source
,
source_section_value
=
source
,
destination
=
'account_module/payable'
,
destination
=
'account_module/payable'
,
destination_section_value
=
destination
,
destination_section_value
=
destination
,
destination_project_value
=
project
,
resource_value
=
resource
,
resource_value
=
resource
,
start_date
=
start_date
,
start_date
=
start_date
,
stop_date
=
stop_date
,
stop_date
=
stop_date
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/account'
],
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/account'
],
...
@@ -421,18 +441,38 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
...
@@ -421,18 +441,38 @@ class TestDefaultPaymentRule(SlapOSTestCaseMixin):
class
TestHostingSubscriptionSimulation
(
SlapOSTestCaseMixin
):
class
TestHostingSubscriptionSimulation
(
SlapOSTestCaseMixin
):
def
_prepare
(
self
):
def
_prepare
(
self
):
"""
person = self.portal.person_module.template_member
\
person = self.portal.person_module.template_member
\
.Base_createCloneDocument(batch_mode=1)
.Base_createCloneDocument(batch_mode=1)
project = self.addProject()
self.instance_tree = self.portal.instance_tree_module
\
self.instance_tree = self.portal.instance_tree_module
\
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
self.instance_tree.edit(
self.instance_tree.edit(
destination_section_value
=
person
destination_section_value=person,
follow_up_value=project
)
)
self.portal.portal_workflow._jumpToStateFor(self.instance_tree, 'validated')
self.portal.portal_workflow._jumpToStateFor(self.instance_tree, 'validated')
"""
software_product
,
_
,
_
,
_
,
_
,
self
.
instance_tree
=
self
.
bootstrapAllocableInstanceTree
()
#person = instance_tree.getDestinationSectionValue()
sale_supply
=
self
.
portal
.
sale_supply_module
.
newContent
(
portal_type
=
"Sale Supply"
,
destination_project_value
=
software_product
.
getFollowUpValue
(),
price_currency
=
"currency_module/EUR"
)
# XXX Put price in sale supply module
sale_supply
.
newContent
(
portal_type
=
"Sale Supply Line"
,
base_price
=
9
,
resource_value
=
software_product
)
sale_supply
.
validate
()
self
.
tic
()
open_order
=
self
.
instance_tree
.
InstanceTree_requestUpdateOpenSaleOrder
(
open_order
=
self
.
instance_tree
.
InstanceTree_requestUpdateOpenSaleOrder
(
specialise
=
"sale_trade_condition_module/default_subscription_trade_condition"
specialise
=
"sale_trade_condition_module/default_subscription_trade_condition"
)
)
self
.
tic
()
self
.
initial_date
=
DateTime
(
'2011/02/16'
)
self
.
initial_date
=
DateTime
(
'2011/02/16'
)
stop_date
=
DateTime
(
'2011/04/16'
)
stop_date
=
DateTime
(
'2011/04/16'
)
...
@@ -443,7 +483,8 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
...
@@ -443,7 +483,8 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
self
.
open_order_line
=
open_order
.
contentValues
(
self
.
open_order_line
=
open_order
.
contentValues
(
portal_type
=
'Open Sale Order Line'
portal_type
=
'Open Sale Order Line'
)[
0
]
)[
0
].
contentValues
(
portal_type
=
'Open Sale Order Cell'
)[
0
]
self
.
open_order_line
.
edit
(
self
.
open_order_line
.
edit
(
start_date
=
self
.
initial_date
,
start_date
=
self
.
initial_date
,
stop_date
=
stop_date
stop_date
=
stop_date
...
@@ -512,12 +553,16 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
...
@@ -512,12 +553,16 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
simulation_movement
.
getDestination
())
simulation_movement
.
getDestination
())
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationSection
(),
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationSection
(),
simulation_movement
.
getDestinationSection
())
simulation_movement
.
getDestinationSection
())
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationProject
(),
simulation_movement
.
getDestinationProject
())
self
.
assertEqual
(
self
.
open_order_line
.
getSpecialise
(),
self
.
assertEqual
(
self
.
open_order_line
.
getSpecialise
(),
simulation_movement
.
getSpecialise
())
simulation_movement
.
getSpecialise
())
self
.
assertEqual
(
self
.
open_order_line
.
getResource
(),
self
.
assertEqual
(
self
.
open_order_line
.
getResource
(),
simulation_movement
.
getResource
())
simulation_movement
.
getResource
())
self
.
assertEqual
(
applied_rule
.
getSpecialiseValue
().
getTradePhaseList
(),
self
.
assertEqual
(
applied_rule
.
getSpecialiseValue
().
getTradePhaseList
(),
simulation_movement
.
getTradePhaseList
())
simulation_movement
.
getTradePhaseList
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertSameSet
(
self
.
open_order_line
.
getAggregateList
(),
self
.
assertSameSet
(
self
.
open_order_line
.
getAggregateList
(),
simulation_movement
.
getAggregateList
())
simulation_movement
.
getAggregateList
())
self
.
assertEqual
(
'planned'
,
simulation_movement
.
getSimulationState
())
self
.
assertEqual
(
'planned'
,
simulation_movement
.
getSimulationState
())
...
@@ -628,12 +673,16 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
...
@@ -628,12 +673,16 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
simulation_movement
.
getDestination
())
simulation_movement
.
getDestination
())
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationSection
(),
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationSection
(),
simulation_movement
.
getDestinationSection
())
simulation_movement
.
getDestinationSection
())
self
.
assertEqual
(
self
.
open_order_line
.
getDestinationProject
(),
simulation_movement
.
getDestinationProject
())
self
.
assertEqual
(
self
.
open_order_line
.
getSpecialise
(),
self
.
assertEqual
(
self
.
open_order_line
.
getSpecialise
(),
simulation_movement
.
getSpecialise
())
simulation_movement
.
getSpecialise
())
self
.
assertEqual
(
self
.
open_order_line
.
getResource
(),
self
.
assertEqual
(
self
.
open_order_line
.
getResource
(),
simulation_movement
.
getResource
())
simulation_movement
.
getResource
())
self
.
assertEqual
(
applied_rule
.
getSpecialiseValue
().
getTradePhaseList
(),
self
.
assertEqual
(
applied_rule
.
getSpecialiseValue
().
getTradePhaseList
(),
simulation_movement
.
getTradePhaseList
())
simulation_movement
.
getTradePhaseList
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertSameSet
(
self
.
open_order_line
.
getAggregateList
(),
self
.
assertSameSet
(
self
.
open_order_line
.
getAggregateList
(),
simulation_movement
.
getAggregateList
())
simulation_movement
.
getAggregateList
())
self
.
assertEqual
(
'planned'
,
simulation_movement
.
getSimulationState
())
self
.
assertEqual
(
'planned'
,
simulation_movement
.
getSimulationState
())
...
@@ -678,6 +727,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
...
@@ -678,6 +727,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
destination
=
self
.
portal
.
person_module
.
template_member
\
destination
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
self
.
addProject
()
aggregate
=
self
.
portal
.
instance_tree_module
\
aggregate
=
self
.
portal
.
instance_tree_module
\
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
resource
=
self
.
portal
.
service_module
.
slapos_instance_subscription
...
@@ -698,6 +748,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
...
@@ -698,6 +748,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
source_section_value
=
source
,
source_section_value
=
source
,
destination_value
=
destination
,
destination_value
=
destination
,
destination_section_value
=
destination
,
destination_section_value
=
destination
,
destination_project_value
=
project
,
resource_value
=
resource
,
resource_value
=
resource
,
aggregate_value
=
aggregate
,
aggregate_value
=
aggregate
,
start_date
=
start_date
,
start_date
=
start_date
,
...
@@ -707,6 +758,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
...
@@ -707,6 +758,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
trade_phase
=
'slapos/invoicing'
,
trade_phase
=
'slapos/invoicing'
,
ledger
=
'automated'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
specialise
=
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL
,
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/invoice_path'
,
'business_process_module/slapos_aggregated_business_process/invoice'
],
causality_list
=
[
'business_process_module/slapos_aggregated_business_process/invoice_path'
,
'business_process_module/slapos_aggregated_business_process/invoice'
],
...
@@ -749,6 +801,8 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
...
@@ -749,6 +801,8 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
simulation_movement
.
getDestination
())
simulation_movement
.
getDestination
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
self
.
assertEqual
(
root_simulation_movement
.
getDestinationSection
(),
simulation_movement
.
getDestinationSection
())
simulation_movement
.
getDestinationSection
())
self
.
assertEqual
(
root_simulation_movement
.
getDestinationProject
(),
simulation_movement
.
getDestinationProject
())
self
.
assertEqual
(
root_simulation_movement
.
getTotalPrice
(),
self
.
assertEqual
(
root_simulation_movement
.
getTotalPrice
(),
simulation_movement
.
getQuantity
())
simulation_movement
.
getQuantity
())
self
.
assertEqual
(
root_simulation_movement
.
getPriceCurrency
(),
self
.
assertEqual
(
root_simulation_movement
.
getPriceCurrency
(),
...
@@ -771,6 +825,8 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
...
@@ -771,6 +825,8 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
self
.
assertEqual
([],
simulation_movement
.
getBaseContributionList
())
self
.
assertEqual
([],
simulation_movement
.
getBaseContributionList
())
self
.
assertEqual
(
'slapos/tax'
,
self
.
assertEqual
(
'slapos/tax'
,
simulation_movement
.
getTradePhase
())
simulation_movement
.
getTradePhase
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
self
.
assertEqual
(
root_simulation_movement
.
getQuantityUnit
(),
simulation_movement
.
getQuantityUnit
())
simulation_movement
.
getQuantityUnit
())
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
self
.
assertEqual
(
root_simulation_movement
.
getSpecialise
(),
...
@@ -785,16 +841,19 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
...
@@ -785,16 +841,19 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
def
newArrow
():
def
newArrow
():
return
self
.
portal
.
organisation_module
.
newContent
(
return
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
).
getRelativeUrl
()
portal_type
=
'Organisation'
).
getRelativeUrl
()
project
=
self
.
addProject
()
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
,
portal_type
=
'Sale Packing List'
,
source
=
newArrow
(),
source
=
newArrow
(),
destination
=
newArrow
(),
destination
=
newArrow
(),
source_section
=
newArrow
(),
source_section
=
newArrow
(),
destination_section
=
newArrow
(),
destination_section
=
newArrow
(),
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
specialise
=
self
.
trade_condition
,
specialise
=
self
.
trade_condition
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/02'
)
stop_date
=
DateTime
(
'2012/02/02'
),
ledger
=
'automated'
)
)
line
=
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
line
=
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
resource
=
self
.
portal
.
service_module
.
newContent
(
resource
=
self
.
portal
.
service_module
.
newContent
(
...
@@ -851,6 +910,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
...
@@ -851,6 +910,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
simulation_movement
.
getDestinationList
())
simulation_movement
.
getDestinationList
())
self
.
assertSameSet
(
delivery
.
getDestinationSectionList
(),
self
.
assertSameSet
(
delivery
.
getDestinationSectionList
(),
simulation_movement
.
getDestinationSectionList
())
simulation_movement
.
getDestinationSectionList
())
self
.
assertSameSet
(
delivery
.
getDestinationProjectList
(),
simulation_movement
.
getDestinationProjectList
())
self
.
assertSameSet
(
delivery
.
getPriceCurrencyList
(),
self
.
assertSameSet
(
delivery
.
getPriceCurrencyList
(),
simulation_movement
.
getPriceCurrencyList
())
simulation_movement
.
getPriceCurrencyList
())
self
.
assertSameSet
(
delivery
.
getSpecialiseList
(),
self
.
assertSameSet
(
delivery
.
getSpecialiseList
(),
...
@@ -859,6 +920,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
...
@@ -859,6 +920,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
simulation_movement
.
getStartDate
())
simulation_movement
.
getStartDate
())
self
.
assertEqual
(
delivery
.
getStopDate
(),
self
.
assertEqual
(
delivery
.
getStopDate
(),
simulation_movement
.
getStopDate
())
simulation_movement
.
getStopDate
())
self
.
assertEqual
(
'automated'
,
simulation_movement
.
getLedger
())
self
.
assertSameSet
([],
[
q
.
getSpecialiseReference
()
self
.
assertSameSet
([],
[
q
.
getSpecialiseReference
()
for
q
in
simulation_movement
.
contentValues
(
portal_type
=
'Applied Rule'
)])
for
q
in
simulation_movement
.
contentValues
(
portal_type
=
'Applied Rule'
)])
delivery
.
stop
()
delivery
.
stop
()
...
@@ -872,17 +935,20 @@ class TestDefaultDeliveryRuleConsumption(SlapOSTestCaseMixin):
...
@@ -872,17 +935,20 @@ class TestDefaultDeliveryRuleConsumption(SlapOSTestCaseMixin):
def
newArrow
():
def
newArrow
():
return
self
.
portal
.
organisation_module
.
newContent
(
return
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
).
getRelativeUrl
()
portal_type
=
'Organisation'
).
getRelativeUrl
()
project
=
self
.
addProject
()
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
,
portal_type
=
'Sale Packing List'
,
source
=
newArrow
(),
source
=
newArrow
(),
destination
=
newArrow
(),
destination
=
newArrow
(),
source_section
=
newArrow
(),
source_section
=
newArrow
(),
destination_section
=
newArrow
(),
destination_section
=
newArrow
(),
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
=
'currency_module/EUR'
,
specialise
=
'sale_trade_condition_module/slapos_consumption_trade_'
specialise
=
'sale_trade_condition_module/slapos_consumption_trade_'
'condition'
,
'condition'
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/02'
)
stop_date
=
DateTime
(
'2012/02/02'
),
ledger
=
'automated'
)
)
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
,
resource
=
self
.
portal
.
service_module
.
newContent
(
resource
=
self
.
portal
.
service_module
.
newContent
(
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingRule.xml
View file @
9ff1462a
...
@@ -6,12 +6,6 @@
...
@@ -6,12 +6,6 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSAccountingRule
</string>
</value>
<value>
<string>
testSlapOSAccountingRule
</string>
</value>
...
@@ -55,28 +49,13 @@
...
@@ -55,28 +49,13 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -89,7 +68,7 @@
...
@@ -89,7 +68,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -98,7 +77,7 @@
...
@@ -98,7 +77,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
</pickle>
...
...
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