Skip to content

Commit

Permalink
[8.0.5.1.1][l10n_id_taxform_bukti_potong_pph_common]
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevhe18 committed Oct 17, 2018
1 parent 3a92233 commit ea2e6ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion l10n_id_taxform_bukti_potong_pph_common/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Indonesia - Common Feature for Bukti Potong",
"version": "8.0.5.1.0",
"version": "8.0.5.1.1",
"category": "localization",
"website": "https://opensynergy-indonesia.com/",
"author": "OpenSynergy Indonesia",
Expand Down
10 changes: 10 additions & 0 deletions l10n_id_taxform_bukti_potong_pph_common/models/bukti_potong_pph.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,3 +583,13 @@ def onchange_period_id(self):
@api.onchange("pemotong_pajak_id")
def onchange_pemotong_pajak_id(self):
self.ttd_id = False

@api.multi
def unlink(self):
strWarning = _("You can only delete data on draft state")
for bukti_potong in self:
if bukti_potong.state != "draft":
if not self.env.context.get("force_unlink", False):
raise UserError(strWarning)
_super = super(BuktiPotongPPh, self)
_super.unlink()

0 comments on commit ea2e6ef

Please sign in to comment.