Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ap_sale_project
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
Arbre et Paysage
ap_sale_project
Commits
d59817c6
Commit
d59817c6
authored
3 years ago
by
jordan
Browse files
Options
Downloads
Patches
Plain Diff
[update] disable create intervention when sale_order is not draft
parent
ec295690
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/sale_project.py
+5
-0
5 additions, 0 deletions
models/sale_project.py
with
5 additions
and
0 deletions
models/sale_project.py
+
5
−
0
View file @
d59817c6
...
@@ -176,6 +176,10 @@ class SaleProject(models.Model):
...
@@ -176,6 +176,10 @@ class SaleProject(models.Model):
# ------------------------------------------------------
# ------------------------------------------------------
def
action_interventions
(
self
):
def
action_interventions
(
self
):
tree_view
=
self
.
env
.
ref
(
"
ap_sale_project.sale_intervention_tree
"
).
id
tree_view
=
self
.
env
.
ref
(
"
ap_sale_project.sale_intervention_tree
"
).
id
if
self
.
sale_order_id
.
state
==
'
draft
'
:
create
=
True
else
:
create
=
False
return
{
return
{
"
type
"
:
"
ir.actions.act_window
"
,
"
type
"
:
"
ir.actions.act_window
"
,
"
name
"
:
"
Interventions
"
,
"
name
"
:
"
Interventions
"
,
...
@@ -189,6 +193,7 @@ class SaleProject(models.Model):
...
@@ -189,6 +193,7 @@ class SaleProject(models.Model):
],
],
"
domain
"
:
[(
"
project_id
"
,
"
=
"
,
self
.
id
)],
"
domain
"
:
[(
"
project_id
"
,
"
=
"
,
self
.
id
)],
"
context
"
:
{
"
context
"
:
{
"
create
"
:
create
,
"
default_project_id
"
:
self
.
id
,
"
default_project_id
"
:
self
.
id
,
"
search_default_group_by_intervention_type
"
:
True
,
"
search_default_group_by_intervention_type
"
:
True
,
},
},
...
...
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