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
4184d5c7
Commit
4184d5c7
authored
3 years ago
by
Etienne Freiss
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_cooperatic' into 2253-new-binome
parents
9b019d61
75bca762
dev_cooperatic
…
#5673_bug_calendrier_echange_service
3832-makeups-and-member-status-update
4081
4444_improve_presence_recording
4709
4778-reception-dont-get-finished-orders
4809-remove-shelf-value-col-to-reduce-server-load
4880-rapports-reception-faux
4950-douchage-appli-reception
5474-et-5462-Voir-les-rattrapages-choisis-dans-admin-bdm-et-corrige-lenteur-affichage-admin-rattrapages
5641-reception-trier-a-la-maj-prix-dans-ordre-de-pointage-quantites
6286_bug_encaissement_souscription_cheque_espece
6813-marking-parent-gone-when-unpairing-binom-does-not-unsuscribe-parent-from-shift-template
6832--certaines-absences-engendrent-une-erreur
7723-7559-change-purchase-order-workflow-django-side
7731-third-party-side-brinks-pos-export-not-working
7747-inventaire-par-article
7800-make-test-solution-work
7848-cannot-validate-qty-with-decimal-on-kg-product
7918_bug_quantites_stade_demande_prix
adaptation_supercafoutch
adaptation_supercoop
adaptation_supercoop_supercafoutch
adpatation_chouette
assistance_import_article
coop_dev_necessitant_modules_bdm_odoo_modifies
correctif_nb_rattrapages_creation_binome_avec_ajout_automatique_au_point_negatif
dev_principale
export_capital_detenu
fix_bug_process_picking
fusion_custom_graoucoop
graoucoop_backup
graoucoop_prod
graoucoop_tmp
hot_fix_shelf_labels_auto_print
impression_etiquettes_rayons
integration_lien_precommandes_dans_espace_membre
lacagette_prod
local_branch
meal-voucher-and-label-printer-software-bug
migration-v12
pour_graoucoop_prod
pour_version_prod_cagette
refonte_espace_membre_sc
retouches_tickets_supercoop
sc-setup-stock-app
supercafoutch-preprod
supercafoutch-prod-20221003
supercafoutch_prod
ticket_4146
supercafoutch_20250120_151258
supercafoutch_20250120_150340
supercafoutch_20240909_080630
supercafoutch_20240609_115709
supercafoutch_20240212_082431
supercafoutch_20240107_181851
supercafoutch_prod_until_240107
supercafoutch-prod-20221003
supercafoutch-230911
supercafoutch-230824
supercafoutch-230823
supercafoutch-230823-the-true-one
migration-v12-tag
lacagette_20240310_074751
lacagette_20240107_122554
lacagette_20240107_120916
graoucoop_20240609_122614
cagette_testtag
cagette-230814
cagette-230630
2 merge requests
!130
2253 new binome
,
!164
Intégration des dév. Cooperatic pour la Cagette
Pipeline
#1868
passed with stage
in 1 minute 30 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
21 deletions
+34
-21
models.py
envelops/models.py
+1
-1
bdm_index.js
members/static/js/admin/bdm_index.js
+1
-1
urls.py
members/urls.py
+1
-1
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+3
-3
models.py
shifts/models.py
+24
-14
views.py
shifts/views.py
+3
-0
index.html
templates/members/admin/index.html
+1
-1
No files found.
envelops/models.py
View file @
4184d5c7
...
...
@@ -59,7 +59,7 @@ class CagetteEnvelops(models.Model):
# Get first invoice for which amount being paid <= amount left to pay in invoice
for
invoice_item
in
invoice_res
:
if
int
(
float
(
data
[
'amount'
])
*
100
)
<=
int
(
float
(
invoice_item
[
'residual_signed'
])
*
100
):
invoice
=
invoice_ite
invoice
=
invoice_ite
m
if
invoice
is
None
:
res
[
'error'
]
=
'The amount is too high for the invoices found for this partner.'
...
...
This diff is collapsed.
Click to expand it.
members/static/js/admin/bdm_index.js
View file @
4184d5c7
...
...
@@ -4,7 +4,7 @@ $(document).ready(function() {
$
(
".page_content"
).
show
();
let
location
=
window
.
location
.
href
;
let
location
=
window
.
location
.
href
.
replace
(
/
\/
$/
,
''
)
;
$
(
'.management_type_button'
).
on
(
'click'
,
function
()
{
if
(
this
.
id
==
'manage_makeups_button'
)
{
...
...
This diff is collapsed.
Click to expand it.
members/urls.py
View file @
4184d5c7
...
...
@@ -55,7 +55,7 @@ urlpatterns = [
url
(
r'^save_partner_info$'
,
views
.
save_partner_info
),
# BDM - members admin
url
(
r'^admin$'
,
admin
.
admin
),
url
(
r'^admin
/?
$'
,
admin
.
admin
),
url
(
r'^admin/manage_makeups$'
,
admin
.
manage_makeups
),
url
(
r'^admin/manage_shift_registrations$'
,
admin
.
manage_shift_registrations
),
url
(
r'^get_makeups_members$'
,
admin
.
get_makeups_members
),
...
...
This diff is collapsed.
Click to expand it.
members_space/static/js/members-space-shifts-exchange.js
View file @
4184d5c7
...
...
@@ -20,7 +20,7 @@ function can_exchange_shifts() {
* @returns boolean
*/
function
should_select_makeup
()
{
return
partner_data
.
makeups_to_do
==
0
&&
(
partner_data
.
is_associated_people
===
"False"
||
(
partner_data
.
is_associated_people
===
"True"
&&
block_actions_for_attached_people
===
"False"
)
);
return
partner_data
.
makeups_to_do
>
0
||
(
partner_data
.
makeups_to_do
>
0
&&
partner_data
.
is_associated_people
===
"True"
&&
block_actions_for_attached_people
===
"False"
);
}
/**
...
...
@@ -175,7 +175,7 @@ function init_shifts_list() {
if
(
partner_data
.
associated_partner_id
===
"False"
&&
partner_data
.
parent_id
===
"False"
)
{
shift_line_template
.
find
(
'.affect_associate_registered'
).
hide
();
}
else
{
shift_line_template
.
find
(
'.affect_associate_registered'
).
attr
(
'id'
,
'shi
d
t_id_'
+
shift
.
id
);
shift_line_template
.
find
(
'.affect_associate_registered'
).
attr
(
'id'
,
'shi
f
t_id_'
+
shift
.
id
);
if
(
shift
.
associate_registered
===
"both"
)
{
shift_line_template
.
find
(
'.affect_associate_registered'
).
text
(
"Les deux"
);
}
else
if
(
shift
.
associate_registered
===
"partner"
)
{
...
...
@@ -237,7 +237,7 @@ function init_shifts_list() {
modal_template
.
find
(
"#shift_associate"
).
text
(
partner_data
.
associated_partner_name
);
}
else
{
modal_template
.
find
(
"#shift_partner"
).
text
(
partner_data
.
associated_partner_
name
);
modal_template
.
find
(
"#shift_partner"
).
text
(
partner_data
.
name
);
modal_template
.
find
(
"#shift_associate"
).
text
(
partner_data
.
parent_name
);
}
...
...
This diff is collapsed.
Click to expand it.
shifts/models.py
View file @
4184d5c7
...
...
@@ -178,20 +178,30 @@ class CagetteShift(models.Model):
def
affect_shift
(
self
,
data
):
"""Affect shift to partner, his associate or both"""
response
=
None
cond
=
[[
'partner_id'
,
'='
,
int
(
data
[
'idPartner'
])],
[
'id'
,
'='
,
int
(
data
[
'idShiftRegistration'
])]]
fields
=
[
'id'
]
try
:
print
(
cond
)
shit_to_affect
=
self
.
o_api
.
search_read
(
'shift.registration'
,
cond
,
fields
,
1
)
print
(
shit_to_affect
)
if
(
len
(
shit_to_affect
)
==
1
):
shift_res
=
shit_to_affect
[
0
]
print
(
shift_res
)
fieldsDatas
=
{
"associate_registered"
:
data
[
'affected_partner'
]}
response
=
self
.
o_api
.
update
(
'shift.registration'
,
[
shift_res
[
'id'
]],
fieldsDatas
)
except
Exception
as
e
:
coop_logger
.
error
(
"Reopen shift :
%
s"
,
str
(
e
))
# partner_id can be 'associated_people' one, which is never use as shift partner_id reference
# So, let's first retrieved data about the res.partner involved
cond
=
[[
'id'
,
'='
,
int
(
data
[
'idPartner'
])]]
fields
=
[
'parent_id'
]
partner
=
self
.
o_api
.
search_read
(
'res.partner'
,
cond
,
fields
,
1
)
if
partner
:
if
partner
[
0
][
'parent_id'
]:
partner_id
=
partner
[
0
][
'parent_id'
][
0
]
else
:
partner_id
=
int
(
data
[
'idPartner'
])
cond
=
[[
'partner_id'
,
'='
,
partner_id
],
[
'id'
,
'='
,
int
(
data
[
'idShiftRegistration'
])]]
fields
=
[
'id'
]
try
:
# make sure there is coherence between shift.registration id and partner_id (to avoid forged request)
shit_to_affect
=
self
.
o_api
.
search_read
(
'shift.registration'
,
cond
,
fields
,
1
)
if
(
len
(
shit_to_affect
)
==
1
):
shift_res
=
shit_to_affect
[
0
]
fieldsDatas
=
{
"associate_registered"
:
data
[
'affected_partner'
]}
response
=
self
.
o_api
.
update
(
'shift.registration'
,
[
shift_res
[
'id'
]],
fieldsDatas
)
except
Exception
as
e
:
coop_logger
.
error
(
"Model affect shift :
%
s"
,
str
(
e
))
else
:
coop_logger
.
error
(
"Model affect shift nobody found :
%
s"
,
str
(
cond
))
return
response
def
cancel_shift
(
self
,
idsRegisteur
):
...
...
This diff is collapsed.
Click to expand it.
shifts/views.py
View file @
4184d5c7
...
...
@@ -239,11 +239,14 @@ def affect_shift(request):
if
Verification
.
verif_token
(
request
.
POST
.
get
(
'verif_token'
),
int
(
request
.
POST
.
get
(
'idPartner'
)))
is
True
:
cs
=
CagetteShift
()
if
'idShiftRegistration'
in
request
.
POST
and
'affected_partner'
in
request
.
POST
:
# if request is made by associated people, idPartner is it's id, not "master" res.partner
# it's will be handled in model's method (affect_shift)
data
=
{
"idPartner"
:
int
(
request
.
POST
[
'idPartner'
]),
"idShiftRegistration"
:
int
(
request
.
POST
[
'idShiftRegistration'
]),
"affected_partner"
:
request
.
POST
[
'affected_partner'
],
}
st_r_id
=
None
try
:
st_r_id
=
cs
.
affect_shift
(
data
)
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
templates/members/admin/index.html
View file @
4184d5c7
...
...
@@ -22,7 +22,7 @@
<div
class=
"management_type_buttons txtcenter"
>
<button
type=
"button"
class=
"btn--primary management_type_button"
id=
"manage_makeups_button"
>
Gestion des rattra
gap
es
Gestion des rattra
pag
es
<span
class=
"management_type_button_icons"
><i
class=
"fas fa-arrow-right"
></i></span>
</button><br>
<button
type=
"button"
class=
"btn--primary management_type_button"
id=
"manage_shift_registrations_button"
>
...
...
This diff is collapsed.
Click to expand it.
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