Skip to content

Commit

Permalink
FIX l10n_it_withholding_tax (OCA#416)
Browse files Browse the repository at this point in the history
Gli oggetti withholding.tax.move, withholding.tax.statement e withholding.tax.move.payment si possono eliminare dalla vista elendo dei relativi menu
  • Loading branch information
eLBati committed Oct 3, 2018
1 parent 5dfec4c commit 144fcb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions l10n_it_withholding_tax_payment/models/withholding_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax_payment/views/withholding_tax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<newline/>
<group>
<field name="line_ids" nolabel="1">
<tree>
<tree delete="false">
<field name="date"/>
<field name="partner_id"/>
<field name="withholding_tax_id"/>
Expand Down

0 comments on commit 144fcb3

Please sign in to comment.