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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
658d4224
Commit
658d4224
authored
Mar 15, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: use the trade condition reference instead of the id
sale trade condition are versionned.
parent
64fd2439
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Base_testSlapOSValidTradeCondition.py
...s/slapos_accounting/Base_testSlapOSValidTradeCondition.py
+18
-12
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SaleInvoiceTransaction_createReversalPayzenTransaction.py
...SaleInvoiceTransaction_createReversalPayzenTransaction.py
+2
-2
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Base_testSlapOSValidTradeCondition.py
View file @
658d4224
root_trade_condition_list
=
[
"sale_trade_condition_module/slapos_aggregated_trade_condition"
,
"sale_trade_condition_module/slapos_aggregated_subscription_trade_condition"
,
# Valid trade condition for payments
"sale_trade_condition_module/slapos_manual_accounting_trade_condition"
]
if
context
.
getSpecialise
()
in
root_trade_condition_list
:
return
True
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
specialise_uid
=
[
portal
.
restrictedTraverse
(
i
).
getUid
()
for
i
in
root_trade_condition_list
root_trade_condition_reference_list
=
[
"slapos_aggregated_trade_condition"
,
"slapos_aggregated_subscription_trade_condition"
,
# Valid trade condition for payments
"slapos_manual_accounting_trade_condition"
]
]
root_trade_condition_list
=
portal
.
portal_catalog
(
portal_type
=
"Sale Trade Condition"
,
reference
=
root_trade_condition_reference_list
,
validation_state
=
"validated"
,
)
specialise_uid_list
=
[
x
.
getUid
()
for
x
in
root_trade_condition_list
]
if
context
.
getSpecialiseUid
()
in
specialise_uid_list
:
return
True
return
context
.
getSpecialiseUid
()
in
[
return
context
.
getSpecialiseUid
()
in
[
i
.
uid
for
i
in
portal
.
ERP5Site_searchRelatedInheritedSpecialiseList
(
i
.
uid
for
i
in
portal
.
ERP5Site_searchRelatedInheritedSpecialiseList
(
portal_type
=
"Sale Trade Condition"
,
portal_type
=
"Sale Trade Condition"
,
specialise_uid
=
specialise_uid
,
specialise_uid
=
specialise_uid
_list
,
validation_state
=
"validated"
)]
validation_state
=
"validated"
)]
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/SaleInvoiceTransaction_createReversalPayzenTransaction.py
View file @
658d4224
...
@@ -10,8 +10,8 @@ assert context.getPortalType() == 'Sale Invoice Transaction'
...
@@ -10,8 +10,8 @@ assert context.getPortalType() == 'Sale Invoice Transaction'
assert
context
.
getPaymentMode
()
==
'payzen'
assert
context
.
getPaymentMode
()
==
'payzen'
assert
context
.
getSimulationState
()
==
'stopped'
assert
context
.
getSimulationState
()
==
'stopped'
assert
context
.
getTotalPrice
()
!=
0
assert
context
.
getTotalPrice
()
!=
0
assert
context
.
getSpecialise
()
in
(
"sale_trade_condition_module/
slapos_aggregated_trade_condition"
,
assert
context
.
getSpecialise
Reference
()
in
(
"
slapos_aggregated_trade_condition"
,
"sale_trade_condition_module/
slapos_aggregated_subscription_trade_condition"
)
"
slapos_aggregated_subscription_trade_condition"
)
paid
=
True
paid
=
True
for
line
in
context
.
getMovementList
(
portal
.
getPortalAccountingMovementTypeList
()):
for
line
in
context
.
getMovementList
(
portal
.
getPortalAccountingMovementTypeList
()):
...
...
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