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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
09ff03af
Commit
09ff03af
authored
Feb 01, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inventory API: test and document the problems with resource_portal_type / resourceType
parent
ce3e4426
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+17
-0
No files found.
product/ERP5/tests/testInventoryAPI.py
View file @
09ff03af
...
...
@@ -525,6 +525,23 @@ class TestInventory(InventoryAPITestCase):
self
.
assertInventoryEquals
(
100
,
resource_category_strict_membership
=
[
'product_line/level1'
])
def
test_ResourcePortalType
(
self
):
"""Tests inventory on resource_portal_type """
self
.
_makeMovement
(
quantity
=
2
,
source_value
=
None
)
self
.
_makeMovement
(
quantity
=
3
,
source_value
=
None
,
resource_value
=
self
.
portal
.
portal_categories
.
product_line
.
level1
)
assert
self
.
resource
.
portal_type
!=
'Category'
self
.
assertInventoryEquals
(
2
,
resource_portal_type
=
self
.
resource
.
portal_type
)
self
.
assertInventoryEquals
(
3
,
resource_portal_type
=
'Category'
)
# FIXME: resource_portal_type is an automatically generated related key,
# but as movements categories are not cataloged with acquisition, it does
# not work for movements acquiring resource from their parents.
# One way is to make an explicit resource_portal_type related key that
# would use stock.resource_uid (replacing the ugly 'resourceType')
def
test_PaymentCategory
(
self
):
"""Tests inventory on payment_category """
# for now, BankAccount have a product_line category, so we can use this for
...
...
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