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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
11babe38
Commit
11babe38
authored
Jun 22, 2016
by
Jérome Perrin
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "catalog/stock: make stock table supporting movements indexed as several movements"
This reverts commit
a79ca4c1
.
parent
1356fe35
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
265 additions
and
61 deletions
+265
-61
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.catalog_keys.xml
...g/erp5_mysql_innodb/z_catalog_stock_list.catalog_keys.xml
+11
-0
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
...portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
+106
-0
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
...portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
+90
-0
bt5/erp5_calendar/bt/template_catalog_method_id_list
bt5/erp5_calendar/bt/template_catalog_method_id_list
+1
-0
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
...portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
+56
-59
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
...portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
+1
-2
No files found.
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.catalog_keys.xml
0 → 100644
View file @
11babe38
<catalog_method>
<item
key=
"sql_catalog_object_list"
type=
"int"
>
<value>
1
</value>
</item>
<item
key=
"_is_filtered_archive"
type=
"int"
>
<value>
1
</value>
</item>
<item
key=
"_filter_expression_archive"
type=
"str"
>
<value>
python: isMovement
</value>
</item>
</catalog_method>
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
0 → 100644
View file @
11babe38
DELETE
FROM
stock
WHERE
<
dtml
-
in
uid
>
uid
=<
dtml
-
sqlvar
sequence
-
item
type
=
"int"
><
dtml
-
if
sequence
-
end
><
dtml
-
else
>
OR
</
dtml
-
if
>
</
dtml
-
in
>
;
<
dtml
-
var
"'
\0
'"
>
<
dtml
-
let
row_list
=
"[]"
uid_dict
=
"{}"
>
<
dtml
-
in
prefix
=
"loop"
expr
=
"_.range(_.len(uid))"
>
<
dtml
-
if
"not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]"
>
<
dtml
-
in
prefix
=
"mov"
expr
=
"asMovementList[loop_item]"
no_push_item
>
<
dtml
-
if
"getDestinationUid[loop_item]"
>
<
dtml
-
call
expr
=
"uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})"
>
<
dtml
-
call
expr
=
"row_list.append([
uid[loop_item],
uid_dict[uid[loop_item]],
getExplanationUid[loop_item],
getDestinationUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationPaymentUid[loop_item],
getDestinationFunctionUid[loop_item],
getDestinationProjectUid[loop_item],
getDestinationFundingUid[loop_item],
getDestinationPaymentRequestUid[loop_item],
getSourceSectionUid[loop_item],
getSourceUid[loop_item],
getResourceUid[loop_item],
(mov_item.getInventoriatedQuantity() or 0),
isCancellationAmount[loop_item],
isAccountable[loop_item],
mov_item.getStopDate(),
mov_item.getStartDate(),
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])"
>
</
dtml
-
if
>
<
dtml
-
if
"getSourceUid[loop_item]"
>
<
dtml
-
call
expr
=
"uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})"
>
<
dtml
-
call
expr
=
"row_list.append([
uid[loop_item],
uid_dict[uid[loop_item]],
getExplanationUid[loop_item],
getSourceUid[loop_item],
getSourceSectionUid[loop_item],
getSourcePaymentUid[loop_item],
getSourceFunctionUid[loop_item],
getSourceProjectUid[loop_item],
getSourceFundingUid[loop_item],
getSourcePaymentRequestUid[loop_item],
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getResourceUid[loop_item],
-(getInventoriatedQuantity[loop_item] or 0),
isCancellationAmount[loop_item],
isAccountable[loop_item],
mov_item.getStartDate(),
mov_item.getStopDate(),
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])"
>
</
dtml
-
if
>
</
dtml
-
in
>
</
dtml
-
if
>
</
dtml
-
in
>
<
dtml
-
if
"row_list"
>
INSERT
INTO
stock
VALUES
<
dtml
-
in
prefix
=
"row"
expr
=
"row_list"
>
(
<
dtml
-
sqlvar
expr
=
"row_item[0]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[1]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[2]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[3]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[4]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[5]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[6]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[7]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[8]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[9]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[10]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[11]"
type
=
"int"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[12]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[13]"
type
=
"float"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[14]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[15]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"row_item[16]"
type
=
"datetime"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[17]"
type
=
"datetime"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[18]"
type
=
"float"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[19]"
type
=
"string"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[20]"
type
=
"string"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[21]"
type
=
"string"
optional
>
,
<
dtml
-
sqlvar
expr
=
"row_item[22]"
type
=
"string"
optional
>
)
<
dtml
-
if
sequence
-
end
><
dtml
-
else
>
,
</
dtml
-
if
>
</
dtml
-
in
>
</
dtml
-
if
>
</
dtml
-
let
>
bt5/erp5_calendar/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
0 → 100644
View file @
11babe38
<?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>
uid\r\n
getExplanationUid\r\n
getResourceUid\r\n
getInventoriatedQuantity\r\n
getSourceUid\r\n
getDestinationUid\r\n
getSourceSectionUid\r\n
getDestinationSectionUid\r\n
isMovement\r\n
isCancellationAmount\r\n
isInventoryMovement\r\n
getSourcePaymentUid\r\n
getDestinationPaymentUid\r\n
getSourceFunctionUid\r\n
getDestinationFunctionUid\r\n
getSourceProjectUid\r\n
getDestinationProjectUid\r\n
getSourceFundingUid\r\n
getDestinationFundingUid\r\n
getSourcePaymentRequestUid\r\n
getDestinationPaymentRequestUid\r\n
getSimulationState\r\n
getSourceInventoriatedTotalAssetPrice\r\n
getDestinationInventoriatedTotalAssetPrice\r\n
getStartDate\r\n
getStopDate\r\n
isAccountable\r\n
getPortalType\r\n
getVariationText\r\n
getSubVariationText\r\n
asMovementList
</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_catalog_stock_list
</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>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_calendar/bt/template_catalog_method_id_list
0 → 100644
View file @
11babe38
erp5_mysql_innodb/z_catalog_stock_list
\ No newline at end of file
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql
View file @
11babe38
...
...
@@ -10,7 +10,6 @@ WHERE
<
dtml
-
let
row_list
=
"[]"
uid_dict
=
"{}"
>
<
dtml
-
in
prefix
=
"loop"
expr
=
"_.range(_.len(uid))"
>
<
dtml
-
if
"not(isInventoryMovement[loop_item]) and isMovement[loop_item] and getResourceUid[loop_item]"
>
<
dtml
-
in
prefix
=
"mov"
expr
=
"asMovementList[loop_item]"
no_push_item
>
<
dtml
-
if
"getDestinationUid[loop_item]"
>
<
dtml
-
call
expr
=
"uid_dict.update({uid[loop_item]: uid_dict.get(uid[loop_item], -1) + 1})"
>
<
dtml
-
call
expr
=
"row_list.append([
...
...
@@ -27,11 +26,11 @@ WHERE
getSourceSectionUid[loop_item],
getSourceUid[loop_item],
getResourceUid[loop_item],
(mov_item.getInventoriatedQuantity() or 0)
,
getInventoriatedQuantity[loop_item]
,
isCancellationAmount[loop_item],
isAccountable[loop_item],
mov_item.getStopDate(),
mov_item.getStartDate(),
getStopDate[loop_item],
getStartDate[loop_item],
getDestinationInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
...
...
@@ -54,21 +53,19 @@ WHERE
getDestinationSectionUid[loop_item],
getDestinationUid[loop_item],
getResourceUid[loop_item],
-(mov_item.getInventoriatedQuantity() or 0),
-(getInventoriatedQuantity[loop_item] or 0),
isCancellationAmount[loop_item],
isAccountable[loop_item],
mov_item.getStartDate(),
mov_item.getStopDate()
,
getStartDate[loop_item],
getStopDate[loop_item]
,
getSourceInventoriatedTotalAssetPrice[loop_item],
getPortalType[loop_item],
getSimulationState[loop_item],
getVariationText[loop_item],
getSubVariationText[loop_item]])"
>
</
dtml
-
if
>
</
dtml
-
in
>
</
dtml
-
if
>
</
dtml
-
in
>
<
dtml
-
if
"row_list"
>
REPLACE
INTO
stock
...
...
product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.xml
View file @
11babe38
...
...
@@ -43,8 +43,7 @@ getStopDate\r\n
isAccountable\r\n
getPortalType\r\n
getVariationText\r\n
getSubVariationText\r\n
asMovementList
</string>
</value>
getSubVariationText
</string>
</value>
</item>
<item>
<key>
<string>
cache_time_
</string>
</key>
...
...
Jérome Perrin
@jerome
mentioned in commit
c93a52e6
·
Jun 22, 2016
mentioned in commit
c93a52e6
mentioned in commit c93a52e61c8d769162f001afdd7421dcfba5bd78
Toggle commit list
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