Skip to content

Commit

Permalink
[FIX] compute method start with _
Browse files Browse the repository at this point in the history
[FIX] flake
  • Loading branch information
sergiocorato authored and SimoRubi committed Aug 7, 2019
1 parent 9fab6ae commit de3afd3
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 9 deletions.
219 changes: 219 additions & 0 deletions l10n_it_fatturapa_pec/i18n/l10n_it_fatturapa_pec.pot
@@ -0,0 +1,219 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_it_fatturapa_pec
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.wizard_fatturapa_send_pec_view
msgid "Cancel"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_create_uid
msgid "Created by"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_create_date
msgid "Created on"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:account.invoice,fatturapa_state:0
#: selection:fatturapa.attachment.out,state:0
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "Delivered"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_fatturapa_attachment_out_delivered_date
msgid "Delivered date"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_display_name
msgid "Display Name"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model,name:l10n_it_fatturapa_pec.model_fatturapa_attachment_out
msgid "E-invoice Export File"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_account_invoice_fatturapa_state
msgid "E-invoice State"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model,name:l10n_it_fatturapa_pec.model_mail_thread
msgid "Email Thread"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:account.invoice,fatturapa_state:0
msgid "Error"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_account_invoice_fatturapa_out_pec_filter
msgid "Fattura Elettronica Error"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_account_invoice_fatturapa_out_pec_filter
msgid "Fattura Elettronica Ready to Send"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_account_invoice_fatturapa_out_pec_filter
msgid "Fattura Elettronica State"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_id
msgid "ID"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model,name:l10n_it_fatturapa_pec.model_account_invoice
msgid "Invoice"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec___last_update
msgid "Last Modified on"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_fatturapa_attachment_out_last_sdi_response
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "Last Response from Exchange System"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_write_uid
msgid "Last Updated by"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_wizard_fatturapa_send_pec_write_date
msgid "Last Updated on"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_attachment_search_state
msgid "Ready"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:account.invoice,fatturapa_state:0
#: selection:fatturapa.attachment.out,state:0
msgid "Ready to Send"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:fatturapa.attachment.out,state:0
msgid "Recipient Error"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:fatturapa.attachment.out,state:0
msgid "Rejected (PA)"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "Reset to ready"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.wizard_fatturapa_send_pec_view
msgid "Selected files will be sent to the Exchange System"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.wizard_fatturapa_send_pec_view
msgid "Send"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.actions.act_window,name:l10n_it_fatturapa_pec.action_wizard_fatturapa_send_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.wizard_fatturapa_send_pec_view
msgid "Send Electronic Invoice"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "Send Via PEC"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:fatturapa.attachment.out,state:0
msgid "Sender Error"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_fatturapa_attachment_out_sending_user
msgid "Sending user"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: selection:account.invoice,fatturapa_state:0
#: selection:fatturapa.attachment.out,state:0
msgid "Sent"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "Sent by"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_fatturapa_attachment_out_sending_date
msgid "Sent date"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model.fields,field_description:l10n_it_fatturapa_pec.field_fatturapa_attachment_out_state
msgid "State"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.model,name:l10n_it_fatturapa_pec.model_wizard_fatturapa_send_pec
msgid "Wizard to send multiple e-invoice PEC"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: code:addons/l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py:47
#, python-format
msgid "Yo can only reset 'sender error' files"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: code:addons/l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py:247
#, python-format
msgid "You can only delete 'ready to send' files"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: code:addons/l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py:54
#, python-format
msgid "You can only send 'ready to send' files"
msgstr ""

#. module: l10n_it_fatturapa_pec
#: model:ir.ui.view,arch_db:l10n_it_fatturapa_pec.view_fatturapa_out_pec_attachment_form
msgid "on"
msgstr ""

4 changes: 2 additions & 2 deletions l10n_it_fatturapa_pec/models/account.py
Expand Up @@ -16,13 +16,13 @@ class AccountInvoice(models.Model):
('delivered', 'Delivered'),
('error', 'Error')],
string='E-invoice State',
compute='compute_fatturapa_state',
compute='_compute_fatturapa_state',
store='true',
)

@api.multi
@api.depends('fatturapa_attachment_out_id.state')
def compute_fatturapa_state(self):
def _compute_fatturapa_state(self):
mapping = {
'ready': 'ready',
'sent': 'sent',
Expand Down
5 changes: 1 addition & 4 deletions l10n_it_fatturapa_pec/models/fatturapa_attachment_out.py
Expand Up @@ -200,10 +200,7 @@ def parse_pec_response(self, message_dict):
esito_committente = root.find('EsitoCommittente')
if esito_committente is not None:
# more than one esito?
id_sdi_esito = esito_committente.find(
'IdentificativoSdI')
esito = esito_committente.find(
'Esito')
esito = esito_committente.find('Esito')
if esito is not None:
if esito.text == 'EC01':
state = 'validated'
Expand Down
7 changes: 4 additions & 3 deletions l10n_it_fatturapa_pec/models/mail_thread.py
Expand Up @@ -58,7 +58,7 @@ def message_route(self, message, message_dict, model=None, thread_id=None,
attachment_ids = self._message_post_process_attachments(
message_dict['attachments'], [], message_dict)
for attachment in self.env['ir.attachment'].browse(
[att_id for model, att_id in attachment_ids]):
[att_id for m, att_id in attachment_ids]):
if fatturapa_regex.match(attachment.name):
self.create_fatturapa_attachment_in(attachment)

Expand Down Expand Up @@ -107,11 +107,12 @@ def message_route(self, message, message_dict, model=None, thread_id=None,
message_dict['res_id'] = att.id
self.clean_message_dict(message_dict)
self.env['mail.message'].with_context(
message_create_from_mail_mail=True).create(message_dict)
message_create_from_mail_mail=True).create(
message_dict)
else:
# todo send email for non-routable pec mail
_logger.error('Can\'t route PEC E-Mail with Message-Id: {}'
.format(message.get('Message-Id')))
.format(message.get('Message-Id')))
return []

return super(MailThread, self).message_route(
Expand Down

0 comments on commit de3afd3

Please sign in to comment.