Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tryton
Tryton
Commits
e0208968107b
Commit
e0208968
authored
Dec 30, 2022
by
Cédric Krier
Browse files
Do not select first record by default
Closes
#11814
parent
0efd47a8736f
Pipeline
#61584
passed with stages
in 12 minutes and 58 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
sao/CHANGELOG
View file @
e0208968
* Do not select first record by default
* Use ``&`` and ``|`` as boolean operator in search widget
* Use toggle button and label on translate dialog
* Support border type of images
...
...
sao/src/screen.js
View file @
e0208968
...
...
@@ -1206,11 +1206,7 @@
if
(
this
.
group
.
parent
)
{
this
.
order
=
null
;
}
if
(
group
&&
group
.
length
)
{
this
.
current_record
=
group
[
0
];
}
else
{
this
.
current_record
=
null
;
}
this
.
current_record
=
null
;
this
.
group
.
add_fields
(
fields
);
for
(
name
in
fields_views
)
{
var
views
=
fields_views
[
name
];
...
...
@@ -1313,11 +1309,7 @@
load
:
function
(
ids
,
set_cursor
=
true
,
modified
=
false
,
position
=-
1
)
{
this
.
group
.
load
(
ids
,
modified
,
position
);
this
.
current_view
.
reset
();
if
(
ids
.
length
&&
this
.
current_view
.
view_type
!=
'
calendar
'
)
{
this
.
current_record
=
this
.
group
.
get
(
ids
[
0
]);
}
else
{
this
.
current_record
=
null
;
}
this
.
current_record
=
null
;
return
this
.
display
().
then
(()
=>
{
if
(
set_cursor
)
{
this
.
set_cursor
();
...
...
@@ -1329,7 +1321,7 @@
if
(
this
.
current_record
&&
~
this
.
current_record
.
group
.
indexOf
(
this
.
current_record
))
{
}
else
if
(
this
.
group
&&
this
.
group
.
length
&&
(
this
.
current_view
.
view_type
!
=
'
calendar
'
))
{
(
this
.
current_view
.
view_type
=
=
'
form
'
))
{
this
.
current_record
=
this
.
group
[
0
];
}
else
{
this
.
current_record
=
null
;
...
...
@@ -1656,10 +1648,6 @@
// TODO delete children before parent
prm
=
this
.
group
.
delete_
(
records
);
}
var
top_record
=
records
[
0
];
var
top_group
=
top_record
.
group
;
var
idx
=
top_group
.
indexOf
(
top_record
);
var
path
=
top_record
.
get_path
(
this
.
group
);
return
prm
.
then
(()
=>
{
for
(
const
record
of
records
)
{
record
.
group
.
remove
(
record
,
remove
,
force_remove
,
false
);
...
...
@@ -1683,20 +1671,7 @@
// TODO destroy
}
}
if
(
idx
>
0
)
{
var
record
=
top_group
[
idx
-
1
];
path
.
splice
(
-
1
,
1
,
[
path
[
path
.
length
-
1
][
0
],
record
.
id
]);
}
else
{
path
.
splice
(
-
1
,
1
);
}
if
(
!
jQuery
.
isEmptyObject
(
path
))
{
prms
.
push
(
this
.
group
.
get_by_path
(
path
).
then
(
record
=>
{
this
.
current_record
=
record
;
}));
}
else
if
(
this
.
group
.
length
)
{
this
.
current_record
=
this
.
group
[
0
];
}
this
.
current_record
=
null
;
return
jQuery
.
when
.
apply
(
jQuery
,
prms
).
then
(()
=>
{
return
this
.
display
().
done
(()
=>
{
this
.
set_cursor
();
...
...
tryton/CHANGELOG
View file @
e0208968
* Do not select first record by default
* Use ``&`` and ``|`` as boolean operator in search widget
* Use toggle button and label on translate dialog
* Manage domain on id in single value list as unique
...
...
tryton/tryton/gui/window/view_form/screen/screen.py
View file @
e0208968
...
...
@@ -422,10 +422,7 @@
self
.
filter_widget
=
None
self
.
order
=
None
self
.
__group
.
add_fields
(
fields
)
if
len
(
group
):
self
.
current_record
=
group
[
0
]
else
:
self
.
current_record
=
None
self
.
current_record
=
None
for
name
,
views
in
fields_views
.
items
():
self
.
__group
.
fields
[
name
].
views
.
update
(
views
)
self
.
__group
.
exclude_field
=
self
.
exclude_field
...
...
@@ -789,11 +786,6 @@
if
not
self
.
group
.
delete
(
records
):
return
False
top_record
=
records
[
0
]
top_group
=
top_record
.
group
idx
=
top_group
.
index
(
top_record
)
path
=
top_record
.
get_path
(
self
.
group
)
for
record
in
records
:
# set current model to None to prevent __select_changed
# to save the previous_model as it can be already deleted.
...
...
@@ -815,15 +807,7 @@
record
.
parent
.
save
(
force_reload
=
False
)
record
.
destroy
()
if
idx
>
0
:
record
=
top_group
[
idx
-
1
]
path
=
path
[:
-
1
]
+
((
path
[
-
1
][
0
],
record
.
id
,),)
else
:
path
=
path
[:
-
1
]
if
path
:
self
.
current_record
=
self
.
group
.
get_by_path
(
path
)
elif
len
(
self
.
group
):
self
.
current_record
=
self
.
group
[
0
]
self
.
current_record
=
None
self
.
set_cursor
()
self
.
display
()
return
True
...
...
@@ -961,7 +945,7 @@
if
(
self
.
current_record
and
self
.
current_record
in
self
.
current_record
.
group
):
pass
elif
self
.
group
and
self
.
current_view
.
view_type
!
=
'
calendar
'
:
elif
self
.
group
and
self
.
current_view
.
view_type
=
=
'
form
'
:
self
.
current_record
=
self
.
group
[
0
]
else
:
self
.
current_record
=
None
...
...
Write
Preview
Supports
Markdown
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