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
b7246f34
Commit
b7246f34
authored
Oct 20, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: test: templates were dropped
parent
cb10f80f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
24 deletions
+52
-24
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+52
-24
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
b7246f34
...
...
@@ -158,7 +158,9 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
def
test_AccountingTransactionModule_getUnpaidInvoiceList
(
self
):
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
user
=
1
)
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
"Organisation"
)
sale_trade_condition
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
"Sale Trade Condition"
,
reference
=
self
.
generateNewId
(),
...
...
@@ -166,22 +168,32 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
)
sale_trade_condition
.
validate
()
template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate
())
current_invoice
=
template
.
Base_createCloneDocument
(
batch_mode
=
1
)
current_invoice
.
edit
(
specialise_value
=
sale_trade_condition
,
destination_value
=
person
,
destination_section_value
=
person
,
destination_decision_value
=
person
,
start_date
=
DateTime
(
'2019/10/20'
),
stop_date
=
DateTime
(
'2019/10/20'
),
title
=
'Fake Invoice for Demo User Functional'
,
price_currency
=
"currency_module/EUR"
,
reference
=
'1'
)
cell
=
current_invoice
[
"1"
][
"movement_0"
]
current_invoice
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
,
created_by_builder
=
1
,
# to prevent init script to create lines
specialise_value
=
sale_trade_condition
,
source_section_value
=
organisation
,
destination_value
=
person
,
destination_section_value
=
person
,
destination_decision_value
=
person
,
start_date
=
DateTime
(
'2019/10/20'
),
stop_date
=
DateTime
(
'2019/10/20'
),
title
=
'Fake Invoice for Demo User Functional'
,
price_currency
=
"currency_module/EUR"
,
reference
=
'1'
,
ledger
=
'automated'
)
cell
=
current_invoice
.
newContent
(
portal_type
=
"Invoice Line"
,
resource
=
"service_module/slapos_reservation_fee_2"
,
use
=
"trade/sale"
,
quantity_unit
=
"unit/piece"
,
base_contribution_list
=
[
"base_amount/invoicing/discounted"
,
"base_amount/invoicing/taxable"
]
)
cell
.
edit
(
quantity
=
1
)
cell
.
setPrice
(
1
)
...
...
@@ -217,10 +229,29 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
[
current_invoice
.
getRelativeUrl
()])
self
.
login
()
payment_template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredDefaultPrePaymentTemplate
())
payment
=
payment_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Payment Transaction"
,
created_by_builder
=
1
,
# to prevent init script to create lines
source_section_value
=
organisation
,
destination_value
=
person
,
start_date
=
DateTime
(
'2019/10/20'
),
stop_date
=
DateTime
(
'2019/10/20'
),
title
=
'Fake Payment for Demo User Functional'
,
ressource
=
"currency_module/EUR"
,
price_currency
=
"currency_module/EUR"
,
ledger
=
'automated'
)
payment
.
newContent
(
portal_type
=
"Accounting Transaction Line"
,
destination
=
"account_module/payable"
,
source
=
"account_module/receivable"
)
payment
.
newContent
(
portal_type
=
"Accounting Transaction Line"
,
destination
=
"account_module/payment_to_encash"
,
source
=
"account_module/payment_to_encash"
)
for
line
in
payment
.
contentValues
():
if
line
.
getSource
()
==
"account_module/payment_to_encash"
:
line
.
setQuantity
(
-
1
)
...
...
@@ -235,14 +266,11 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
payment
.
stop
()
self
.
tic
()
is_lettered
=
False
letter
=
None
for
line
in
current_invoice
.
contentValues
():
if
line
.
getSource
()
==
"account_module/receivable"
:
is_lettered
=
True
letter
=
line
.
getGroupingReference
()
self
.
assertTrue
(
is_lettered
)
self
.
assertTrue
(
current_invoice
.
SaleInvoiceTransaction_isLettered
())
# is it groupped?
is_lettered
=
False
...
...
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