Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_timesheet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hervé Silvant - CGScop
cgscop_timesheet
Commits
8ccca4c6
Commit
8ccca4c6
authored
5 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[cgscop #129] Blocage lignes de temps + modif search view
parent
6ac1ae82
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/hr_timesheet.py
+3
-2
3 additions, 2 deletions
models/hr_timesheet.py
views/cgscop_timesheet_sheet.xml
+2
-2
2 additions, 2 deletions
views/cgscop_timesheet_sheet.xml
views/hr_timesheet.xml
+18
-5
18 additions, 5 deletions
views/hr_timesheet.xml
with
23 additions
and
9 deletions
models/hr_timesheet.py
+
3
−
2
View file @
8ccca4c6
...
...
@@ -31,6 +31,7 @@ class ScopHrTimesheet(models.Model):
readonly
=
True
,
copy
=
False
)
state
=
fields
.
Selection
([
(
'
to_report
'
,
'
A rapporter
'
),
(
'
draft
'
,
'
Brouillon
'
),
(
'
submit
'
,
'
Soumis
'
),
(
'
valid
'
,
'
Validé
'
)],
...
...
@@ -47,8 +48,8 @@ class ScopHrTimesheet(models.Model):
@api.depends
(
'
sheet_id
'
,
'
sheet_id.state
'
)
def
_compute_state
(
self
):
for
timesheet
in
self
:
if
not
timesheet
.
sheet_id
or
timesheet
.
sheet_id
.
state
==
'
draft
'
:
timesheet
.
state
=
"
draf
t
"
if
not
timesheet
.
sheet_id
:
timesheet
.
state
=
"
to_repor
t
"
else
:
timesheet
.
state
=
timesheet
.
sheet_id
.
state
...
...
This diff is collapsed.
Click to expand it.
views/cgscop_timesheet_sheet.xml
+
2
−
2
View file @
8ccca4c6
...
...
@@ -38,7 +38,7 @@
<div
class=
"oe_title"
>
<label
for=
"name"
class=
"oe_edit_only"
/>
<h1>
<field
name=
"name"
/>
<field
name=
"name"
attrs=
"{'readonly': [('can_edit','=', False), ('state','!=', 'draft')]}"
/>
</h1>
</div>
<group>
...
...
@@ -54,7 +54,7 @@
</group>
</group>
<field
name=
"can_edit"
invisible=
"1"
/>
<field
name=
"timesheet_line_ids"
widget=
"many2many"
domain=
"[('sheet_id', '=', False), ('employee_id', '=', employee_id)]"
options=
"{'reload_on_button': True}"
attrs=
"{'readonly': [('can_edit','=', False)]}"
context=
"{'form_view_ref' : 'hr_timesheet.timesheet_view_form_user'}"
>
<field
name=
"timesheet_line_ids"
widget=
"many2many"
domain=
"[('sheet_id', '=', False), ('employee_id', '=', employee_id)]"
options=
"{'reload_on_button': True}"
attrs=
"{'readonly': [('can_edit','=', False)
, ('state','!=', 'draft')
]}"
context=
"{'form_view_ref' : 'hr_timesheet.timesheet_view_form_user'}"
>
<tree
editable=
"top"
>
<field
name=
"date"
/>
<field
name=
"employee_id"
readonly=
"1"
/>
...
...
This diff is collapsed.
Click to expand it.
views/hr_timesheet.xml
+
18
−
5
View file @
8ccca4c6
...
...
@@ -14,10 +14,18 @@
<field
name=
"inherit_id"
ref=
"hr_timesheet.hr_timesheet_line_search"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"task_id"
position=
"replace"
/>
<field
name=
"project_id"
position=
"attributes"
>
<attribute
name=
"string"
>
Code activité UR
</attribute>
</field>
<field
name=
"project_id"
position=
"after"
>
<field
name=
"partner_id"
string=
"Contact"
/>
</field>
<xpath
expr=
"//filter[@name='mine']"
position=
"after"
>
<separator></separator>
<filter
domain=
"[('sheet_id', '=', False)]"
string=
"A soumettre"
name=
"no_report"
/>
<filter
domain=
"[('sheet_id', '!=', False)]"
string=
"Soumis"
name=
"submitted"
/>
<filter
domain=
"[('state', '=', 'draft')]"
string=
"En brouillon"
name=
"draft"
/>
<filter
domain=
"[('state', '=', 'submit')]"
string=
"Soumis"
name=
"submitted"
/>
<filter
domain=
"[('state', '=', 'valid')]"
string=
"Validé"
name=
"validated"
/>
</xpath>
<xpath
expr=
"//filter[@name='groupby_task']"
position=
"replace"
>
<filter
string=
"Contact"
name=
"groupby_partner"
domain=
"[]"
context=
"{'group_by':'partner_id'}"
/>
...
...
@@ -59,24 +67,29 @@
<field
name=
"inherit_id"
ref=
"hr_timesheet.hr_timesheet_line_tree"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"name"
position=
"replace"
/>
<field
name=
"date"
position=
"attributes"
>
<attribute
name=
"attrs"
>
{'readonly': [('state', 'in', ('submit', 'valid'))]}
</attribute>
</field>
<field
name=
"project_id"
position=
"attributes"
>
<attribute
name=
"options"
>
{'no_open': True, 'no_create': True}
</attribute>
<attribute
name=
"string"
>
Code activité UR
</attribute>
<attribute
name=
"attrs"
>
{'readonly': [('state', 'in', ('submit', 'valid'))]}
</attribute>
</field>
<field
name=
"project_id"
position=
"after"
>
<field
name=
"partner_id"
domain=
"[('is_company', '=', True), ('ur_id', '=', ur_id)]"
required=
"True"
class=
"td-ellipsis"
options=
"{'no_open': True, 'no_create': True}"
string=
"Contact"
/>
<field
name=
"name"
class=
"td-minwidth"
/>
<field
name=
"partner_id"
domain=
"[('is_company', '=', True), ('ur_id', '=', ur_id)]"
required=
"True"
class=
"td-ellipsis"
options=
"{'no_open': True, 'no_create': True}"
string=
"Contact"
attrs=
"{'readonly': [('state', 'in', ('submit', 'valid'))]}"
/>
<field
name=
"name"
class=
"td-minwidth"
attrs=
"{'readonly': [('state', 'in', ('submit', 'valid'))]}"
/>
</field>
<field
name=
"task_id"
position=
"attributes"
>
<attribute
name=
"invisible"
>
True
</attribute>
</field>
<field
name=
"unit_amount"
position=
"attributes"
>
<attribute
name=
"widget"
>
float_time
</attribute>
<attribute
name=
"attrs"
>
{'readonly': [('state', 'in', ('submit', 'valid'))]}
</attribute>
</field>
<field
name=
"unit_amount"
position=
"after"
>
<field
name=
"ur_financial_system_id"
options=
"{'no_open': True, 'no_create': True}"
/>
<field
name=
"ur_financial_system_id"
options=
"{'no_open': True, 'no_create': True}"
attrs=
"{'readonly': [('state', 'in', ('submit', 'valid'))]}"
/>
<field
name=
"state"
/>
<field
name=
"ur_id"
/>
<field
name=
"ur_id"
attrs=
"{'readonly': [('state', 'in', ('submit', 'valid'))]}"
/>
</field>
</field>
</record>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment