Skip to content

Commit 5c6eda5

Browse files
SylweKraodooNextev
authored andcommitted
[IMP] l10n_it_ricevute_bancarie : no issue for archived bank accounts
1 parent f926e09 commit 5c6eda5

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

l10n_it_riba_oca/models/account.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,19 @@ def reconcile(self):
456456
return res
457457

458458
def action_riba_issue(self):
459+
for line in self:
460+
if not line.move_id.riba_partner_bank_id.active:
461+
raise UserError(
462+
self.env._(
463+
"Non è possibile emettere una riba legata ad un IBAN "
464+
"archiviato; riga: %s , contatto: %s"
465+
)
466+
% (line.name, line.partner_id.name)
467+
)
459468
ctx = dict(self.env.context)
460469
ctx.pop("active_id", None)
461470
ctx["active_ids"] = self.ids
462471
ctx["active_model"] = "account.move.line"
463-
464472
return {
465473
"type": "ir.actions.act_window",
466474
"name": "Issue RiBa",

0 commit comments

Comments
 (0)