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
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
ae7e28de
Commit
ae7e28de
authored
Jan 03, 2025
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py3
parents
113a5a3f
fff85e8d
Pipeline
#38828
failed with stage
in 0 seconds
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
163 additions
and
24 deletions
+163
-24
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+11
-5
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_getPackedQuantity.py
...tem/portal_skins/erp5_trade/Movement_getPackedQuantity.py
+2
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_zGetPackedQuantity.sql
...m/portal_skins/erp5_trade/Movement_zGetPackedQuantity.sql
+9
-6
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_zGetPackedQuantity.xml
...m/portal_skins/erp5_trade/Movement_zGetPackedQuantity.xml
+1
-0
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring.xml
.../PathTemplateItem/web_site_module/officejs_monitoring.xml
+1
-1
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring/app.xml
...hTemplateItem/web_site_module/officejs_monitoring/app.xml
+1
-1
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring/hateoas_appcache.xml
.../web_site_module/officejs_monitoring/hateoas_appcache.xml
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+3
-3
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.xml
...l_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.xml
+62
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.zpt
...l_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.zpt
+58
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
...core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
+1
-1
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.py
...portal_skins/erp5_xhtml_style/Base_createCloneDocument.py
+12
-5
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
ae7e28de
...
...
@@ -2007,14 +2007,20 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
editable_field_dict[select] = proxy_form.get_field(proxy_field_name, include_disabled=1)
break
# handle the case when list-scripts are ignoring `limit` - paginate for them
if limit is not None:
# handle the case when list-scripts are ignoring `limit` - paginate for them.
# Except when `limit` is explicitely set to 0, meaning no limit.
if limit:
if isinstance(limit, (tuple, list)):
start, num_items = map(int, limit)
elif isinstance(limit, int):
start, num_items = 0, limit
else:
start, num_items = 0, int(limit)
if isinstance(limit, int):
limit_int = limit
else:
limit_int = int(limit)
if limit_int == 0:
start, num_items = 0, len(search_result_iterable)
else:
start, num_items = 0, int(limit_int)
if not (is_rendering_listbox and not has_listbox_a_count_method):
# the limit was most likely taken into account thus we don't need to slice
start, num_items = 0, len(search_result_iterable)
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_getPackedQuantity.py
View file @
ae7e28de
movement
=
context
delivery_uid
=
movement
.
getExplanationUid
()
destination_uid
=
movement
.
getDestinationUid
()
resource_uid
=
movement
.
getResourceUid
()
variation_text
=
movement
.
getVariationText
()
packed_quantity
=
0
sql_list
=
movement
.
Movement_zGetPackedQuantity
(
node_uid
=
destination_uid
,
explanation_uid
=
delivery_uid
,
resource_uid
=
resource_uid
,
variation_text
=
variation_text
)
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_zGetPackedQuantity.sql
View file @
ae7e28de
SELECT
SUM
(
movement
.
quantity
)
AS
quantity
SUM
(
stock
.
quantity
)
AS
quantity
FROM
catalog
AS
container_cell
,
movement
catalog
AS
container_cell
,
stock
WHERE
movement
.
explanation_uid
=
<
dtml
-
sqlvar
explanation_uid
type
=
"int"
>
stock
.
explanation_uid
=
<
dtml
-
sqlvar
explanation_uid
type
=
"int"
>
AND
container_cell
.
has_cell_content
=
0
AND
container_cell
.
uid
=
movement
.
uid
AND
container_cell
.
uid
=
stock
.
uid
AND
(
container_cell
.
portal_type
=
"Container Cell"
OR
container_cell
.
portal_type
=
"Container Line"
)
<
dtml
-
if
resource_uid
>
AND
movement
.
resource_uid
=
<
dtml
-
sqlvar
resource_uid
type
=
"int"
>
AND
stock
.
resource_uid
=
<
dtml
-
sqlvar
resource_uid
type
=
"int"
>
</
dtml
-
if
>
<
dtml
-
if
node_uid
>
AND
stock
.
node_uid
=
<
dtml
-
sqlvar
node_uid
type
=
"int"
>
</
dtml
-
if
>
<
dtml
-
if
variation_text
>
AND
movement
.
variation_text
=
<
dtml
-
sqlvar
variation_text
type
=
"string"
>
AND
stock
.
variation_text
=
<
dtml
-
sqlvar
variation_text
type
=
"string"
>
</
dtml
-
if
>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Movement_zGetPackedQuantity.xml
View file @
ae7e28de
...
...
@@ -27,6 +27,7 @@
<item>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string>
explanation_uid\n
node_uid\n
resource_uid\n
variation_text
</string>
</value>
</item>
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring.xml
View file @
ae7e28de
...
...
@@ -104,7 +104,7 @@
<dictionary>
<item>
<key>
<string>
_defined_in_class
</string>
</key>
<value>
<
int>
1
</int
>
</value>
<value>
<
bool>
True
</bool
>
</value>
</item>
<item>
<key>
<string>
_hookname
</string>
</key>
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring/app.xml
View file @
ae7e28de
...
...
@@ -104,7 +104,7 @@
<dictionary>
<item>
<key>
<string>
_defined_in_class
</string>
</key>
<value>
<
int>
1
</int
>
</value>
<value>
<
bool>
True
</bool
>
</value>
</item>
<item>
<key>
<string>
_hookname
</string>
</key>
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_site_module/officejs_monitoring/hateoas_appcache.xml
View file @
ae7e28de
...
...
@@ -69,7 +69,7 @@
<dictionary>
<item>
<key>
<string>
_defined_in_class
</string>
</key>
<value>
<
int>
1
</int
>
</value>
<value>
<
bool>
True
</bool
>
</value>
</item>
<item>
<key>
<string>
_hookname
</string>
</key>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
ae7e28de
...
...
@@ -1214,7 +1214,7 @@
select_list
.
push
(
"
uid
"
);
if
(
gadget
.
state
.
lines
===
0
)
{
limit_options
=
undefined
;
limit_options
=
0
;
}
else
{
limit_options
=
[
gadget
.
state
.
begin_from
,
gadget
.
state
.
lines
+
1
];
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
ae7e28de
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<
string>
zope
</string
>
</value>
<value>
<
unicode>
zope
</unicode
>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
994.13949.44825.36573
</string>
</value>
<value>
<string>
1021.46754.58269.53777
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1
629394496.
1
</float>
<float>
1
735631070.5
1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.xml
0 → 100644
View file @
ae7e28de
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testInfiniteListbox
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_listbox_zuite/testInfiniteListbox.zpt
0 → 100644
View file @
ae7e28de
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test Infinite ListBox
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
A listbox with a "lines" property of "0" should not set a display limit
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/PTZuite_CommonTemplate/macros/init"
/>
<tr><td>
open
</td>
<td>
${base_url}/foo_module/ListBoxZuite_reset
</td><td></td></tr>
<tr><td>
assertTextPresent
</td>
<td>
Reset Successfully.
</td><td></td></tr>
<tr><td>
open
</td>
<td>
${base_url}/foo_module/FooModule_createObjects?start:int=1
&
num:int=100
&
create_line:int=0
</td><td></td></tr>
<tr><td>
assertTextPresent
</td>
<td>
Created Successfully.
</td><td></td></tr>
<tr><td>
open
</td>
<td>
${base_url}/foo_module/FooModule_viewFooList/listbox/ListBox_setPropertyList?field_list_method=FooModule_listAsContext
&
field_columns=id%7CID%0Aquantity%7CQuantity
&
field_lines=0
</td>
<td></td></tr>
<tr><td>
assertTextPresent
</td>
<td>
Set Successfully.
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<!-- Shortcut for full renderjs url -->
<tr><td>
store
</td>
<td>
${base_url}/web_site_module/renderjs_runner
</td>
<td>
renderjs_url
</td></tr>
<tr><td>
open
</td>
<td>
${renderjs_url}/#/foo_module
</td><td></td></tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded"
/>
<!-- Check that for the 100th created object, for which the quantity is -90,
we have '-90' displayed
-->
<tr>
<td>
assertElementPresent
</td>
<td>
//a[contains(@href, "jio_key=foo_module%2F100") and text()="-90"]
</td>
<td></td>
</tr>
<!-- Check that the listbox header counting the elements displays the correct info -->
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, "ui-table-header")]/h1[text()="Foos "]/span[text()="(100)"]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
View file @
ae7e28de
...
...
@@ -186,7 +186,7 @@ def editMatrixBox(matrixbox_field, matrixbox):
else
:
raise
ValueError
(
"Could not create cell %s"
%
str
(
cell_index_tuple
))
else
:
raise
ValueError
(
"Cell %s does not exist
%s
"
%
str
(
cell_index_tuple
))
raise
ValueError
(
"Cell %s does not exist"
%
str
(
cell_index_tuple
))
field_prefix_len
=
len
(
field_prefix
)
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.py
View file @
ae7e28de
...
...
@@ -25,8 +25,10 @@ if not (portal_type in destination.getVisibleAllowedContentTypeList() and
if
batch_mode
:
return
None
else
:
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
translateString
(
"You are not allowed to clone this object."
)})
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
translateString
(
"You are not allowed to clone this object."
),
'portal_status_level'
:
'error'
,
})
# prepare query params
kw
=
{
'portal_type'
:
translateString
(
portal_type
)}
...
...
@@ -36,9 +38,14 @@ if web_mode:
if
script
is
not
None
:
msg
=
script
(
**
form_data
)
if
msg
is
not
None
:
return
context
.
Base_redirect
(
form_id
,
editable_mode
=
editable_mode
,
keep_items
=
{
'portal_status_message'
:
msg
})
return
context
.
Base_redirect
(
form_id
,
editable_mode
=
editable_mode
,
keep_items
=
{
'portal_status_message'
:
msg
,
'portal_status_level'
:
'error'
,
}
)
# Standard cloning method
if
clone
:
...
...
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