Skip to content

Commit

Permalink
[IMP] l10n_it_fatturapa_pec state related source strings (OCA#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
primes2h authored and Borruso committed Oct 15, 2021
1 parent a0851b2 commit c325d8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class FatturaPAAttachmentOut(models.Model):
def reset_to_ready(self):
for att in self:
if att.state != 'sender_error':
raise UserError(_("You can only reset 'sender error' files."))
raise UserError(
_("You can only reset files in 'Sender Error' state.")
)
att.state = 'ready'

@api.model
Expand All @@ -62,7 +64,9 @@ def send_via_pec(self):
self.env.user.company_id.sdi_channel_id.check_first_pec_sending()
states = self.mapped('state')
if set(states) != set(['ready']):
raise UserError(_("You can only send 'Ready to Send' files."))
raise UserError(
_("You can only send files in 'Ready to Send' state.")
)
for att in self:
mail_message = self.env['mail.message'].create({
'model': self._name,
Expand Down Expand Up @@ -240,6 +244,6 @@ def unlink(self):
for att in self:
if att.state != 'ready':
raise UserError(_(
"You can only delete 'ready to send' files."
"You can only delete files in 'Ready to Send' state."
))
return super(FatturaPAAttachmentOut, self).unlink()

0 comments on commit c325d8c

Please sign in to comment.