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
2838892bb59e
Commit
2838892b
authored
Dec 23, 2022
by
Cédric Krier
Browse files
Display the number of selected records on xxx2Many
Closes
#11813
parent
24b69f1bd705
Pipeline
#60105
passed with stages
in 1 minute and 2 seconds
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
sao/CHANGELOG
View file @
2838892b
* Display the number of selected records on xxx2Many
Version 6.6.0 - 2022-10-31
--------------------------
* Bug fixes (see mercurial logs for details)
...
...
sao/src/view/form.js
View file @
2838892b
...
...
@@ -3626,13 +3626,15 @@
record_message
:
function
(
position
,
size
)
{
this
.
_position
=
position
;
this
.
_length
=
size
;
var
name
;
if
(
this
.
_position
)
{
name
=
this
.
_position
;
}
else
{
name
=
'
_
'
;
}
var
message
=
name
+
'
/
'
+
size
;
var
name
=
"
_
"
;
if
(
position
)
{
var
selected
=
this
.
screen
.
selected_records
.
length
;
name
=
'
'
+
position
;
if
(
selected
>
1
)
{
name
+=
'
#
'
+
selected
;
}
}
var
message
=
name
+
'
/
'
+
Sao
.
common
.
humanize
(
size
);
this
.
label
.
text
(
message
).
attr
(
'
title
'
,
message
);
this
.
_set_button_sensitive
();
},
...
...
@@ -3763,6 +3765,12 @@
).
appendTo
(
buttons
);
this
.
but_add
.
click
(
this
.
add
.
bind
(
this
));
this
.
label
=
jQuery
(
'
<span/>
'
,
{
'
class
'
:
'
badge
'
,
}).
appendTo
(
jQuery
(
'
<span/>
'
,
{
'
class
'
:
'
btn hidden-xs
'
,
}).
appendTo
(
buttons
));
this
.
but_remove
=
jQuery
(
'
<button/>
'
,
{
'
class
'
:
'
btn btn-default btn-sm
'
,
'
type
'
:
'
button
'
,
...
...
@@ -3844,5 +3852,5 @@
this
.
but_remove
.
prop
(
'
disabled
'
,
this
.
_readonly
||
this
.
_position
===
0
);
},
record_message
:
function
(
position
)
{
record_message
:
function
(
position
,
size
)
{
this
.
_position
=
position
;
...
...
@@ -3848,4 +3856,14 @@
this
.
_position
=
position
;
var
name
=
"
_
"
;
if
(
position
)
{
var
selected
=
this
.
screen
.
selected_records
.
length
;
name
=
'
'
+
position
;
if
(
selected
>
1
)
{
name
+=
'
#
'
+
selected
;
}
}
var
message
=
name
+
'
/
'
+
Sao
.
common
.
humanize
(
size
);
this
.
label
.
text
(
message
).
attr
(
'
title
'
,
message
);
this
.
_set_button_sensitive
();
},
display
:
function
()
{
...
...
tryton/CHANGELOG
View file @
2838892b
* Display the number of selected records on xxx2Many
Version 6.6.0 - 2022-10-31
--------------------------
* Bug fixes (see mercurial logs for details)
...
...
tryton/tryton/gui/window/view_form/view/form_gtk/many2many.py
View file @
2838892b
...
...
@@ -72,6 +72,9 @@
self
.
but_add
.
set_relief
(
Gtk
.
ReliefStyle
.
NONE
)
hbox
.
pack_start
(
self
.
but_add
,
expand
=
False
,
fill
=
False
,
padding
=
0
)
self
.
label
=
Gtk
.
Label
(
label
=
'(0/0)'
)
hbox
.
pack_start
(
self
.
label
,
expand
=
False
,
fill
=
False
,
padding
=
0
)
self
.
but_remove
=
Gtk
.
Button
(
can_focus
=
False
)
tooltips
.
set_tip
(
self
.
but_remove
,
_
(
'Remove selected record'
))
self
.
but_remove
.
connect
(
'clicked'
,
self
.
_sig_remove
)
...
...
@@ -273,5 +276,5 @@
not
self
.
_readonly
and
self
.
_position
))
def
record_message
(
self
,
position
,
*
args
):
def
record_message
(
self
,
position
,
size
,
*
args
):
self
.
_position
=
position
...
...
@@ -277,4 +280,10 @@
self
.
_position
=
position
name
=
str
(
position
)
if
position
else
'_'
selected
=
len
(
self
.
screen
.
selected_records
)
if
selected
>
1
:
name
+=
'#%i'
%
selected
name
=
'(%s/%s)'
%
(
name
,
common
.
humanize
(
size
))
self
.
label
.
set_text
(
name
)
self
.
_set_button_sensitive
()
def
display
(
self
):
...
...
tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py
View file @
2838892b
...
...
@@ -62,7 +62,7 @@
self
.
but_pre
.
set_relief
(
Gtk
.
ReliefStyle
.
NONE
)
hbox
.
pack_start
(
self
.
but_pre
,
expand
=
False
,
fill
=
False
,
padding
=
0
)
self
.
label
=
Gtk
.
Label
(
label
=
'(0
,
0)'
)
self
.
label
=
Gtk
.
Label
(
label
=
'(0
/
0)'
)
hbox
.
pack_start
(
self
.
label
,
expand
=
False
,
fill
=
False
,
padding
=
0
)
self
.
but_next
=
Gtk
.
Button
(
can_focus
=
False
)
...
...
@@ -510,12 +510,12 @@
def
record_message
(
self
,
position
,
size
,
*
args
):
self
.
_position
=
position
self
.
_length
=
size
if
self
.
_position
:
name
=
str
(
self
.
_position
)
else
:
name
=
'
_'
lin
e
=
'(%s/%s)'
%
(
name
,
self
.
_length
)
self
.
label
.
set_text
(
lin
e
)
name
=
str
(
position
)
if
position
else
'_'
selected
=
len
(
self
.
screen
.
selected_records
)
if
selected
>
1
:
name
+
=
'
#%i'
%
selected
nam
e
=
'(%s/%s)'
%
(
name
,
common
.
humanize
(
size
)
)
self
.
label
.
set_text
(
nam
e
)
self
.
_set_button_sensitive
()
def
display
(
self
):
...
...
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