diff --git a/l10n_it_withholding_tax_payment/README.rst b/l10n_it_withholding_tax_payment/README.rst index 5363bcf89caf..ddfdc7526464 100644 --- a/l10n_it_withholding_tax_payment/README.rst +++ b/l10n_it_withholding_tax_payment/README.rst @@ -30,11 +30,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smash it by providing detailed and welcomed feedback. Credits ======= diff --git a/l10n_it_withholding_tax_payment/__init__.py b/l10n_it_withholding_tax_payment/__init__.py index eea7f1a56c73..93a9bd4dd9b4 100644 --- a/l10n_it_withholding_tax_payment/__init__.py +++ b/l10n_it_withholding_tax_payment/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models, wizard diff --git a/l10n_it_withholding_tax_payment/__manifest__.py b/l10n_it_withholding_tax_payment/__manifest__.py index ec696ed133d7..c53dfb1252d4 100644 --- a/l10n_it_withholding_tax_payment/__manifest__.py +++ b/l10n_it_withholding_tax_payment/__manifest__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { diff --git a/l10n_it_withholding_tax_payment/data/sequence.xml b/l10n_it_withholding_tax_payment/data/sequence.xml index d24fed743a4a..575e77e62c87 100644 --- a/l10n_it_withholding_tax_payment/data/sequence.xml +++ b/l10n_it_withholding_tax_payment/data/sequence.xml @@ -1,14 +1,12 @@ - - + - - Withholding Tax Move Payment Number - withholding.tax.move.payment - - WTMP/ - - - - - \ No newline at end of file + + Withholding Tax Move Payment Number + withholding.tax.move.payment + + WTMP/ + + + + diff --git a/l10n_it_withholding_tax_payment/models/__init__.py b/l10n_it_withholding_tax_payment/models/__init__.py index f1eb1a813a88..bab6fc4aaa04 100644 --- a/l10n_it_withholding_tax_payment/models/__init__.py +++ b/l10n_it_withholding_tax_payment/models/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/l10n_it_withholding_tax_payment/models/withholding_tax.py b/l10n_it_withholding_tax_payment/models/withholding_tax.py index 6ce7186d1e43..2f77cc019fac 100644 --- a/l10n_it_withholding_tax_payment/models/withholding_tax.py +++ b/l10n_it_withholding_tax_payment/models/withholding_tax.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -157,3 +157,10 @@ def move_payment_confirmed(self): # Wt move set to due for wt_move in move.line_ids: wt_move.action_paid() + + @api.multi + def unlink(self): + for payment in self: + if payment.state != 'draft': + raise ValidationError(_("You can only delete draft payments")) + return super(WithholdingTaxMovePayment, self).unlink() diff --git a/l10n_it_withholding_tax_payment/views/withholding_tax.xml b/l10n_it_withholding_tax_payment/views/withholding_tax.xml index 8d3b3271038a..3d37a6ff73fa 100644 --- a/l10n_it_withholding_tax_payment/views/withholding_tax.xml +++ b/l10n_it_withholding_tax_payment/views/withholding_tax.xml @@ -75,7 +75,7 @@ - + diff --git a/l10n_it_withholding_tax_payment/wizard/__init__.py b/l10n_it_withholding_tax_payment/wizard/__init__.py index 742aa3ce5989..2c842296c4e5 100644 --- a/l10n_it_withholding_tax_payment/wizard/__init__.py +++ b/l10n_it_withholding_tax_payment/wizard/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/l10n_it_withholding_tax_payment/wizard/create_move_payment.py b/l10n_it_withholding_tax_payment/wizard/create_move_payment.py index 92574bfb4921..b15a2b230b6a 100644 --- a/l10n_it_withholding_tax_payment/wizard/create_move_payment.py +++ b/l10n_it_withholding_tax_payment/wizard/create_move_payment.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright © 2015 Alessandro Camilli () +# Copyright 2015 Alessandro Camilli () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/l10n_it_withholding_tax_payment/workflow.xml b/l10n_it_withholding_tax_payment/workflow.xml index bb3a78dc51e0..dd4bad1b2e1e 100644 --- a/l10n_it_withholding_tax_payment/workflow.xml +++ b/l10n_it_withholding_tax_payment/workflow.xml @@ -1,48 +1,46 @@ - - - - + + + - - withholding.tax.move.payment.wkf - withholding.tax.move.payment - True - + + withholding.tax.move.payment.wkf + withholding.tax.move.payment + True + - - - draft - function - - move_payment_to_draft() - - True - + + + draft + function + + move_payment_to_draft() + + True + - - - confirmed - function - - move_payment_confirmed() - - + + + confirmed + function + + move_payment_confirmed() + + - - - - - confirmed - - + + + + + confirmed + + - - - - cancel - - + + + + cancel + - +