Skip to content

Commit

Permalink
[IMP] SUITE account payment return: Improvements to suite payment ret…
Browse files Browse the repository at this point in the history
…urns
  • Loading branch information
carlosdauden committed Oct 25, 2016
1 parent 6a9f47c commit 5232871
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 50 deletions.
51 changes: 36 additions & 15 deletions account_payment_return/i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_payment_return
#
#
# Translators:
# Sergio Teruel Albert, 2015
msgid ""
msgstr ""
"Project-Id-Version: account-payment (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-15 18:00+0000\n"
"PO-Revision-Date: 2016-09-16 21:45+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-account-payment-8-0/language/es/)\n"
"POT-Creation-Date: 2016-10-25 13:17+0200\n"
"PO-Revision-Date: 2016-10-25 13:19+0200\n"
"Last-Translator: Carlos Incaser <carlos@incaser.es>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-account-payment-8-0/"
"language/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8.7.1\n"

#. module: account_payment_return
#: field:payment.return.line,amount:0
Expand Down Expand Up @@ -88,8 +90,7 @@ msgid "Date of the last message posted on the record."
msgstr "Fecha del último mensaje publicado en el registro."

#. module: account_payment_return
#: field:payment.return,display_name:0
#: field:payment.return.line,display_name:0
#: field:payment.return,display_name:0 field:payment.return.line,display_name:0
#: field:payment.return.reason,display_name:0
msgid "Display Name"
msgstr "Nombre mostrado"
Expand Down Expand Up @@ -121,6 +122,8 @@ msgid ""
"Holds the Chatter summary (number of messages, ...). This summary is "
"directly in html format in order to be inserted in kanban views."
msgstr ""
"Contiene el resumen del chatter (nº de mensajes, ...). Este resumen está "
"directamente en formato html para ser insertado en vistas kanban."

#. module: account_payment_return
#: field:payment.return,id:0 field:payment.return.line,id:0
Expand Down Expand Up @@ -149,7 +152,7 @@ msgid "Invoice has been included on a payment that has been returned later."
msgstr "La factura ha sido incluida en un pago que ha sido devuelto más tarde."

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:268
#: code:addons/account_payment_return/models/payment_return.py:275
#, python-format
msgid "Invoice: %s"
msgstr "Factura: %s"
Expand Down Expand Up @@ -214,13 +217,13 @@ msgid "Messages and communication history"
msgstr "Historial de comunicación del sitio web"

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:289
#: code:addons/account_payment_return/models/payment_return.py:296
#, python-format
msgid "Move lines: %s"
msgstr "Apuntes: %s"

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:312
#: code:addons/account_payment_return/models/payment_return.py:319
#, python-format
msgid "Move: %s"
msgstr "Asiento: %s"
Expand All @@ -234,7 +237,7 @@ msgstr "Nombre del cliente"
#: code:addons/account_payment_return/models/payment_return.py:68
#, python-format
msgid "Payment Line: %s (%s) in Payment Return: %s"
msgstr ""
msgstr "Línea de pago: %s (%s) en devolución de pago: %s"

#. module: account_payment_return
#: field:payment.return.line,move_line_ids:0
Expand Down Expand Up @@ -301,7 +304,8 @@ msgid "Reference to the reconcile object."
msgstr "Referencia al objeto de conciliación."

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:127
#: code:addons/account_payment_return/models/payment_return.py:111
#: code:addons/account_payment_return/models/payment_return.py:134
#, python-format
msgid "Return %s"
msgstr "Devolución %s"
Expand Down Expand Up @@ -347,7 +351,24 @@ msgid "Unread Messages"
msgstr "Mensajes sin leer"

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:122
#: field:payment.return,website_message_ids:0
msgid "Website Messages"
msgstr "Mensajes del sitio web"

#. module: account_payment_return
#: help:payment.return,website_message_ids:0
msgid "Website communication history"
msgstr "Historial de comunicaciones del sitio web"

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:113
#, python-format
msgid "You can not remove a payment return if state is 'Done'"
msgstr "No puede borrar una devolución de pagos en estado 'Realizado'"

