diff --git a/account_payment_return/README.rst b/account_payment_return/README.rst new file mode 100644 index 000000000000..a5e63b948021 --- /dev/null +++ b/account_payment_return/README.rst @@ -0,0 +1,32 @@ +Payment orders returns +====================== + +Features: +--------- + + * This module implements the return of invoice payments and allows to catch several reconciled account move lines, to give back to a state where the debt is still open, and letting history of it. + + +Credits +======= + +Contributors +------------ +* 7 i TRIA +* Avanzosc +* Pedro M. Baeza +* Markus Schneider +* Sergio Teruel + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/account_payment_return/__init__.py b/account_payment_return/__init__.py new file mode 100644 index 000000000000..7d80ffe9de17 --- /dev/null +++ b/account_payment_return/__init__.py @@ -0,0 +1,28 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011-2012 7 i TRIA +# Copyright (c) 2011-2012 Avanzosc +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import models + diff --git a/account_payment_return/__openerp__.py b/account_payment_return/__openerp__.py new file mode 100644 index 000000000000..b5aa649539a6 --- /dev/null +++ b/account_payment_return/__openerp__.py @@ -0,0 +1,46 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011-2012 7 i TRIA +# Copyright (c) 2011-2012 Avanzosc +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# Copyright (c) 2015 Incaser Informatica +# Sergio Teruel +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + "name": "Account Payment Return", + "version": "1.0", + 'license': 'AGPL-3', + "depends": ['mail', 'account'], + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza', + 'website': 'http://www.serviciosbaeza.com', + 'data': [ + 'security/ir.model.access.csv', + 'security/account_payment_return_security.xml', + 'views/payment_return_view.xml', + 'data/ir_sequence_data.xml', + 'views/account_invoice_view.xml', + ], + 'demo': [], + 'installable': True, +} diff --git a/account_payment_return/data/ir_sequence_data.xml b/account_payment_return/data/ir_sequence_data.xml new file mode 100644 index 000000000000..14314cc51c56 --- /dev/null +++ b/account_payment_return/data/ir_sequence_data.xml @@ -0,0 +1,19 @@ + + + + + + Payment Return + payment.return + + + + Payment return + payment.return + R%(year)s/ + 3 + + + + + \ No newline at end of file diff --git a/account_payment_return/i18n/account_payment_return.pot b/account_payment_return/i18n/account_payment_return.pot new file mode 100644 index 000000000000..4c28697d864d --- /dev/null +++ b/account_payment_return/i18n/account_payment_return.pot @@ -0,0 +1,275 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-02-12 16:33+0000\n" +"PO-Revision-Date: 2015-02-12 16:33+0000\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: account_payment_return +#: field:payment.return.line,amount:0 +msgid "Amount" +msgstr "" + +#. module: account_payment_return +#: help:payment.return.line,amount:0 +msgid "Returned amount. Can be different from the move amount" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,journal_id:0 +msgid "Bank journal" +msgstr "" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Cancel" +msgstr "" + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Cancelled" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,company_id:0 +#: help:payment.return,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,concept:0 +msgid "Concept" +msgstr "" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Confirm" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,create_uid:0 +#: field:payment.return.line,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,create_date:0 +#: field:payment.return.line,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,partner_id:0 +msgid "Customer" +msgstr "" + +#. module: account_payment_return +#: help:payment.return,message_last_post:0 +msgid "Date of the last message posted on the record." +msgstr "" + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Done" +msgstr "" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: selection:payment.return,state:0 +msgid "Draft" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,period_id:0 +msgid "Forced period" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,id:0 +#: field:payment.return.line,id:0 +msgid "ID" +msgstr "" + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Imported" +msgstr "" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_payment_return +#: help:account.invoice,payment_returned:0 +msgid "Invoice has been included on a payment that has been returned later." +msgstr "" + +#. module: account_payment_return +#: view:account.invoice:account_payment_return.view_account_invoice_filter_return +msgid "Invoices whose payment has been returned" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,message_last_post:0 +msgid "Last Message Date" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,write_uid:0 +#: field:payment.return.line,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,write_date:0 +#: field:payment.return.line,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,line_ids:0 +msgid "Line ids" +msgstr "" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Lines" +msgstr "" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: field:payment.return,notes:0 +#: field:payment.return.line,notes:0 +msgid "Notes" +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,partner_name:0 +msgid "Partner name" +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,move_line_id:0 +msgid "Payment Reference" +msgstr "" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: field:payment.return.line,return_id:0 +msgid "Payment return" +msgstr "" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_payment_return_line +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Payment return lines" +msgstr "" + +#. module: account_payment_return +#: field:account.invoice,payment_returned:0 +msgid "Payment returned" +msgstr "" + +#. module: account_payment_return +#: model:ir.actions.act_window,name:account_payment_return.payment_return_action +#: model:ir.ui.menu,name:account_payment_return.payment_return_menu +#: view:payment.return:account_payment_return.payment_return_tree_view +msgid "Payment returns" +msgstr "" + +#. module: account_payment_return +#: help:payment.return.line,concept:0 +#: help:payment.return.line,date:0 +#: help:payment.return.line,partner_name:0 +#: help:payment.return.line,reason:0 +msgid "Readed from imported file. Only for reference." +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,reconcile_id:0 +msgid "Reconcile" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,name:0 +msgid "Reference" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,move_id:0 +msgid "Reference to the created journal entry" +msgstr "" + +#. module: account_payment_return +#: help:payment.return.line,reconcile_id:0 +msgid "Reference to the reconcile object." +msgstr "" + +#. module: account_payment_return +#: field:payment.return,date:0 +#: field:payment.return.line,date:0 +msgid "Return date" +msgstr "" + +#. module: account_payment_return +#: field:payment.return.line,reason:0 +msgid "Return reason" +msgstr "" + +#. module: account_payment_return +#: view:account.invoice:account_payment_return.view_account_invoice_filter_return +msgid "Returned" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,state:0 +msgid "State" +msgstr "" + +#. module: account_payment_return +#: model:mail.message.subtype,name:account_payment_return.mt_payment_return_state_change +msgid "Status Change" +msgstr "" + +#. module: account_payment_return +#: model:mail.message.subtype,description:account_payment_return.mt_payment_return_state_change +msgid "Status changed" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: account_payment_return +#: help:payment.return,date:0 +msgid "This date will be used as the date for the account entry." +msgstr "" + +#. module: account_payment_return +#: field:payment.return,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: account_payment_return +#: field:payment.return,website_message_ids:0 +msgid "Website Messages" +msgstr "" + +#. module: account_payment_return +#: help:payment.return,website_message_ids:0 +msgid "Website communication history" +msgstr "" + diff --git a/account_payment_return/i18n/de.po b/account_payment_return/i18n/de.po new file mode 100644 index 000000000000..7aa6845b3a20 --- /dev/null +++ b/account_payment_return/i18n/de.po @@ -0,0 +1,273 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_payment_return +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-07-17 09:22+0000\n" +"PO-Revision-Date: 2014-07-17 11:22+0100\n" +"Last-Translator: M\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#: selection:payment.return,state:0 +#. module: account_payment_return +msgid "Imported" +msgstr "Importiert" + +#: code:addons/account_payment_return/payment_return.py:126 +#. module: account_payment_return +#, python-format +msgid "You must complete all invoice references in the payment return." +msgstr "Alle Zeilen müssen mit einer Rechnung verknüpft sein." + +#: view:payment.return:0 +#. module: account_payment_return +msgid "Confirm" +msgstr "Bestätigt" + +#: view:account.invoice:0 +#. module: account_payment_return +msgid "Returned" +msgstr "Zurückgebucht" + +#: view:account.invoice:0 +#. module: account_payment_return +msgid "Invoices whose payment has been returned" +msgstr "Rechnungen deren Zahlung zurück gebucht wurde." + +#: field:payment.return,state:0 +#. module: account_payment_return +msgid "State" +msgstr "Status" + +#: field:payment.return,message_follower_ids:0 +#. module: account_payment_return +msgid "Followers" +msgstr "Followers" + +#: model:ir.actions.act_window,name:account_payment_return.payment_return_action +#: model:ir.ui.menu,name:account_payment_return.payment_return_menu +#: view:payment.return:0 +#. module: account_payment_return +msgid "Payment returns" +msgstr "Kunden Rückbuchungen" + +#: field:payment.return.line,reason:0 +#. module: account_payment_return +msgid "Return reason" +msgstr "Rückbuchungsgrund" + +#: field:payment.return,move_id:0 +#. module: account_payment_return +msgid "Reference to the created journal entry" +msgstr "Journal" + +#: field:payment.return.line,partner_name:0 +#. module: account_payment_return +msgid "Partner name" +msgstr "Kunde" + +#: field:payment.return.line,invoice_id:0 +#. module: account_payment_return +msgid "Associated invoice" +msgstr "verknüpfte Rechnung" + +#: field:payment.return,message_unread:0 +#. module: account_payment_return +msgid "Unread Messages" +msgstr "Ungelesene Nachricht" + +#: field:payment.return,lines_id:0 +#. module: account_payment_return +msgid "unknown" +msgstr "Unbekannt" + +#: field:payment.return,company_id:0 +#: help:payment.return,company_id:0 +#. module: account_payment_return +msgid "Company" +msgstr "Firma" + +#: help:payment.return.line,reconcile_id:0 +#. module: account_payment_return +msgid "Reference to the reconcile object." +msgstr "verbundenes Buchungsobjekt" + +#: help:payment.return.line,amount:0 +#. module: account_payment_return +msgid "Amount customer returns, can be different from invoice amount" +msgstr "Betrag der Rückbuchung, kann vom Rechnungsbetrag abweichen." + +#: field:payment.return,message_is_follower:0 +#. module: account_payment_return +msgid "Is a Follower" +msgstr "" + +#: model:ir.model,name:account_payment_return.model_payment_return_line +#: view:payment.return:0 +#. module: account_payment_return +msgid "Payment return lines" +msgstr "Rückbuchungszeilen" + +#: model:mail.message.subtype,description:account_payment_return.mt_payment_return_state_change +#. module: account_payment_return +msgid "Status changed" +msgstr "Status geändert" + +#: view:payment.return:0 +#: field:payment.return,notes:0 +#: field:payment.return.line,notes:0 +#. module: account_payment_return +msgid "Notes" +msgstr "Notizen" + +#: field:payment.return.line,partner_id:0 +#. module: account_payment_return +msgid "Customer" +msgstr "Kunde" + +#: model:ir.model,name:account_payment_return.model_payment_return +#: view:payment.return:0 +#: field:payment.return.line,return_id:0 +#. module: account_payment_return +msgid "Payment return" +msgstr "Kunden Zahlungsrückbuchung" + +#: field:payment.return,message_ids:0 +#. module: account_payment_return +msgid "Messages" +msgstr "" + +#: help:payment.return,message_ids:0 +#. module: account_payment_return +msgid "Messages and communication history" +msgstr "" + +#: field:account.invoice,payment_returned:0 +#. module: account_payment_return +msgid "Payment returned" +msgstr "Zahlung zurückgebucht" + +#: view:payment.return:0 +#. module: account_payment_return +msgid "Lines" +msgstr "Zeilen" + +#: field:payment.return,message_summary:0 +#. module: account_payment_return +msgid "Summary" +msgstr "Zusammenfassung" + +#: code:addons/account_payment_return/payment_return.py:125 +#. module: account_payment_return +#, python-format +msgid "Error!" +msgstr "Fehler!" + +#: field:payment.return.line,amount:0 +#. module: account_payment_return +msgid "Amount" +msgstr "Betrag" + +#: field:payment.return.line,concept:0 +#. module: account_payment_return +msgid "Concept" +msgstr "Conzept" + +#: selection:payment.return,state:0 +#. module: account_payment_return +msgid "Cancelled" +msgstr "Abgebrochen" + +#: field:payment.return,date:0 +#: field:payment.return.line,date:0 +#. module: account_payment_return +msgid "Return date" +msgstr "Rückbuchungsdatum" + +#: help:payment.return.line,concept:0 +#: help:payment.return.line,date:0 +#: help:payment.return.line,partner_name:0 +#: help:payment.return.line,reason:0 +#. module: account_payment_return +msgid "Readed from imported file. Only for reference." +msgstr "Feld für Import, nur zur Information." + +#: help:payment.return,message_unread:0 +#. module: account_payment_return +msgid "If checked new messages require your attention." +msgstr "" + +#: code:addons/account_payment_return/payment_return.py:131 +#. module: account_payment_return +#, python-format +msgid "Return %s" +msgstr "Rücklastschrift %s" + +#: field:payment.return,journal_id:0 +#. module: account_payment_return +msgid "Bank journal" +msgstr "Banken Journal" + +#: field:payment.return.line,reconcile_id:0 +#. module: account_payment_return +msgid "Reconcile" +msgstr "" + +#: field:payment.return,name:0 +#. module: account_payment_return +msgid "Reference" +msgstr "" + +#: model:mail.message.subtype,name:account_payment_return.mt_payment_return_state_change +#. module: account_payment_return +msgid "Status Change" +msgstr "Status geändert" + +#: help:account.invoice,payment_returned:0 +#. module: account_payment_return +msgid "Invoice has been included on a payment that has been returned later." +msgstr "Rechnung hat eine Zahlung die später zurück gebucht wurde." + +#: help:payment.return,message_summary:0 +#. module: account_payment_return +msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." +msgstr "" + +#: help:payment.return,date:0 +#. module: account_payment_return +msgid "This date will be used as the date for the account entry." +msgstr "" + +#: selection:payment.return,state:0 +#. module: account_payment_return +msgid "Done" +msgstr "Erledigt" + +#: model:ir.model,name:account_payment_return.model_account_invoice +#. module: account_payment_return +msgid "Invoice" +msgstr "Rechnung" + +#: field:payment.return,period_id:0 +#. module: account_payment_return +msgid "Forced period" +msgstr "" + +#: view:payment.return:0 +#. module: account_payment_return +msgid "Cancel" +msgstr "Abbrechen" + +#: view:payment.return:0 +#: selection:payment.return,state:0 +#. module: account_payment_return +msgid "Draft" +msgstr "Entwurf" + diff --git a/account_payment_return/i18n/es.po b/account_payment_return/i18n/es.po new file mode 100644 index 000000000000..563726a6041e --- /dev/null +++ b/account_payment_return/i18n/es.po @@ -0,0 +1,279 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_return +# +# Sergio Teruel Albert, 2015. +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-02-12 16:35+0000\n" +"PO-Revision-Date: 2015-02-12 17:35+0100\n" +"Last-Translator: Sergio Teruel Albert\n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" +"Language: es\n" +"X-Generator: Lokalize 1.4\n" + +#. module: account_payment_return +#: field:payment.return.line,amount:0 +msgid "Amount" +msgstr "Importe" + +#. module: account_payment_return +#: help:payment.return.line,amount:0 +msgid "Returned amount. Can be different from the move amount" +msgstr "Importe devuelto. Puede ser distinto al importe pagado" + +#. module: account_payment_return +#: field:payment.return,journal_id:0 +msgid "Bank journal" +msgstr "Diario del banco" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Cancelled" +msgstr "Cancelada" + +#. module: account_payment_return +#: field:payment.return,company_id:0 +#: help:payment.return,company_id:0 +msgid "Company" +msgstr "Compañía" + +#. module: account_payment_return +#: field:payment.return.line,concept:0 +msgid "Concept" +msgstr "Concepto" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Confirm" +msgstr "Confirmar" + +#. module: account_payment_return +#: field:payment.return,create_uid:0 +#: field:payment.return.line,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: account_payment_return +#: field:payment.return,create_date:0 +#: field:payment.return.line,create_date:0 +msgid "Created on" +msgstr "Creado el" + +#. module: account_payment_return +#: field:payment.return.line,partner_id:0 +msgid "Customer" +msgstr "Cliente" + +#. module: account_payment_return +#: help:payment.return,message_last_post:0 +msgid "Date of the last message posted on the record." +msgstr "Fecha del último mensaje publicado en el registro." + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Done" +msgstr "Realizada" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: selection:payment.return,state:0 +msgid "Draft" +msgstr "Borrador" + +#. module: account_payment_return +#: field:payment.return,period_id:0 +msgid "Forced period" +msgstr "Periodo forzado" + +#. module: account_payment_return +#: field:payment.return,id:0 +#: field:payment.return.line,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_payment_return +#: selection:payment.return,state:0 +msgid "Imported" +msgstr "Importado" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_account_invoice +msgid "Invoice" +msgstr "Factura" + +#. module: account_payment_return +#: help:account.invoice,payment_returned:0 +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 +#: view:account.invoice:account_payment_return.view_account_invoice_filter_return +msgid "Invoices whose payment has been returned" +msgstr "Facturas cuyo pago haya sido devuelto" + +#. module: account_payment_return +#: field:payment.return,message_last_post:0 +msgid "Last Message Date" +msgstr "Fecha del último mensaje" + +#. module: account_payment_return +#: field:payment.return,write_uid:0 +#: field:payment.return.line,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización de" + +#. module: account_payment_return +#: field:payment.return,write_date:0 +#: field:payment.return.line,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: account_payment_return +#: field:payment.return,line_ids:0 +msgid "Line ids" +msgstr "Line ids" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Lines" +msgstr "Líneas" + +#. module: account_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: field:payment.return,notes:0 +#: field:payment.return.line,notes:0 +msgid "Notes" +msgstr "Notas" + +#. module: account_payment_return +#: field:payment.return.line,partner_name:0 +msgid "Partner name" +msgstr "Nombre del cliente" + +#. module: account_payment_return +#: field:payment.return.line,move_line_id:0 +msgid "Payment Reference" +msgstr "Referencia de pago" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_payment_return +#: view:payment.return:account_payment_return.payment_return_form_view +#: field:payment.return.line,return_id:0 +msgid "Payment return" +msgstr "Devolución de cobro" + +#. module: account_payment_return +#: model:ir.model,name:account_payment_return.model_payment_return_line +#: view:payment.return:account_payment_return.payment_return_form_view +msgid "Payment return lines" +msgstr "Líneas de la devolución" + +#. module: account_payment_return +#: field:account.invoice,payment_returned:0 +msgid "Payment returned" +msgstr "Pago devuelto" + +#. module: account_payment_return +#: model:ir.actions.act_window,name:account_payment_return.payment_return_action +#: model:ir.ui.menu,name:account_payment_return.payment_return_menu +#: view:payment.return:account_payment_return.payment_return_tree_view +msgid "Payment returns" +msgstr "Devoluciones de cobros" + +#. module: account_payment_return +#: help:payment.return.line,concept:0 +#: help:payment.return.line,date:0 +#: help:payment.return.line,partner_name:0 +#: help:payment.return.line,reason:0 +msgid "Readed from imported file. Only for reference." +msgstr "Leído del archivo importado. Sólo como referencia." + +#. module: account_payment_return +#: field:payment.return.line,reconcile_id:0 +msgid "Reconcile" +msgstr "Conciliación" + +#. module: account_payment_return +#: field:payment.return,name:0 +msgid "Reference" +msgstr "Referencia" + +#. module: account_payment_return +#: field:payment.return,move_id:0 +msgid "Reference to the created journal entry" +msgstr "Referencia al asiento creado" + +#. module: account_payment_return +#: help:payment.return.line,reconcile_id:0 +msgid "Reference to the reconcile object." +msgstr "Referencia al objeto de conciliación." + +#. module: account_payment_return +#: field:payment.return,date:0 +#: field:payment.return.line,date:0 +msgid "Return date" +msgstr "Fecha de devolución" + +#. module: account_payment_return +#: field:payment.return.line,reason:0 +msgid "Return reason" +msgstr "Motivo de la devolución" + +#. module: account_payment_return +#: view:account.invoice:account_payment_return.view_account_invoice_filter_return +msgid "Returned" +msgstr "Devuelta" + +#. module: account_payment_return +#: field:payment.return,state:0 +msgid "State" +msgstr "Estado" + +#. module: account_payment_return +#: model:mail.message.subtype,name:account_payment_return.mt_payment_return_state_change +msgid "Status Change" +msgstr "Cambio de estado" + +#. module: account_payment_return +#: model:mail.message.subtype,description:account_payment_return.mt_payment_return_state_change +msgid "Status changed" +msgstr "Estado cambiado" + +#. module: account_payment_return +#: field:payment.return,message_summary:0 +msgid "Summary" +msgstr "Resumen" + +#. module: account_payment_return +#: help:payment.return,date:0 +msgid "This date will be used as the date for the account entry." +msgstr "Esta fecha se utilizará como fecha del asiento contable." + +#. module: account_payment_return +#: field:payment.return,message_unread:0 +msgid "Unread Messages" +msgstr "Mensajes sin leer" + +#. module: account_payment_return +#: 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 comunicación del sitio web" + + diff --git a/account_payment_return/models/__init__.py b/account_payment_return/models/__init__.py new file mode 100644 index 000000000000..c9806ec036e2 --- /dev/null +++ b/account_payment_return/models/__init__.py @@ -0,0 +1,30 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011-2012 7 i TRIA +# Copyright (c) 2011-2012 Avanzosc +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import payment_return +from . import payment_return_line +from . import account_invoice diff --git a/account_payment_return/models/account_invoice.py b/account_payment_return/models/account_invoice.py new file mode 100644 index 000000000000..d24005299217 --- /dev/null +++ b/account_payment_return/models/account_invoice.py @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from openerp import models, fields + + +class account_invoice(models.Model): + _inherit = "account.invoice" + + payment_returned = fields.Boolean('Payment returned', help='Invoice ' + 'has been included on a payment ' + 'that has been returned later.') diff --git a/account_payment_return/models/payment_return.py b/account_payment_return/models/payment_return.py new file mode 100644 index 000000000000..0f7d35fac645 --- /dev/null +++ b/account_payment_return/models/payment_return.py @@ -0,0 +1,176 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011-2012 7 i TRIA +# Copyright (c) 2011-2012 Avanzosc +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from openerp import models, fields, api, _ +from openerp.exceptions import except_orm + + +class PaymentReturn(models.Model): + _name = "payment.return" + _inherit = ['mail.thread'] + _description = 'Payment return' + _order = 'date DESC, id DESC' + + company_id = fields.Many2one( + 'res.company', 'Company', required=True, + help="Company", + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)] + }, + default=lambda self: self.env['res.company']._company_default_get( + 'account')) + date = fields.Date('Return date', + help="This date will be used as the date for the " + "account entry.", + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)]}, + default=lambda *x: fields.Date.today()) + name = fields.Char( + "Reference", size=64, required=True, + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)]}, + default=lambda self: self.env['ir.sequence'].next_by_code( + 'payment.return')) + period_id = fields.Many2one('account.period', 'Forced period', + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)] + }) + line_ids = fields.One2many('payment.return.line', 'return_id', + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)] + }) + journal_id = fields.Many2one('account.journal', 'Bank journal', + required=True, + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)] + }) + move_id = fields.Many2one('account.move', + 'Reference to the created journal entry', + states={'done': [('readonly', True)], + 'cancelled': [('readonly', True)] + }) + notes = fields.Text('Notes') + state = fields.Selection([('draft', 'Draft'), + ('imported', 'Imported'), + ('done', 'Done'), + ('cancelled', 'Cancelled')], + 'State', readonly=True, default='draft', + track_visibility='onchange') + + def _get_invoices(self, move_lines): + invoice_moves = self.env['account.move'] + for invoice_move_line in move_lines.filtered('debit'): + invoice_moves += invoice_move_line.move_id + invoices = self.env['account.invoice'].search( + [('move_id', 'in', invoice_moves.ids)]) + return invoices + + @api.one + def action_confirm(self): + move_obj = self.env['account.move'] + # Check for incomplete lines + for return_line in self.line_ids: + if not return_line.move_line_id: + raise except_orm(_('Error!'), + _("You must complete all moves " + "references in the " + "payment return.")) + + move = { + 'name': '/', + 'ref': _('Return %s') % self.name, + 'journal_id': self.journal_id.id, + 'date': self.date, + 'company_id': self.company_id.id, + } + # Period + if self.period_id: + move['period_id'] = self.period_id.id + else: + move['period_id'] = self.period_id.with_context( + company_id=self.company_id.id).find(self.date).id + move_id = move_obj.create(move) + for return_line in self.line_ids: + move_line = return_line.move_line_id + old_reconcile = move_line.reconcile_id + lines2reconcile = old_reconcile.line_id + invoices = self._get_invoices(lines2reconcile) + move_line_id = move_line.copy( + default={ + 'move_id': move_id.id, + 'ref': move['ref'], + 'date': move['date'], + 'period_id': move['period_id'], + 'journal_id': move['journal_id'], + 'debit': return_line.amount, + 'credit': 0, + }) + lines2reconcile += move_line_id + move_line_id.copy( + default={ + 'debit': 0, + 'credit': return_line.amount, + 'account_id': move_line.move_id.journal_id + .default_credit_account_id.id, + }) + # Break old reconcile and + # make a new one with at least three moves + old_reconcile.unlink() + lines2reconcile.reconcile_partial() + move_line = move_line_id + return_line.write({'reconcile_id': move_line + .reconcile_partial_id.id}) + # Mark invoice as payment refused + invoices.write({'payment_returned': True}) + + move_id.button_validate() + self.write({'state': 'done', 'move_id': move_id.id}) + return True + + @api.one + def action_cancel(self): + if not self.move_id: + return True + for return_line in self.line_ids: + if return_line.reconcile_id: + reconcile = return_line.reconcile_id + lines2reconcile = reconcile.line_partial_ids.filtered( + lambda x: x.move_id != self.move_id) + invoices = self._get_invoices(lines2reconcile) + reconcile.unlink() + if lines2reconcile: + lines2reconcile.reconcile() + return_line.write({'reconcile_id': False}) + # Remove payment refused flag on invoice + invoices.write({'payment_returned': False}) + self.move_id.button_cancel() + self.move_id.unlink() + self.write({'state': 'cancelled', 'move_id': False}) + return True + + @api.multi + def action_draft(self): + self.write({'state': 'draft'}) + return True diff --git a/account_payment_return/models/payment_return_line.py b/account_payment_return/models/payment_return_line.py new file mode 100644 index 000000000000..d470eb6a0fd5 --- /dev/null +++ b/account_payment_return/models/payment_return_line.py @@ -0,0 +1,65 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (c) 2011-2012 7 i TRIA +# Copyright (c) 2011-2012 Avanzosc +# Copyright (c) 2013 Serv. Tecnol. Avanzados +# Pedro M. Baeza +# Copyright (c) 2014 initOS GmbH & Co. KG +# Markus Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, fields, api +import openerp.addons.decimal_precision as dp + + +class PaymentReturnLine(models.Model): + _name = "payment.return.line" + _description = 'Payment return lines' + + return_id = fields.Many2one('payment.return', 'Payment return', + required=True, ondelete='cascade') + concept = fields.Char('Concept', + help="Readed from imported file. " + "Only for reference.") + reason = fields.Char('Return reason', + help="Readed from imported file. " + "Only for reference.") + move_line_id = fields.Many2one( + 'account.move.line', 'Payment Reference') + date = fields.Date('Return date', + help="Readed from imported file. " + "Only for reference.", + default=lambda *x: fields.Date.today()) + notes = fields.Text('Notes') + partner_name = fields.Char('Partner name', + help="Readed from imported file. " + "Only for reference.") + partner_id = fields.Many2one('res.partner', 'Customer', + domain="[('customer', '=', True)]") + amount = fields.Float('Amount', + help="Returned amount. Can be different from " + "the move amount", + digits_compute=dp.get_precision('Account')) + reconcile_id = fields.Many2one('account.move.reconcile', 'Reconcile', + help="Reference to the " + "reconcile object.") + + @api.onchange('move_line_id') + def onchange_move_line(self): + self.amount = self.move_line_id.credit diff --git a/account_payment_return/security/account_payment_return_security.xml b/account_payment_return/security/account_payment_return_security.xml new file mode 100644 index 000000000000..6a348e49eeb2 --- /dev/null +++ b/account_payment_return/security/account_payment_return_security.xml @@ -0,0 +1,13 @@ + + + + + + Payment return mapping company rule + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + diff --git a/account_payment_return/security/ir.model.access.csv b/account_payment_return/security/ir.model.access.csv new file mode 100644 index 000000000000..2f7ea7aea56a --- /dev/null +++ b/account_payment_return/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_payment_return","payment.return","model_payment_return","account.group_account_invoice",1,1,1,1 +"access_payment_return_line","payment.return.line","model_payment_return_line","account.group_account_invoice",1,1,1,1 diff --git a/account_payment_return/tests/__init__.py b/account_payment_return/tests/__init__.py new file mode 100644 index 000000000000..973abd98e658 --- /dev/null +++ b/account_payment_return/tests/__init__.py @@ -0,0 +1 @@ +from . import test_payment_return diff --git a/account_payment_return/tests/test_payment_return.py b/account_payment_return/tests/test_payment_return.py new file mode 100644 index 000000000000..27d64ec6226e --- /dev/null +++ b/account_payment_return/tests/test_payment_return.py @@ -0,0 +1,15 @@ +from openerp.tests.common import TransactionCase + +class TestPaymentReturn(TransactionCase): + """Tests for payment returns + + Test used to check that when doing a payment return the result will be balanced. + """ + + def setUp(self): + a = 3 + super(TestPaymentReturn, self).setUp() + self.account_invoice_model = self.registry('account.invoice') + + def test_balanced_customer_invoice(self): + cr, uid = self.cr, self.uid diff --git a/account_payment_return/views/account_invoice_view.xml b/account_payment_return/views/account_invoice_view.xml new file mode 100644 index 000000000000..122f6b8d1772 --- /dev/null +++ b/account_payment_return/views/account_invoice_view.xml @@ -0,0 +1,33 @@ + + + + + + account.invoice.form.return + account.invoice + form + + + + + + + + + + account.invoice.select.return + account.invoice + search + + + + + + + + + + + diff --git a/account_payment_return/views/payment_return_view.xml b/account_payment_return/views/payment_return_view.xml new file mode 100644 index 000000000000..6cb1ec51613f --- /dev/null +++ b/account_payment_return/views/payment_return_view.xml @@ -0,0 +1,85 @@ + + + + + payment.return.form + payment.return + form + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ + + payment.return.tree + payment.return + tree + + + + + + + + + + + + + Payment returns + payment.return + form + tree,form + + + + +
+