Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
bc637211
Commit
bc637211
authored
Apr 11, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2814 : Prevent validating binome without having filled parent data
parent
fd7f5d1e
Pipeline
#2097
passed with stage
in 1 minute 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
inscriptions.js
members/static/js/inscriptions.js
+18
-4
No files found.
members/static/js/inscriptions.js
View file @
bc637211
...
...
@@ -230,9 +230,11 @@ function _really_save_new_coop(email, fname, lname, cap, pm, cn, bc, msex) {
function
store_new_coop
(
event
)
{
event
.
preventDefault
();
var
errors
=
[],
bc
=
''
,
// barcode may not be present
msex
=
''
;
// sex may not be present
msex
=
''
,
// sex may not be present
active_asso_area
=
$
(
'#associate_area .choice_active'
);
// need to ckeck if associated data are available
// 1- Un coop avec le meme mail ne doit pas exister dans odoo (dans base intermediaire, le cas est géré par l'erreur à l'enregistrement)
let
email
=
$
(
'input[name="email"]'
).
val
()
.
trim
(),
...
...
@@ -257,6 +259,19 @@ function store_new_coop(event) {
}
}
if
(
active_asso_area
.
length
>
0
)
{
// If user click as if a "binôme" is beeing created, data about parent member must exist
let
associated_data_ok
=
false
;
if
(
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"new_member_choice"
&&
$
(
'#new_member_input'
).
val
().
trim
().
length
>
0
)
||
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"existing_member_choice"
&&
$
(
'#existing_member_choice_action .chosen_associate div.member'
).
length
>
0
)
)
{
associated_data_ok
=
true
;
}
if
(
associated_data_ok
===
false
)
errors
.
push
(
"Le membre 'titulaire' du binôme n'est pas défini"
);
}
$
.
ajax
({
url
:
'/members/exists/'
+
email
,
dataType
:
'json'
})
...
...
@@ -294,8 +309,7 @@ function store_new_coop(event) {
}
}
});
}
}
...
...
@@ -670,7 +684,7 @@ function display_possible_members() {
if
(
member
.
id
==
$
(
this
).
attr
(
'member_id'
))
{
selected_associate
=
member
;
var
member_button
=
'<div member_id="'
+
member
.
id
+
'"
>'
+
member
.
barcode_base
+
' - '
+
member
.
name
+
'</button
>'
;
var
member_button
=
'<div member_id="'
+
member
.
id
+
'"
class="member">'
+
member
.
barcode_base
+
' - '
+
member
.
name
+
'</div
>'
;
$
(
'.chosen_associate'
).
html
(
member_button
);
$
(
'.chosen_associate_area'
).
show
();
...
...
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