Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_cotisation_cg
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_cotisation_cg
Commits
2ada9ac9
Commit
2ada9ac9
authored
5 months ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[UPD] raise user error when deleting a liasse attached to a bdx
parent
c02a2cf0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/scop_liasse_fiscale.py
+16
-1
16 additions, 1 deletion
models/scop_liasse_fiscale.py
with
16 additions
and
1 deletion
models/scop_liasse_fiscale.py
+
16
−
1
View file @
2ada9ac9
# © 2021 Le Filament (<http://www.le-filament.com>)
# © 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from
odoo
import
api
,
fields
,
models
from
odoo
import
_
,
api
,
fields
,
models
from
odoo.exceptions
import
UserError
class
ScopLiasseFiscale
(
models
.
Model
):
class
ScopLiasseFiscale
(
models
.
Model
):
...
@@ -358,6 +359,20 @@ class ScopLiasseFiscale(models.Model):
...
@@ -358,6 +359,20 @@ class ScopLiasseFiscale(models.Model):
liasse
.
_compute_contribution_indus
()
liasse
.
_compute_contribution_indus
()
liasse
.
_compute_contribution_idf
()
liasse
.
_compute_contribution_idf
()
# ------------------------------------------------------
# Override ORM
# ------------------------------------------------------
def
unlink
(
self
):
for
liasse
in
self
:
if
self
.
env
[
"
scop.bordereau
"
].
search
([(
"
liasse_fiscale_id
"
,
"
=
"
,
liasse
.
id
)]):
raise
UserError
(
_
(
"
Il n
'
est pas possible de supprimer cette liasse, elle est liée
"
"
à un bordereau de cotisation.
"
)
)
return
super
().
unlink
()
# ------------------------------------------------------
# ------------------------------------------------------
# Business Function
# Business Function
# ------------------------------------------------------
# ------------------------------------------------------
...
...
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