#. module: account_payment_return
#: code:addons/account_payment_return/models/payment_return.py:107
#: code:addons/account_payment_return/models/payment_return.py:129
#, python-format
msgid "You must input all moves references in the payment return."
msgstr "Debes informar todas las referencias de cobro."
7 changes: 7 additions & 0 deletions account_payment_return/models/payment_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ def _prepare_invoice_returned_vals(self):
def _prepare_invoice_returned_cancel_vals(self):
return {'returned_payment': False}

@api.multi
def unlink(self):
if self.filtered(lambda x: x.state == 'done'):
raise UserError(_(
"You can not remove a payment return if state is 'Done'"))
return super(PaymentReturn, self).unlink()

@api.multi
def button_match(self):
self.mapped('line_ids').filtered(lambda x: (
Expand Down
2 changes: 2 additions & 0 deletions account_payment_return/tests/test_payment_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def test_payment_return(self):
self.assertEqual(self.invoice.residual, self.receivable_line.debit)
self.assertEqual(
len(self.receivable_line.reconcile_partial_id.line_partial_ids), 3)
with self.assertRaises(UserError):
self.payment_return.unlink()
self.payment_return.action_cancel()
self.assertEqual(self.payment_return.state, 'cancelled')
self.assertEqual(self.invoice.state, 'paid')
Expand Down
67 changes: 42 additions & 25 deletions account_payment_return_import/i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_payment_return_import
#
#
# Translators:
# Sergio Teruel Albert, 2015
msgid ""
msgstr ""
"Project-Id-Version: account-payment (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-15 18:00+0000\n"
"PO-Revision-Date: 2016-09-16 21:45+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-account-payment-8-0/language/es/)\n"
"POT-Creation-Date: 2016-10-25 13:32+0200\n"
"PO-Revision-Date: 2016-10-25 13:36+0200\n"
"Last-Translator: Carlos Incaser <carlos@incaser.es>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-account-payment-8-0/"
"language/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8.7.1\n"

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:265
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:268
#, python-format
msgid "%d transactions had already been imported and were ignored."
msgstr "%d transacciones ya han sido importadas y serán ignoradas."

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:268
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:271
#, python-format
msgid "1 transaction had already been imported and was ignored."
msgstr "1 transacción ya ha sido importada y será ignorada."

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
msgid "1. Download your Payment Return file from your bank website."
msgstr "1. Descarga tu fichero de devoluciones de cobro desde la web de tu banco."
msgstr ""
"1. Descarga tu fichero de devoluciones de cobro desde la web de tu banco."

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
msgid ""
"2. Make sure you have installed the right module to support the file format."
msgstr "2. Asegúrate de que tienes instalado el modulo correcto que soporta el formato del archivo."
msgstr ""
"2. Asegúrate de que tienes instalado el modulo correcto que soporta el "
"formato del archivo."

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
Expand All @@ -57,22 +62,25 @@ msgid ""
"Accounting journal related to the bank payment return you're importing. It "
"has be be manually chosen for payment return formats which doesn't allow "
"automatic journal detection."
msgstr "Diario contable relacionado con el archivo de devoluciones que estas importando. Se selecciona manualmente para formatos de archivos que no permiten la detección automática del diario."
msgstr ""
"Diario contable relacionado con el archivo de devoluciones que estas "
"importando. Se selecciona manualmente para formatos de archivos que no "
"permiten la detección automática del diario."

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:271
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:274
#, python-format
msgid "Already imported items"
msgstr "Elementos ya importados"

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:203
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:206
#, python-format
msgid "Can not determine journal for import."
msgstr "No puede determinarse el diario para importar."

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:199
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:202
#, python-format
msgid "Can not find the account number %s."
msgstr "No se puede encontrar el número de cuenta %s."
Expand All @@ -83,12 +91,14 @@ msgid "Cancel"
msgstr "Cancelar"

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:141
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:144
#, python-format
msgid ""
"Could not make sense of the given file.\n"
"Did you install the module to support this type of file?"
msgstr "No se pudo hacer con sentido de el archivo dado.\n¿Instalaste el modulo para soportar este tipo de archivo?"
msgstr ""
"No se pudo dar sentido al archivo dado.\n"
"¿Instaló el modulo para soportar este tipo de archivo?"

#. module: account_payment_return_import
#: field:payment.return.import,create_uid:0
Expand All @@ -110,12 +120,14 @@ msgstr "Nombre mostrado"
msgid ""
"Get you bank payment returns in electronic format from your bank and select "
"them here."
msgstr "Obtén tus devoluciones de cobros en formato electrónico desde tu banco y selecciónalas aquí."
msgstr ""
"Obtén tus devoluciones de cobros en formato electrónico desde tu banco y "
"selecciónalas aquí."

#. module: account_payment_return_import
#: field:payment.return.import,hide_journal_field:0
msgid "Hide the journal field in the view"
msgstr ""
msgstr "Oculta el campo diario en la vista"

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
Expand Down Expand Up @@ -164,6 +176,11 @@ msgstr "Última actualización de"
msgid "Last Updated on"
msgstr "Última actualización en"

#. module: account_payment_return_import
#: field:payment.return.import,match_after_import:0
msgid "Match after import"
msgstr "Casar referencias después de importar"

#. module: account_payment_return_import
#: field:payment.return.import,data_file:0
msgid "Payment Return File"
Expand All @@ -180,19 +197,19 @@ msgid "Raw import data"
msgstr ""

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:182
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:185
#, python-format
msgid "The account of this payment return is linked to another journal."
msgstr "La cuenta de esta devolución esta relacionada con otro diario."

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:150
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:153
#, python-format
msgid "This file doesn't contain any payment return."
msgstr "Este archivo no contiene ninguna devolución."

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:156
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:159
#, python-format
msgid "This file doesn't contain any transaction."
msgstr "Este archivo no contiene ninguna transacción."
Expand All @@ -203,15 +220,15 @@ msgid "XML RAW data stored for debugging/check purposes"
msgstr ""

#. module: account_payment_return_import
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:115
#: code:addons/account_payment_return_import/wizard/payment_return_import.py:118
#, python-format
msgid "You have already imported this file."
msgstr "Ya has importado este archivo. "

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
msgid "_Import"
msgstr "Importado"
msgid "Import"
msgstr "Importar"

#. module: account_payment_return_import
#: view:payment.return.import:account_payment_return_import.account_payment_return_import_view
Expand Down
3 changes: 3 additions & 0 deletions account_payment_return_import/wizard/payment_return_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _get_hide_journal_field(self):
'Payment Return File', required=True,
help='Get you bank payment returns in electronic format from your '
'bank and select them here.')
match_after_import = fields.Boolean(default=True)

@api.multi
def import_file(self):
Expand All @@ -48,6 +49,8 @@ def import_file(self):
)._import_file(data_file)
result = self.env.ref(
'account_payment_return.payment_return_action').read()[0]
if self.match_after_import:
payment_returns.button_match()
if len(payment_returns) != 1:
result['domain'] = "[('id', 'in', %s)]" % payment_returns.ids
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Import Payment Returns">
<field name="data_file"/>
<group name="file">
<field name="data_file"/>
<field name="match_after_import"/>
</group>
<field name="hide_journal_field" invisible="1"/>
<label for="journal_id"/>
<field name="journal_id"
Expand All @@ -21,7 +24,7 @@
<br/><label string= "2. Make sure you have installed the right module to support the file format."/>
<br/><label string= "3. Select the file and click 'Import'."/>
<footer>
<button name="import_file" string="_Import" type="object" class="oe_highlight"/>
<button name="import_file" string="Import" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<field name="code">MD01</field>
<field name="name">No valid Mandate</field>
</record>
<record id="unpaid_reason_MD06" model="payment.return.reason">
<field name="code">MD06</field>
<field name="name">Disputed authorised transaction</field>
</record>
<record id="unpaid_reason_MD07" model="payment.return.reason">
<field name="code">MD07</field>
<field name="name">Debtor deceased</field>
Expand Down
Loading

0 comments on commit 5232871

Please sign in to comment.