Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
86af2076
Commit
86af2076
authored
Nov 06, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inventory API: add some related keys, for example stock_node_title
parent
2d50c75f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
0 deletions
+151
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_explanation_translated_portal_type_from_stock.catalog_keys.xml
...nation_translated_portal_type_from_stock.catalog_keys.xml
+2
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_explanation_translated_portal_type_from_stock.xml
...related_explanation_translated_portal_type_from_stock.xml
+76
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml
...atalog/CatalogRelatedKeyTemplateItem/related_key_list.xml
+5
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_method_id_list
...5_mysql_innodb_catalog/bt/template_catalog_method_id_list
+1
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_related_key_list
...mysql_innodb_catalog/bt/template_catalog_related_key_list
+5
-0
product/ERP5/tests/testInventoryAPI.py
product/ERP5/tests/testInventoryAPI.py
+62
-0
No files found.
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_explanation_translated_portal_type_from_stock.catalog_keys.xml
0 → 100644
View file @
86af2076
<catalog_method>
</catalog_method>
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_explanation_translated_portal_type_from_stock.xml
0 → 100644
View file @
86af2076
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"SQL"
module=
"Products.ZSQLMethods.SQL"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
allow_simple_one_argument_traversal
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string>
table_0\r\n
table_1\r\n
RELATED_QUERY_SEPARATOR=" AND "
</string>
</value>
</item>
<item>
<key>
<string>
cache_time_
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
class_file_
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
class_name_
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
connection_hook
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
connection_id
</string>
</key>
<value>
<string>
erp5_sql_connection
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
z_related_explanation_translated_portal_type_from_stock
</string>
</value>
</item>
<item>
<key>
<string>
max_cache_
</string>
</key>
<value>
<int>
100
</int>
</value>
</item>
<item>
<key>
<string>
max_rows_
</string>
</key>
<value>
<int>
1000
</int>
</value>
</item>
<item>
<key>
<string>
src
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<dtml-var table_1>
.message_context = "portal_type"\n
AND
<dtml-var
table_1
>
.language =
<dtml-sqlvar
"Localizer.get_selected_language()"
type=
"string"
>
\n
\n
<dtml-var
RELATED_QUERY_SEPARATOR
>
\n
\n
<dtml-var
table_1
>
.original_message =
<dtml-var
table_0
>
.portal_type\n
AND
<dtml-var
table_0
>
.uid = stock.explanation_uid
]]>
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogRelatedKeyTemplateItem/related_key_list.xml
View file @
86af2076
...
...
@@ -33,15 +33,20 @@
<key>
related_resource_from_use_category_uid | category,category/category_uid/z_related_resource_from_use
</key>
<key>
resourceType | catalog/portal_type/z_related_resource_uid_from_stock
</key>
<key>
stock_explanation_portal_type | catalog/portal_type/z_related_explanation_from_stock
</key>
<key>
stock_explanation_reference | catalog/reference/z_related_explanation_from_stock
</key>
<key>
stock_explanation_simulation_state | catalog/simulation_state/z_related_explanation_from_stock
</key>
<key>
stock_explanation_title | catalog/title/z_related_explanation_from_stock
</key>
<key>
stock_explanation_translated_portal_type | catalog,translation/translated_message/z_related_explanation_translated_portal_type_from_stock
</key>
<key>
stock_function_category_strict_membership_uid | category/category_uid/z_related_strict_membership_function_uid_from_stock
</key>
<key>
stock_function_category_uid | category/category_uid/z_related_function_uid_from_stock
</key>
<key>
stock_funding_category_strict_membership_uid | category/category_uid/z_related_strict_membership_funding_uid_from_stock
</key>
<key>
stock_funding_category_uid | category/category_uid/z_related_funding_uid_from_stock
</key>
<key>
stock_mirror_section_category_strict_membership_uid | category/category_uid/z_related_strict_membership_mirror_section_uid_from_stock
</key>
<key>
stock_mirror_section_category_uid | category/category_uid/z_related_mirror_section_uid_from_stock
</key>
<key>
stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock
</key>
<key>
stock_node_category_strict_membership_uid | category/category_uid/z_related_strict_membership_node_uid_from_stock
</key>
<key>
stock_node_category_uid | category/category_uid/z_related_node_uid_from_stock
</key>
<key>
stock_node_title | catalog/title/z_related_node_uid_from_stock
</key>
<key>
stock_payment_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_uid_from_stock
</key>
<key>
stock_payment_category_uid | category/category_uid/z_related_payment_uid_from_stock
</key>
<key>
stock_payment_request_category_strict_membership_uid | category/category_uid/z_related_strict_membership_payment_request_uid_from_stock
</key>
...
...
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_method_id_list
View file @
86af2076
...
...
@@ -82,6 +82,7 @@ erp5_mysql_innodb/z_related_child_aggregate
erp5_mysql_innodb/z_related_children
erp5_mysql_innodb/z_related_explanation
erp5_mysql_innodb/z_related_explanation_from_stock
erp5_mysql_innodb/z_related_explanation_translated_portal_type_from_stock
erp5_mysql_innodb/z_related_function_uid_from_stock
erp5_mysql_innodb/z_related_funding_uid_from_stock
erp5_mysql_innodb/z_related_grand_parent
...
...
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/bt/template_catalog_related_key_list
View file @
86af2076
stock_explanation_title | catalog/title/z_related_explanation_from_stock
stock_explanation_reference | catalog/reference/z_related_explanation_from_stock
stock_mirror_section_title | catalog/title/z_related_mirror_section_uid_from_stock
stock_node_title | catalog/title/z_related_node_uid_from_stock
stock_explanation_translated_portal_type | catalog,translation/translated_message/z_related_explanation_translated_portal_type_from_stock
item_resource_category_uid | category/category_uid/z_related_resource_uid_from_item
stock_section_category_strict_membership_uid | category/category_uid/z_related_strict_membership_section_uid_from_stock
subject | versioning,subject/subject/z_related_subject
...
...
product/ERP5/tests/testInventoryAPI.py
View file @
86af2076
...
...
@@ -786,6 +786,18 @@ class TestInventory(InventoryAPITestCase):
self
.
assertInventoryEquals
(
0
,
node_uid
=
self
.
node
.
getUid
(),
omit_input
=
1
)
self
.
assertInventoryEquals
(
1
,
node_uid
=
self
.
node
.
getUid
(),
omit_output
=
1
)
def
test_NodeTitle
(
self
):
self
.
_makeMovement
(
quantity
=
1
)
self
.
assertInventoryEquals
(
1
,
stock_node_title
=
self
.
node
.
getTitle
())
self
.
assertInventoryEquals
(
-
1
,
stock_node_title
=
self
.
mirror_node
.
getTitle
())
def
test_MirrorSectionTitle
(
self
):
self
.
_makeMovement
(
quantity
=
1
)
self
.
assertInventoryEquals
(
1
,
stock_mirror_section_title
=
self
.
mirror_section
.
getTitle
())
self
.
assertInventoryEquals
(
-
1
,
stock_mirror_section_title
=
self
.
section
.
getTitle
())
def
test_TimeZone
(
self
):
"""
Check that getInventory support DateTime parameter with
...
...
@@ -1222,6 +1234,30 @@ class TestInventoryList(InventoryAPITestCase):
self
.
assertEqual
(
-
1
,
inventory_list
[
0
].
total_price
)
self
.
assertEqual
(
-
1
,
inventory_list
[
0
].
total_quantity
)
def
test_NodeTitle
(
self
):
getInventoryList
=
self
.
getSimulationTool
().
getInventoryList
self
.
_makeMovement
(
quantity
=
1
)
inventory_list
=
getInventoryList
(
stock_node_title
=
self
.
node
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
1
,
inventory_list
[
0
].
total_quantity
)
inventory_list
=
getInventoryList
(
stock_node_title
=
self
.
mirror_node
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
-
1
,
inventory_list
[
0
].
total_quantity
)
def
test_MirrorSectionTitle
(
self
):
getInventoryList
=
self
.
getSimulationTool
().
getInventoryList
self
.
_makeMovement
(
quantity
=
1
)
inventory_list
=
getInventoryList
(
stock_mirror_section_title
=
self
.
mirror_section
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
1
,
inventory_list
[
0
].
total_quantity
)
inventory_list
=
getInventoryList
(
stock_mirror_section_title
=
self
.
section
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
inventory_list
))
self
.
assertEqual
(
-
1
,
inventory_list
[
0
].
total_quantity
)
def
test_CurentAvailableFutureInventoryList
(
self
):
def
makeMovement
(
simulation_state
=
None
,
quantity
=
None
):
self
.
_makeMovement
(
quantity
=
quantity
,
price
=
1
,
...
...
@@ -2140,6 +2176,32 @@ class TestMovementHistoryList(InventoryAPITestCase):
omit_input
=
1
,
omit_output
=
1
)))
def
test_NodeTitle
(
self
):
self
.
_makeMovement
(
quantity
=
1
)
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
mvt_history_list
=
getMovementHistoryList
(
stock_node_title
=
self
.
node
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
mvt_history_list
))
self
.
assertEqual
(
1
,
mvt_history_list
[
0
].
total_quantity
)
mvt_history_list
=
getMovementHistoryList
(
stock_node_title
=
self
.
mirror_node
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
mvt_history_list
))
self
.
assertEqual
(
-
1
,
mvt_history_list
[
0
].
total_quantity
)
def
test_MirrorSectionTitle
(
self
):
self
.
_makeMovement
(
quantity
=
1
)
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
mvt_history_list
=
getMovementHistoryList
(
stock_mirror_section_title
=
self
.
mirror_section
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
mvt_history_list
))
self
.
assertEqual
(
1
,
mvt_history_list
[
0
].
total_quantity
)
mvt_history_list
=
getMovementHistoryList
(
stock_mirror_section_title
=
self
.
section
.
getTitle
())
self
.
assertEqual
(
1
,
len
(
mvt_history_list
))
self
.
assertEqual
(
-
1
,
mvt_history_list
[
0
].
total_quantity
)
def
test_debit_credit
(
self
):
getMovementHistoryList
=
self
.
getSimulationTool
().
getMovementHistoryList
self
.
_makeMovement
(
quantity
=-
1
,
price
=
2
,
...
...
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