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
Klaus Wölfel
erp5
Commits
86b90bb1
Commit
86b90bb1
authored
Sep 27, 2016
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting_ui_test: extend test suite to support ledgers
parent
19272e33
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
189 additions
and
4 deletions
+189
-4
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting.xml
...TemplateItem/portal_categories/ledger/test_accounting.xml
+78
-0
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting/test_ledger_1.xml
...ortal_categories/ledger/test_accounting/test_ledger_1.xml
+44
-0
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting/test_ledger_2.xml
...ortal_categories/ledger/test_accounting/test_ledger_2.xml
+44
-0
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_createAccountingTransactionList.py
...i_test/AccountingZuite_createAccountingTransactionList.py
+20
-3
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_createAccountingTransactionList.xml
..._test/AccountingZuite_createAccountingTransactionList.xml
+1
-1
bt5/erp5_accounting_ui_test/bt/template_path_list
bt5/erp5_accounting_ui_test/bt/template_path_list
+2
-0
No files found.
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting.xml
0 → 100644
View file @
86b90bb1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
ledger/test_accounting
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test_accounting
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Test Accounting
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting/test_ledger_1.xml
0 → 100644
View file @
86b90bb1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
ledger/test_accounting/test_ledger_1
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test_ledger_1
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Test Ledger 1
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting_ui_test/PathTemplateItem/portal_categories/ledger/test_accounting/test_ledger_2.xml
0 → 100644
View file @
86b90bb1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
ledger/test_accounting/test_ledger_2
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test_ledger_2
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Test Ledger 2
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_createAccountingTransactionList.py
View file @
86b90bb1
...
...
@@ -14,9 +14,9 @@ business_process = portal.portal_catalog.getResultValue(
portal_type
=
'Business Process'
).
getRelativeUrl
()
# if the previous test didn't change input data, no need to recreate content
current_script_data_id
=
'%s_month_count_%s_draft_%s_state_%s_payment_%s'
%
(
current_script_data_id
=
'%s_month_count_%s_draft_%s_state_%s_payment_%s
_leger_%s
'
%
(
month_count
,
add_draft_transactions
,
transaction_state
,
add_related_payments
,
script
.
getId
())
add_related_payments
,
s
et_ledger
,
s
cript
.
getId
())
if
accounting_module
.
getProperty
(
'current_content_script'
,
''
)
==
current_script_data_id
:
...
...
@@ -34,6 +34,18 @@ if 1:
raise
ValueError
(
"Do not run this on production !!!"
)
module
.
manage_delObjects
(
list
(
module
.
objectIds
()))
# if `set_ledger`is true, allow all test ledgers in accounting types.
for
accounting_type_id
in
portal
.
getPortalAccountingTransactionTypeList
():
accounting_type
=
portal
.
portal_types
[
accounting_type_id
]
accounting_type
.
edit
(
ledger_value_list
=
list
(
portal
.
portal_categories
.
ledger
.
test_accounting
.
contentValues
())
if
set_ledger
else
())
test_ledger_1
=
test_ledger_2
=
None
if
set_ledger
:
test_ledger_1
=
portal
.
portal_categories
.
ledger
.
test_accounting
.
test_ledger_1
test_ledger_2
=
portal
.
portal_categories
.
ledger
.
test_accounting
.
test_ledger_2
def
getAccountByTitle
(
title
):
account_list
=
[
x
.
getObject
().
getRelativeUrl
()
for
x
in
portal
.
portal_catalog
(
portal_type
=
'Account'
,
...
...
@@ -97,6 +109,7 @@ for month in range(1, month_count + 1):
portal_type
=
'Accounting Transaction'
,
source_section
=
section
,
created_by_builder
=
1
,
ledger_value
=
test_ledger_1
,
start_date
=
default_date
,
stop_date
=
default_date
,
resource
=
euro_resource
,
...
...
@@ -122,7 +135,7 @@ for month in range(1, month_count + 1):
else
:
# other cases not supported for now
assert
transaction_state
==
'draft'
vat_rate
=
.
1
for
client_title
,
amount
in
((
'Client 1'
,
2000
),
(
'Client 2'
,
3000
)):
...
...
@@ -135,6 +148,7 @@ for month in range(1, month_count + 1):
source
=
section
,
destination
=
getOrganisationByTitle
(
client_title
),
created_by_builder
=
1
,
ledger_value
=
test_ledger_1
,
start_date
=
default_date
,
stop_date
=
default_date
,
specialise
=
business_process
,
...
...
@@ -174,6 +188,7 @@ for month in range(1, month_count + 1):
source_section
=
section
,
destination_section
=
getOrganisationByTitle
(
client_title
),
created_by_builder
=
1
,
ledger_value
=
test_ledger_1
,
start_date
=
default_date
+
.
1
,
# make sure this will be after the invoice
stop_date
=
default_date
+
.
1
,
resource
=
euro_resource
,
...
...
@@ -213,6 +228,7 @@ for month in range(1, month_count + 1):
destination_section
=
section
,
source_section
=
getOrganisationByTitle
(
'Supplier'
),
created_by_builder
=
1
,
ledger_value
=
test_ledger_1
,
start_date
=
default_date
-
5
,
# In purchase invoice transaction, stop_date is accounting operation date.
stop_date
=
default_date
,
specialise
=
business_process
,
...
...
@@ -248,6 +264,7 @@ if add_draft_transactions:
source_section
=
section
,
destination_section
=
getOrganisationByTitle
(
client_title
),
created_by_builder
=
1
,
ledger_value
=
test_ledger_1
,
start_date
=
default_date
,
stop_date
=
default_date
,
resource
=
euro_resource
,
...
...
bt5/erp5_accounting_ui_test/SkinTemplateItem/portal_skins/erp5_accounting_ui_test/AccountingZuite_createAccountingTransactionList.xml
View file @
86b90bb1
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
month_count=1, add_draft_transactions=1, transaction_state=\'validated\', add_related_payments=0, keep_grouping_reference=0
</string>
</value>
<value>
<string>
month_count=1, add_draft_transactions=1, transaction_state=\'validated\', add_related_payments=0, keep_grouping_reference=0
, set_ledger=0
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_accounting_ui_test/bt/template_path_list
View file @
86b90bb1
...
...
@@ -33,6 +33,8 @@ portal_categories/group/demo_group
portal_categories/group/demo_group/**
portal_categories/group/vendor
portal_categories/group/vendor/**
portal_categories/ledger/test_accounting
portal_categories/ledger/test_accounting/**
portal_categories/payment_mode/cash
portal_categories/payment_mode/check
portal_categories/role/client
...
...
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