Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
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
0
Merge Requests
0
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
odoo
Commits
a5f1a125
Commit
a5f1a125
authored
Sep 10, 2021
by
François C.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cron cloture automatique des services FTOP du jour
parent
b9a6dc52
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
3 deletions
+46
-3
fr.po
intercoop_addons/coop_membership/i18n/fr.po
+1
-1
fr.po
intercoop_addons/coop_shift/i18n/fr.po
+1
-1
__openerp__.py
lacagette_addons/lacagette_membership/__openerp__.py
+1
-1
ir_cron.xml
lacagette_addons/lacagette_membership/data/ir_cron.xml
+14
-0
__init__.py
lacagette_addons/lacagette_membership/models/__init__.py
+1
-0
shift_shift.py
lacagette_addons/lacagette_membership/models/shift_shift.py
+28
-0
No files found.
intercoop_addons/coop_membership/i18n/fr.po
View file @
a5f1a125
...
@@ -660,7 +660,7 @@ msgstr "Remplacé"
...
@@ -660,7 +660,7 @@ msgstr "Remplacé"
#: code:addons/coop_membership/models/shift_shift.py:81
#: code:addons/coop_membership/models/shift_shift.py:81
#, python-format
#, python-format
msgid "Shift Cloture"
msgid "Shift Cloture"
msgstr "Clô
l
turer le service"
msgstr "Clôturer le service"
#. module: coop_membership
#. module: coop_membership
#: model:ir.ui.view,arch_db:coop_membership.view_shift_form_inherit
#: model:ir.ui.view,arch_db:coop_membership.view_shift_form_inherit
...
...
intercoop_addons/coop_shift/i18n/fr.po
View file @
a5f1a125
...
@@ -2297,7 +2297,7 @@ msgstr "Service"
...
@@ -2297,7 +2297,7 @@ msgstr "Service"
#: code:addons/coop_shift/model/shift_shift.py:434
#: code:addons/coop_shift/model/shift_shift.py:434
#, python-format
#, python-format
msgid "Shift Cloture"
msgid "Shift Cloture"
msgstr "Clô
l
turer le service"
msgstr "Clôturer le service"
#. module: coop_shift
#. module: coop_shift
#: model:ir.actions.act_window,name:coop_shift.action_res_partner_point_counter_view_ftop
#: model:ir.actions.act_window,name:coop_shift.action_res_partner_point_counter_view_ftop
...
...
lacagette_addons/lacagette_membership/__openerp__.py
View file @
a5f1a125
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
# always loaded
# always loaded
'data'
:
[
'data'
:
[
'data/ir_cron.xml'
,
'data/ir_cron.xml'
,
'ir_config_parameter_data.xml'
'
data/
ir_config_parameter_data.xml'
],
],
'installable'
:
True
,
'installable'
:
True
,
}
}
lacagette_addons/lacagette_membership/data/ir_cron.xml
View file @
a5f1a125
...
@@ -31,4 +31,17 @@
...
@@ -31,4 +31,17 @@
<field
name=
"active"
eval=
"False"
/>
<field
name=
"active"
eval=
"False"
/>
<field
name=
"priority"
>
1
</field>
<field
name=
"priority"
>
1
</field>
</record>
</record>
<record
forcecreate=
"True"
id=
"cron_close_ftop_shifts"
model=
"ir.cron"
>
<field
name=
"name"
>
Daily close FTOP shifts
</field>
<field
name=
"user_id"
ref=
"base.user_root"
/>
<field
name=
"interval_number"
>
1
</field>
<field
name=
"interval_type"
>
days
</field>
<field
name=
"numbercall"
>
-1
</field>
<field
name=
"doall"
eval=
"True"
/>
<field
name=
"model"
eval=
"'shift.shift'"
/>
<field
name=
"function"
eval=
"'run_close_today_ftop_shifts'"
/>
<field
name=
"args"
eval=
"'()'"
/>
<field
name=
"active"
eval=
"False"
/>
<field
name=
"priority"
>
1
</field>
</record>
</odoo>
</odoo>
\ No newline at end of file
lacagette_addons/lacagette_membership/models/__init__.py
View file @
a5f1a125
...
@@ -3,3 +3,4 @@
...
@@ -3,3 +3,4 @@
from
.
import
res_partner
from
.
import
res_partner
from
.
import
shift_registration
from
.
import
shift_registration
from
.
import
shift_counter_event
from
.
import
shift_counter_event
from
.
import
shift_shift
lacagette_addons/lacagette_membership/models/shift_shift.py
0 → 100644
View file @
a5f1a125
# -*- coding: utf-8 -*-
from
openerp
import
_
,
api
,
models
,
fields
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
class
ShiftShift
(
models
.
Model
):
_inherit
=
'shift.shift'
@api.model
def
run_close_today_ftop_shifts
(
self
):
"""Method called by cron task"""
sql
=
"""
SELECT id
FROM shift_shift
WHERE TO_CHAR(date_begin, 'YYYY-MM-DD') = TO_CHAR(now(), 'YYYY-MM-DD')
AND active = true AND state = 'confirm'
"""
self
.
env
.
cr
.
execute
(
sql
)
shift_ids
=
self
.
env
.
cr
.
fetchall
()
if
len
(
shift_ids
)
>
0
:
for
s
in
self
.
env
[
'shift.shift'
]
.
search
([(
'id'
,
'in'
,
shift_ids
)]):
s
.
button_makeupok
()
s
.
button_done
()
# _logger.info('Traité avec action makeupok et done sur shift ' + str(s.id))
\ No newline at end of file
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