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
Le Filament
Confédération Générale des SCOP
cgscop_timesheet
Commits
f79e4cec
Commit
f79e4cec
authored
5 years ago
by
Rémi - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
Ajout droits par UR sur timesheet
parent
4d89f72a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
models/hr_timesheet.py
+9
-0
9 additions, 0 deletions
models/hr_timesheet.py
security/security_rules.xml
+23
-0
23 additions, 0 deletions
security/security_rules.xml
with
32 additions
and
0 deletions
models/hr_timesheet.py
+
9
−
0
View file @
f79e4cec
...
...
@@ -7,6 +7,9 @@ from odoo import models, fields, api
class
ScopHrTimesheet
(
models
.
Model
):
_inherit
=
"
account.analytic.line
"
def
_default_ur
(
self
):
return
self
.
env
[
'
res.company
'
].
_ur_default_get
()
name
=
fields
.
Char
(
required
=
False
)
cgscop_timesheet_code_id
=
fields
.
Many2one
(
related
=
'
project_id.cgscop_timesheet_code_id
'
,
...
...
@@ -15,6 +18,12 @@ class ScopHrTimesheet(models.Model):
ur_financial_system_id
=
fields
.
Many2one
(
comodel_name
=
'
ur.financial.system
'
,
string
=
'
Dispositif Financier
'
)
ur_id
=
fields
.
Many2one
(
'
union.regionale
'
,
string
=
'
Union Régionale
'
,
index
=
True
,
on_delete
=
'
restrict
'
,
default
=
_default_ur
)
# ------------------------------------------------------
# OnChange Functions
...
...
This diff is collapsed.
Click to expand it.
security/security_rules.xml
+
23
−
0
View file @
f79e4cec
...
...
@@ -28,5 +28,28 @@
<field
name=
"groups"
eval=
"[(6, 0, [ref('cgscop_partner.group_cg_administrator')])]"
/>
<field
eval=
"True"
name=
"global"
/>
</record>
<record
id=
"analytic_line_ur_rule"
model=
"ir.rule"
>
<field
name=
"name"
>
Analytic line UR rule
</field>
<field
name=
"model_id"
ref=
"analytic.model_account_analytic_line"
/>
<field
name=
"groups"
eval=
"[(6, 0, [ref('base.group_user')])]"
/>
<field
eval=
"True"
name=
"global"
/>
<field
name=
"domain_force"
>
[('ur_id','=',user.company_id.ur_id.id)]
</field>
</record>
<record
id=
"analytic_rule_administrator_ur"
model=
"ir.rule"
>
<field
name=
"name"
>
Analytic line UR administrator rule
</field>
<field
name=
"model_id"
ref=
"analytic.model_account_analytic_line"
/>
<field
name=
"domain_force"
>
[(1,'=',1)]
</field>
<field
name=
"groups"
eval=
"[(6, 0, [ref('cgscop_partner.group_cg_administrator')])]"
/>
<field
eval=
"True"
name=
"global"
/>
</record>
<record
id=
"analytic.analytic_line_comp_rule"
model=
"ir.rule"
>
<field
name=
"name"
>
Analytic line multi company rule
</field>
<field
name=
"model_id"
ref=
"model_account_analytic_line"
/>
<field
eval=
"True"
name=
"global"
/>
<field
name=
"active"
eval=
"False"
/>
</record>
</data>
</odoo>
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