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
00a490e0
Commit
00a490e0
authored
Oct 31, 2022
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For supercoop usage improvements
parent
2804d911
Pipeline
#2475
passed with stage
in 1 minute 25 seconds
Changes
11
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
17 deletions
+41
-17
admin.py
members/admin.py
+2
-1
models.py
members/models.py
+2
-1
members-space-header.js
members_space/static/js/members-space-header.js
+1
-1
views.py
members_space/views.py
+1
-0
models.py
stock/models.py
+16
-12
views.py
stock/views.py
+4
-2
index.html
templates/members/admin/index.html
+6
-0
header.html
templates/members_space/header.html
+4
-0
index.html
templates/members_space/index.html
+1
-0
stock_movements.html
templates/stock/stock_movements.html
+2
-0
stock_movements_view.html
templates/stock/stock_movements_view.html
+2
-0
No files found.
members/admin.py
View file @
00a490e0
...
...
@@ -315,7 +315,8 @@ def admin(request):
template
=
loader
.
get_template
(
'members/admin/index.html'
)
context
=
{
'title'
:
'BDM'
,
'module'
:
'Membres'
,
'admin_binome_active'
:
getattr
(
settings
,
'ADMIN_BINOME_ACTIVE'
,
True
),}
'admin_binome_active'
:
getattr
(
settings
,
'ADMIN_BINOME_ACTIVE'
,
True
),
'other_bdm_button'
:
getattr
(
settings
,
'OTHER_BDM_BUTTON'
,
None
)}
return
HttpResponse
(
template
.
render
(
context
,
request
))
def
manage_makeups
(
request
):
...
...
members/models.py
View file @
00a490e0
...
...
@@ -608,7 +608,8 @@ class CagetteMember(models.Model):
try
:
api
.
execute
(
'res.partner'
,
'send_welcome_email'
,
[
partner_id
])
except
Exception
as
e
:
res
[
'error'
]
=
'Erreur envoie mail invitation'
res
[
'error'
]
=
'Erreur envoi mail Bienvenue'
coop_logger
.
error
(
" Erreur envoi mail Bienvenue:
%
s"
,
str
(
e
))
# from outils.common import CagetteMail
# try:
# CagetteMail.sendWelcome(f['email'])
...
...
members_space/static/js/members-space-header.js
View file @
00a490e0
...
...
@@ -55,7 +55,7 @@ $(document).ready(function() {
toggleHeader
();
});
if
(
partner_data
.
is_associated_people
===
"True"
&&
block_actions_for_attached_people
===
"True"
)
{
if
(
partner_data
.
is_associated_people
===
"True"
&&
(
block_actions_for_attached_people
===
"True"
||
always_show_pair_info
===
"True"
)
)
{
$
(
".pairs_info"
).
show
();
}
});
members_space/views.py
View file @
00a490e0
...
...
@@ -30,6 +30,7 @@ def index(request, exception=None):
'title'
:
'Espace Membre'
,
'COMPANY_LOGO'
:
getattr
(
settings
,
'COMPANY_LOGO'
,
None
),
'block_actions_for_attached_people'
:
getattr
(
settings
,
'BLOCK_ACTIONS_FOR_ATTACHED_PEOPLE'
,
True
),
'always_show_pair_info'
:
getattr
(
settings
,
'ALWAYS_SHOW_PAIR_INFO'
,
False
),
'permanent_message'
:
getattr
(
settings
,
'PERMANENT_MESSAGE_BELOW_CONNECTION_FIELDS'
,
None
),
'block_service_exchange_24h_before'
:
getattr
(
settings
,
'BLOCK_SERVICE_EXCHANGE_24H_BEFORE'
,
True
),
}
...
...
stock/models.py
View file @
00a490e0
...
...
@@ -13,11 +13,11 @@ class CagetteStock(models.Model):
errors
=
[]
if
movement_type
==
'losses'
:
location_dest_id
=
settings
.
LOSSES_LOC_ID
location_dest_id
=
getattr
(
settings
,
'LOSSES_LOC_ID'
,
None
)
elif
movement_type
==
'meals'
:
location_dest_id
=
settings
.
MEALS_LOC_ID
location_dest_id
=
getattr
(
settings
,
'MEALS_LOC_ID'
,
None
)
elif
movement_type
==
'autoconso'
:
location_dest_id
=
settings
.
AUTOCONSO_LOC_ID
location_dest_id
=
getattr
(
settings
,
'AUTOCONSO_LOC_ID'
,
None
)
else
:
errors
.
append
(
'Type de mouvement incorrect'
)
return
{
'errors'
:
errors
}
...
...
@@ -41,19 +41,23 @@ class CagetteStock(models.Model):
errors
=
[]
picking
=
False
stock_loc_id
=
getattr
(
settings
,
'STOCK_LOC_ID'
,
None
)
if
stock_loc_id
is
None
:
return
{
'errors'
:
'No stock_loc_id'
,
'picking_id'
:
None
}
# Set stock movement details according to destination
if
stock_movement_data
[
'movement_type'
]
==
'losses'
:
picking_name
=
'Pertes - '
picking_type
=
settings
.
LOSSES_PICKING_TYPE_ID
destination
=
settings
.
LOSSES_LOC_ID
picking_type
=
getattr
(
settings
,
'LOSSES_PICKING_TYPE_ID'
,
None
)
destination
=
getattr
(
settings
,
'LOSSES_LOC_ID'
,
None
)
elif
stock_movement_data
[
'movement_type'
]
==
'meals'
:
picking_name
=
'Repas Salarié - '
picking_type
=
settings
.
MEALS_PICKING_TYPE_ID
destination
=
settings
.
MEALS_LOC_ID
picking_type
=
getattr
(
settings
,
'MEALS_PICKING_TYPE_ID'
,
None
)
destination
=
getattr
(
settings
,
'MEALS_LOC_ID'
,
None
)
elif
stock_movement_data
[
'movement_type'
]
==
'autoconso'
:
picking_name
=
'Autoconsommation - '
picking_type
=
settings
.
AUTOCONSO_PICKING_TYPE_ID
destination
=
settings
.
AUTOCONSO_LOC_ID
picking_type
=
getattr
(
settings
,
'AUTOCONSO_PICKING_TYPE_ID'
,
None
)
destination
=
getattr
(
settings
,
'AUTOCONSO_LOC_ID'
,
None
)
else
:
errors
.
append
(
'Type de mouvement incorrect'
)
return
{
'errors'
:
errors
,
'picking_id'
:
picking
}
...
...
@@ -65,7 +69,7 @@ class CagetteStock(models.Model):
'company_id'
:
1
,
'name'
:
picking_name
,
'picking_type_id'
:
picking_type
,
# mouvement type
'location_id'
:
s
ettings
.
STOCK_LOC_ID
,
# movement origin
'location_id'
:
s
tock_loc_id
,
# movement origin
'location_dest_id'
:
destination
,
# movement dest
'move_lines'
:
[],
'pack_operation_ids'
:
[],
...
...
@@ -88,7 +92,7 @@ class CagetteStock(models.Model):
"product_uom"
:
p
[
'uom_id'
],
"product_uom_qty"
:
str
(
qty
),
"picking_type_id"
:
picking_type
,
"location_id"
:
s
ettings
.
STOCK_LOC_ID
,
"location_id"
:
s
tock_loc_id
,
"location_dest_id"
:
destination
,
"state"
:
"draft"
,
"scrapped"
:
False
,
...
...
@@ -102,7 +106,7 @@ class CagetteStock(models.Model):
{
"product_qty"
:
str
(
qty
),
"qty_done"
:
str
(
qty
),
"location_id"
:
s
ettings
.
STOCK_LOC_ID
,
"location_id"
:
s
tock_loc_id
,
"location_dest_id"
:
destination
,
"product_id"
:
p
[
'id'
],
"name"
:
p
[
'name'
],
...
...
stock/views.py
View file @
00a490e0
...
...
@@ -12,7 +12,8 @@ from django.shortcuts import render
def
movements_page
(
request
):
"""Page de selection de produits pour créer des mouvements de stock"""
context
=
{
'title'
:
'Mouvements de stock'
'title'
:
'Mouvements de stock'
,
'meals_loc_id'
:
getattr
(
settings
,
'MEALS_LOC_ID'
,
None
)
}
template
=
loader
.
get_template
(
'stock/stock_movements.html'
)
...
...
@@ -21,7 +22,8 @@ def movements_page(request):
def
movements_view
(
request
):
"""Page d'extraction des mouvements de stocks"""
context
=
{
'title'
:
'Mouvements de stock'
'title'
:
'Mouvements de stock'
,
'meals_loc_id'
:
getattr
(
settings
,
'MEALS_LOC_ID'
,
None
)
}
template
=
loader
.
get_template
(
'stock/stock_movements_view.html'
)
...
...
templates/members/admin/index.html
View file @
00a490e0
...
...
@@ -44,6 +44,12 @@
<span
class=
"management_type_button_icons"
><i
class=
"fas fa-wrench"
></i></span>
{#
<span
class=
"management_type_button_icons"
><i
class=
"fas fa-arrow-right"
></i></span>
#}
</button><br>
{% if other_bdm_button %}
<a
class=
"btn--primary management_type_button"
href=
"{{other_bdm_button.url}}"
target=
"_blank"
>
{{other_bdm_button.title}}
<span
class=
"management_type_button_icons"
><i
class=
"fas fa-arrow-right"
></i></span>
</a><br>
{% endif %}
</div>
</div>
</div>
...
...
templates/members_space/header.html
View file @
00a490e0
...
...
@@ -32,9 +32,13 @@
<div
class=
"pairs_info"
>
<span>
<i
class=
"fas fa-exclamation-circle"
></i>
Je suis en binôme.
{% if not block_actions_for_attached_people %}
Je peux changer les services mais pas le créneau.
{% else %}
Toutes les actions (changement de service, choix d'un rattrapage...)
ne sont faisables que sur l'espace membre du
<b>
binôme principal
</b>
.
Dans mon espace membre, les infos ne sont visibles qu'en lecture seule.
{% endif %}
</span>
</div>
...
...
templates/members_space/index.html
View file @
00a490e0
...
...
@@ -154,6 +154,7 @@
"extra_shift_done"
:
parseInt
(
"{{partnerData.extra_shift_done}}"
,
10
)
};
var
block_actions_for_attached_people
=
'{{block_actions_for_attached_people}}'
;
let
always_show_pair_info
=
'{{always_show_pair_info}}'
;
var
block_service_exchange_24h_before
=
'{{block_service_exchange_24h_before}}'
;
const
canAddShift
=
{{
canAddShift
}};
const
extension_duration
=
{{
extension_duration
}};
...
...
templates/stock/stock_movements.html
View file @
00a490e0
...
...
@@ -31,10 +31,12 @@
Autoconsommation
<span
class=
"movement_type_button_icons"
><i
class=
"fas fa-arrow-right"
></i></span>
</button><br>
{% if meals_loc_id %}
<button
type=
"button"
class=
"btn--primary movement_type_button"
id=
"meals_type_button"
>
Repas salariés
<span
class=
"movement_type_button_icons"
><i
class=
"fas fa-arrow-right"
></i></span>
</button>
{% endif %}
</div>
</div>
...
...
templates/stock/stock_movements_view.html
View file @
00a490e0
...
...
@@ -30,7 +30,9 @@
<select
class=
"select_movement_element select_movement_input"
id=
"movement_type_selector"
name=
""
>
<option
value=
""
>
-- Choisissez un type de mouvement --
</option>
<option
value=
"losses"
>
Pertes
</option>
{% if meals_loc_id %}
<option
value=
"meals"
>
Repas salariés
</option>
{% endif %}
<option
value=
"autoconso"
>
Autoconsomation
</option>
</select>
<p
class=
"select_movement_element"
>
De :
<input
type=
"text"
id=
"from"
class=
"select_movement_input"
></p>
...
...
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