From 1b10df90256a18164dd457cac9886971baead19d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 30 Apr 2016 01:46:34 +0200 Subject: [PATCH 001/165] Start to port bank-payment to v9 (with a lot of improvements) during the Sorrento Code sprint 2016 Improvements include: - full re-organisation of modules and big re-organisation of the code - simplification of the code related to the fact that support for direct debit is now in t he base module, not added by an optional module account_direct_debit (module was removed) - new design of the wizard to select move lines to pay - support for non-SEPA file transfer- - support for German direct debit SEPA files (fixes bug #129) - remove workflow of payment.order - add wizard of selection of move lines to pay --- account_payment_order/README.rst | 82 +++ account_payment_order/__init__.py | 3 + account_payment_order/__openerp__.py | 41 ++ .../data/payment_mode_type.xml | 15 + account_payment_order/data/payment_seq.xml | 38 ++ account_payment_order/demo/payment_demo.xml | 34 ++ account_payment_order/i18n/es.po | 488 +++++++++++++++++ account_payment_order/i18n/fr.po | 488 +++++++++++++++++ account_payment_order/i18n/nl.po | 488 +++++++++++++++++ account_payment_order/i18n/pt_BR.po | 489 ++++++++++++++++++ account_payment_order/i18n/sl.po | 489 ++++++++++++++++++ .../migrations/8.0.0.1.166/pre-migrate.py | 37 ++ account_payment_order/models/__init__.py | 10 + .../models/account_invoice.py | 110 ++++ account_payment_order/models/account_move.py | 13 + .../models/account_move_line.py | 68 +++ .../models/account_payment_line.py | 137 +++++ .../models/account_payment_mode.py | 135 +++++ .../models/account_payment_order.py | 440 ++++++++++++++++ .../models/bank_payment_line.py | 145 ++++++ account_payment_order/models/res_bank.py | 22 + .../security/ir.model.access.csv | 4 + .../security/payment_security.xml | 39 ++ .../static/description/icon.png | Bin 0 -> 9455 bytes account_payment_order/test/data.yml | 28 + .../test/test_partial_payment_refunded.yml | 134 +++++ .../test/test_partial_payment_transfer.yml | 252 +++++++++ .../test/test_payment_method.yml | 159 ++++++ .../views/account_invoice_view.xml | 62 +++ .../views/account_move_line.xml | 28 + .../views/account_payment_line.xml | 69 +++ .../views/account_payment_mode.xml | 66 +++ .../views/account_payment_order.xml | 163 ++++++ .../views/bank_payment_line.xml | 83 +++ account_payment_order/views/ir_attachment.xml | 32 ++ .../views/payment_order_create_view.xml | 23 + account_payment_order/wizard/__init__.py | 4 + .../account_invoice_payment_line_multi.py | 20 + ...ccount_invoice_payment_line_multi_view.xml | 31 ++ .../wizard/account_payment_line_create.py | 152 ++++++ .../account_payment_line_create_view.xml | 65 +++ 41 files changed, 5186 insertions(+) create mode 100644 account_payment_order/README.rst create mode 100644 account_payment_order/__init__.py create mode 100644 account_payment_order/__openerp__.py create mode 100644 account_payment_order/data/payment_mode_type.xml create mode 100644 account_payment_order/data/payment_seq.xml create mode 100644 account_payment_order/demo/payment_demo.xml create mode 100644 account_payment_order/i18n/es.po create mode 100644 account_payment_order/i18n/fr.po create mode 100644 account_payment_order/i18n/nl.po create mode 100644 account_payment_order/i18n/pt_BR.po create mode 100644 account_payment_order/i18n/sl.po create mode 100644 account_payment_order/migrations/8.0.0.1.166/pre-migrate.py create mode 100644 account_payment_order/models/__init__.py create mode 100644 account_payment_order/models/account_invoice.py create mode 100644 account_payment_order/models/account_move.py create mode 100644 account_payment_order/models/account_move_line.py create mode 100644 account_payment_order/models/account_payment_line.py create mode 100644 account_payment_order/models/account_payment_mode.py create mode 100644 account_payment_order/models/account_payment_order.py create mode 100644 account_payment_order/models/bank_payment_line.py create mode 100644 account_payment_order/models/res_bank.py create mode 100644 account_payment_order/security/ir.model.access.csv create mode 100644 account_payment_order/security/payment_security.xml create mode 100644 account_payment_order/static/description/icon.png create mode 100644 account_payment_order/test/data.yml create mode 100644 account_payment_order/test/test_partial_payment_refunded.yml create mode 100644 account_payment_order/test/test_partial_payment_transfer.yml create mode 100644 account_payment_order/test/test_payment_method.yml create mode 100644 account_payment_order/views/account_invoice_view.xml create mode 100644 account_payment_order/views/account_move_line.xml create mode 100644 account_payment_order/views/account_payment_line.xml create mode 100644 account_payment_order/views/account_payment_mode.xml create mode 100644 account_payment_order/views/account_payment_order.xml create mode 100644 account_payment_order/views/bank_payment_line.xml create mode 100644 account_payment_order/views/ir_attachment.xml create mode 100644 account_payment_order/views/payment_order_create_view.xml create mode 100644 account_payment_order/wizard/__init__.py create mode 100644 account_payment_order/wizard/account_invoice_payment_line_multi.py create mode 100644 account_payment_order/wizard/account_invoice_payment_line_multi_view.xml create mode 100644 account_payment_order/wizard/account_payment_line_create.py create mode 100644 account_payment_order/wizard/account_payment_line_create_view.xml diff --git a/account_payment_order/README.rst b/account_payment_order/README.rst new file mode 100644 index 00000000000..b752fee40c9 --- /dev/null +++ b/account_payment_order/README.rst @@ -0,0 +1,82 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +===================== +Account Payment Order +===================== + +This module adds support for payment orders and debit orders. + +Installation +============ + +This module depends on: + +* account_payment_partner +* base_iban +* document + +This modules is part of the OCA/bank-payment suite. + +Configuration +============= + +This module adds several options on Payment Modes, cf Accounting > Configuration > Management > Payment Modes. + +Usage +===== + +You can create a Payment Order via the menu Accounting > Payments > Payment Orders and then select the move lines to pay. + +You can create a Debit Order via the menu Accounting > Payments > Debit Orders and then select the move lines to debit. + +This module also adds a button *Add to Payment Order* on supplier invoices and a button *Add to Debit Order* on customer invoices. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/173/9.0 + +Known issues / Roadmap +====================== + + * no known issues + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Stéphane Bidoul +* Alexis de Lattre +* Pedro M. Baeza +* Adrien Peiffer +* Stefan Rijnhart +* Laurent Mignon +* Alexandre Fayolle +* Danimar Ribeiro +* Erwin van der Ploeg +* Raphaël Valyi +* Sandy Carter +* Angel Moya + +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_order/__init__.py b/account_payment_order/__init__.py new file mode 100644 index 00000000000..408a6001bda --- /dev/null +++ b/account_payment_order/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import models +from . import wizard diff --git a/account_payment_order/__openerp__.py b/account_payment_order/__openerp__.py new file mode 100644 index 00000000000..60f7dda5a65 --- /dev/null +++ b/account_payment_order/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# © 2009 EduSense BV () +# © 2011-2013 Therp BV () +# © 2013-2014 ACSONE SA (). +# © 2014-2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Akretion (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Account Payment Order', + 'version': '9.0.1.0.0', + 'license': 'AGPL-3', + 'author': "ACSONE SA/NV, " + "Therp BV, " + "Serv. Tecnol. Avanzados - Pedro M. Baeza, " + "Akretion, " + "Odoo Community Association (OCA)", + 'website': 'https://github.com/OCA/bank-payment', + 'category': 'Banking addons', + 'depends': [ + 'account_payment_partner', + 'base_iban', # for manual_bank_tranfer + 'document', # to see the attachments on payment.order + ], + 'data': [ + 'security/payment_security.xml', + 'security/ir.model.access.csv', + 'wizard/account_payment_line_create_view.xml', + 'wizard/account_invoice_payment_line_multi_view.xml', + 'views/account_payment_mode.xml', + 'views/account_payment_order.xml', + 'views/account_payment_line.xml', + 'views/bank_payment_line.xml', + 'views/account_move_line.xml', + 'views/ir_attachment.xml', + 'views/account_invoice_view.xml', + 'data/payment_seq.xml', + ], + 'demo': ['demo/payment_demo.xml'], + 'installable': True, +} diff --git a/account_payment_order/data/payment_mode_type.xml b/account_payment_order/data/payment_mode_type.xml new file mode 100644 index 00000000000..876778e624b --- /dev/null +++ b/account_payment_order/data/payment_mode_type.xml @@ -0,0 +1,15 @@ + + + + + + Manual Bank Transfer + BANKMAN + + + payment + + + diff --git a/account_payment_order/data/payment_seq.xml b/account_payment_order/data/payment_seq.xml new file mode 100644 index 00000000000..9f89b95afb6 --- /dev/null +++ b/account_payment_order/data/payment_seq.xml @@ -0,0 +1,38 @@ + + + + + + + + + Bank Payment Line + bank.payment.line + L + 5 + + + + + Payment Line + account.payment.line + P + 5 + + + + + Payment Order + account.payment.order + PAY + 4 + + + + + + diff --git a/account_payment_order/demo/payment_demo.xml b/account_payment_order/demo/payment_demo.xml new file mode 100644 index 00000000000..1644a907afd --- /dev/null +++ b/account_payment_order/demo/payment_demo.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_payment_order/i18n/es.po b/account_payment_order/i18n/es.po new file mode 100644 index 00000000000..1e8e5d91a4d --- /dev/null +++ b/account_payment_order/i18n/es.po @@ -0,0 +1,488 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-08 00:46+0000\n" +"PO-Revision-Date: 2016-04-06 00:14+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17 +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31 +#, python-format +msgid "" +"A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, " +"so it is not valid." +msgstr "Un BIC válido contiene 8 u 11 caracteres. El BIC '%s' contiene %d caracteres, por lo que no es válido." + +#. module: account_banking_payment_export +#: field:payment.mode,active:0 field:payment.mode.type,active:0 +msgid "Active" +msgstr "Activo" + +#. module: account_banking_payment_export +#: field:bank.payment.line,amount_currency:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Amount" +msgstr "Importe" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_bank +msgid "Bank" +msgstr "Banco" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Cuentas de banco" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +#: field:payment.line,bank_line_id:0 +msgid "Bank Payment Line" +msgstr "Línea de pago bancario" + +#. module: account_banking_payment_export +#: field:bank.payment.line,name:0 +msgid "Bank Payment Line Ref" +msgstr "Ref. de la línea de pago bancario" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action +#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: field:payment.order,bank_line_ids:0 +msgid "Bank Payment Lines" +msgstr "Líneas de pago bancario" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Código" + +#. module: account_banking_payment_export +#: field:bank.payment.line,communication:0 +msgid "Communication" +msgstr "Comunicación" + +#. module: account_banking_payment_export +#: field:bank.payment.line,company_id:0 +msgid "Company" +msgstr "Compañía" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_uid:0 field:payment.manual,create_uid:0 +#: field:payment.mode.type,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_date:0 field:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "Cobro" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "Adeudo directo (cobro)" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Due" +msgstr "Vencimiento" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +msgid "Due Date" +msgstr "Fecha de vencimiento" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Entry Information" +msgstr "Información del asiento" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:152 +#, python-format +msgid "Entry Lines" +msgstr "Líneas de pago" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:74 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "Tipo de exportación" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "General Information" +msgstr "Información General" + +#. module: account_banking_payment_export +#: field:payment.mode,group_lines:0 +msgid "Group lines in payment orders" +msgstr "Agrupar líneas en las órdenes de pago" + +#. module: account_banking_payment_export +#: field:bank.payment.line,id:0 field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_payment_export +#: help:payment.mode,group_lines:0 +msgid "" +"If this mark is checked, the payment order lines will be grouped when validating the payment order before exporting the bank file. The grouping will be done only if the following fields matches:\n" +"* Partner\n" +"* Currency\n" +"* Destination Bank Account\n" +"* Communication Type (structured, free)\n" +"* Payment Date\n" +"(other modules can set additional fields to restrict the grouping.)" +msgstr "Si esta casilla está marcada, las líneas de las órdenes de pago serán agrupadas cuando se valide la orden de pago antes de la exportación al archivo bancario. La agrupación se realizará sólo si los siguientes campos casan:\n* Empresa\n* Moneda\n* Cuenta bancaria destino\n* Tipo de comunicacion (estructurada, libre)\n* Fecha de pago\n(otros módulo pueden establecer campos adicionales para restringir la agrupación.)" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Information" +msgstr "Información" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_invoice +msgid "Invoice" +msgstr "Factura" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Journal Entry" +msgstr "Asiento contable" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Apuntes contables" + +#. module: account_banking_payment_export +#: field:payment.mode,default_journal_ids:0 +#: field:payment.order.create,journal_ids:0 +msgid "Journals Filter" +msgstr "Filtro de diarios" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "Keep empty for using all journals" +msgstr "Dejar vacío para usar todos los diarios" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_uid:0 field:payment.manual,write_uid:0 +#: field:payment.mode.type,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_date:0 field:payment.manual,write_date:0 +#: field:payment.mode.type,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Line grouping" +msgstr "Agrupación de líneas" + +#. module: account_banking_payment_export +#: field:payment.mode,default_invoice:0 field:payment.order.create,invoice:0 +msgid "Linked to an Invoice or Refund" +msgstr "Vinculado a una factura o factura rectificativa" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "Pago manual" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Move" +msgstr "Asiento" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +#: field:payment.order.create,move_date:0 +msgid "Move Date" +msgstr "Fecha del asiento" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +#: field:payment.mode,note:0 +msgid "Note" +msgstr "Descripción" + +#. module: account_banking_payment_export +#: field:bank.payment.line,order_id:0 +msgid "Order" +msgstr "Orden" + +#. module: account_banking_payment_export +#: field:payment.mode.type,payment_order_type:0 +msgid "Order type" +msgstr "Tipo de orden" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Owner Account" +msgstr "Cuenta propietario" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Partner Bank Account" +msgstr "Cuenta bancaria" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "Pago" + +#. module: account_banking_payment_export +#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type +#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type +msgid "Payment Export Types" +msgstr "Tipos de exportación de pagos" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Line" +msgstr "Línea de pago" + +#. module: account_banking_payment_export +#: field:bank.payment.line,payment_line_ids:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Lines" +msgstr "Líneas de pago" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Tipo del modo de pago" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Orden de pago" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:59 +#, python-format +msgid "Payment Order Export" +msgstr "Exportación de la orden de pago" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:245 +#, python-format +msgid "Payment Orders" +msgstr "Órdenes de pago" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "Tipo de pago" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "Tipos de pago" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "Tipo de la orden de pago" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Asistente de pago" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "Ejecute la orden de pago manualmente (fuera del sistema), y pulse en Aceptar cuando la haya tramitado correctamente." + +#. module: account_banking_payment_export +#: field:payment.mode,default_populate_results:0 +#: field:payment.order.create,populate_results:0 +msgid "Populate Results Directly" +msgstr "Incluir los resultados directamente" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +msgid "Related Payment Lines" +msgstr "Líneas de pago relacionadas" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Select Move Lines to Pay - Default Values" +msgstr "Selección de los apuntes - Valores por defecto" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "Seleccione el tipo de exportación de pago para el modo de pago." + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "Seleccione el asistente de pago para los pagos de este tipo. Déjelo vacío para un procesado manual." + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "Seleccionable en operaciones de compra" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "Seleccionable en operaciones de venta" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Enviar la(s) orden(es) de pago manualmente" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Especifica el código para el tipo de pago" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_invoice.py:16 +#, python-format +msgid "Structured Reference" +msgstr "Referencia esctructurada" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "Tipos de cuentas bancarias adecuadas" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:152 +#, python-format +msgid "The amount for Partner '%s' is negative or null (%.2f) !" +msgstr "El importe para el empresa '%s' es negativo o nulo (%.2f) !" + +#. module: account_banking_payment_export +#: help:payment.mode.type,payment_order_type:0 +msgid "" +"This field determines if this type applies to customers (Debit) or suppliers" +" (Payment)" +msgstr "Este campo determina si este tipo aplica a clientes (Cobro) o a proveedores (Pago)" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +msgid "Total Amount" +msgstr "Importe total" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Credit" +msgstr "Total haber" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Debit" +msgstr "Total debe" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Total in Company Currency" +msgstr "Total en moneda de la compañía" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Transaction Information" +msgstr "Información de transacción" + +#. module: account_banking_payment_export +#: field:payment.mode,default_date_type:0 +#: field:payment.order.create,date_type:0 +msgid "Type of Date Filter" +msgstr "Filtro de tipo de fecha" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:75 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "Sólo puede combinar órdenes de pago del mismo tipo" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "launch_wizard" +msgstr "Asistente" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "" +"{\n" +" 'invisible': [('state', '!=', 'draft')]}" +msgstr "{\n 'invisible': [('state', '!=', 'draft')]}" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines +msgid "" +"{'display_credit': context.get('display_credit', False),'display_debit': " +"context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' " +": " +"'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" +msgstr "{'display_credit': context.get('display_credit', False),'display_debit': context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' : 'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "" +"{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', " +"'due')]}" +msgstr "{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}" diff --git a/account_payment_order/i18n/fr.po b/account_payment_order/i18n/fr.po new file mode 100644 index 00000000000..a7efd5fd1e1 --- /dev/null +++ b/account_payment_order/i18n/fr.po @@ -0,0 +1,488 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-08 00:46+0000\n" +"PO-Revision-Date: 2016-04-06 00:14+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17 +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31 +#, python-format +msgid "" +"A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, " +"so it is not valid." +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,active:0 field:payment.mode.type,active:0 +msgid "Active" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,amount_currency:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Amount" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_bank +msgid "Bank" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank +msgid "Bank Accounts" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +#: field:payment.line,bank_line_id:0 +msgid "Bank Payment Line" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,name:0 +msgid "Bank Payment Line Ref" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action +#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: field:payment.order,bank_line_ids:0 +msgid "Bank Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Annuler" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,communication:0 +msgid "Communication" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_uid:0 field:payment.manual,create_uid:0 +#: field:payment.mode.type,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_date:0 field:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Due" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +msgid "Due Date" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Entry Information" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:152 +#, python-format +msgid "Entry Lines" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:74 +#, python-format +msgid "Error" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "General Information" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,group_lines:0 +msgid "Group lines in payment orders" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,id:0 field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode,group_lines:0 +msgid "" +"If this mark is checked, the payment order lines will be grouped when validating the payment order before exporting the bank file. The grouping will be done only if the following fields matches:\n" +"* Partner\n" +"* Currency\n" +"* Destination Bank Account\n" +"* Communication Type (structured, free)\n" +"* Payment Date\n" +"(other modules can set additional fields to restrict the grouping.)" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Information" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Journal Entry" +msgstr "" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_journal_ids:0 +#: field:payment.order.create,journal_ids:0 +msgid "Journals Filter" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "Keep empty for using all journals" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_uid:0 field:payment.manual,write_uid:0 +#: field:payment.mode.type,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_date:0 field:payment.manual,write_date:0 +#: field:payment.mode.type,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Line grouping" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_invoice:0 field:payment.order.create,invoice:0 +msgid "Linked to an Invoice or Refund" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Move" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +#: field:payment.order.create,move_date:0 +msgid "Move Date" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +#: field:payment.mode,note:0 +msgid "Note" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,order_id:0 +msgid "Order" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,payment_order_type:0 +msgid "Order type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Owner Account" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Partner Bank Account" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type +#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type +msgid "Payment Export Types" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Line" +msgstr "Ligne de paiement" + +#. module: account_banking_payment_export +#: field:bank.payment.line,payment_line_ids:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Mode de paiement" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:59 +#, python-format +msgid "Payment Order Export" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:245 +#, python-format +msgid "Payment Orders" +msgstr "Ordres de paiement" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_populate_results:0 +#: field:payment.order.create,populate_results:0 +msgid "Populate Results Directly" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +msgid "Related Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Select Move Lines to Pay - Default Values" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_invoice.py:16 +#, python-format +msgid "Structured Reference" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:152 +#, python-format +msgid "The amount for Partner '%s' is negative or null (%.2f) !" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,payment_order_type:0 +msgid "" +"This field determines if this type applies to customers (Debit) or suppliers" +" (Payment)" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Credit" +msgstr "" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Debit" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Total in Company Currency" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Transaction Information" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_date_type:0 +#: field:payment.order.create,date_type:0 +msgid "Type of Date Filter" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:75 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "launch_wizard" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "" +"{\n" +" 'invisible': [('state', '!=', 'draft')]}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines +msgid "" +"{'display_credit': context.get('display_credit', False),'display_debit': " +"context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' " +": " +"'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "" +"{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', " +"'due')]}" +msgstr "" diff --git a/account_payment_order/i18n/nl.po b/account_payment_order/i18n/nl.po new file mode 100644 index 00000000000..de3fae5741f --- /dev/null +++ b/account_payment_order/i18n/nl.po @@ -0,0 +1,488 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-08 00:46+0000\n" +"PO-Revision-Date: 2016-04-06 00:15+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17 +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31 +#, python-format +msgid "" +"A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, " +"so it is not valid." +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,active:0 field:payment.mode.type,active:0 +msgid "Active" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,amount_currency:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Amount" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_bank +msgid "Bank" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank +msgid "Bank Accounts" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +#: field:payment.line,bank_line_id:0 +msgid "Bank Payment Line" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,name:0 +msgid "Bank Payment Line Ref" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action +#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: field:payment.order,bank_line_ids:0 +msgid "Bank Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Annuleren" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Code" + +#. module: account_banking_payment_export +#: field:bank.payment.line,communication:0 +msgid "Communication" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_uid:0 field:payment.manual,create_uid:0 +#: field:payment.mode.type,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_date:0 field:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "Incasso-opdracht" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Due" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +msgid "Due Date" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Entry Information" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:152 +#, python-format +msgid "Entry Lines" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:74 +#, python-format +msgid "Error" +msgstr "Fout" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "General Information" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,group_lines:0 +msgid "Group lines in payment orders" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,id:0 field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode,group_lines:0 +msgid "" +"If this mark is checked, the payment order lines will be grouped when validating the payment order before exporting the bank file. The grouping will be done only if the following fields matches:\n" +"* Partner\n" +"* Currency\n" +"* Destination Bank Account\n" +"* Communication Type (structured, free)\n" +"* Payment Date\n" +"(other modules can set additional fields to restrict the grouping.)" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Information" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_invoice +msgid "Invoice" +msgstr "Factuur" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Journal Entry" +msgstr "" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Boekingen" + +#. module: account_banking_payment_export +#: field:payment.mode,default_journal_ids:0 +#: field:payment.order.create,journal_ids:0 +msgid "Journals Filter" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "Keep empty for using all journals" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_uid:0 field:payment.manual,write_uid:0 +#: field:payment.mode.type,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_date:0 field:payment.manual,write_date:0 +#: field:payment.mode.type,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Line grouping" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_invoice:0 field:payment.order.create,invoice:0 +msgid "Linked to an Invoice or Refund" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "Handmatige betaling" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Move" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +#: field:payment.order.create,move_date:0 +msgid "Move Date" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Naam" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +#: field:payment.mode,note:0 +msgid "Note" +msgstr "" + +#. module: account_banking_payment_export +#: field:bank.payment.line,order_id:0 +msgid "Order" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,payment_order_type:0 +msgid "Order type" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Owner Account" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Partner Bank Account" +msgstr "" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "Betaling" + +#. module: account_banking_payment_export +#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type +#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type +msgid "Payment Export Types" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Line" +msgstr "Betaalregel" + +#. module: account_banking_payment_export +#: field:bank.payment.line,payment_line_ids:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Betaalwijze" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Betaalwijze soort" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Betalingsopdracht" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:59 +#, python-format +msgid "Payment Order Export" +msgstr "Betaalopdracht export" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:245 +#, python-format +msgid "Payment Orders" +msgstr "Betaalopdrachten" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "Betaalwijze" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Betaalwizard" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "Voer de betaalopdracht handmatig uit en klik OK, wanneer succesvol verzonden." + +#. module: account_banking_payment_export +#: field:payment.mode,default_populate_results:0 +#: field:payment.order.create,populate_results:0 +msgid "Populate Results Directly" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +msgid "Related Payment Lines" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Select Move Lines to Pay - Default Values" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "Selecteer de wizard voor het verwerken van betalingen van dit type. Laat leeg voor handmatige verwerking." + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Verzend betaalopdrachten handmatig" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Geef de code op voor het betaaltype" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_invoice.py:16 +#, python-format +msgid "Structured Reference" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "Geschikte banktypen" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:152 +#, python-format +msgid "The amount for Partner '%s' is negative or null (%.2f) !" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,payment_order_type:0 +msgid "" +"This field determines if this type applies to customers (Debit) or suppliers" +" (Payment)" +msgstr "" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +msgid "Total Amount" +msgstr "Totaalbedrag" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Credit" +msgstr "" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Debit" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Total in Company Currency" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Transaction Information" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,default_date_type:0 +#: field:payment.order.create,date_type:0 +msgid "Type of Date Filter" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:75 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "U kunt alleen betalingsopdrachten van dezelfde soort combineren" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "launch_wizard" +msgstr "launch_wizard" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "" +"{\n" +" 'invisible': [('state', '!=', 'draft')]}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines +msgid "" +"{'display_credit': context.get('display_credit', False),'display_debit': " +"context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' " +": " +"'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "" +"{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', " +"'due')]}" +msgstr "" diff --git a/account_payment_order/i18n/pt_BR.po b/account_payment_order/i18n/pt_BR.po new file mode 100644 index 00000000000..1de801dc160 --- /dev/null +++ b/account_payment_order/i18n/pt_BR.po @@ -0,0 +1,489 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-08 00:46+0000\n" +"PO-Revision-Date: 2016-04-06 01:30+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17 +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31 +#, python-format +msgid "" +"A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, " +"so it is not valid." +msgstr "Um código de banco válido contém de 8 a 11 caracteres. O BIC '%s' contém %d caracteres, ou seja não é válido" + +#. module: account_banking_payment_export +#: field:payment.mode,active:0 field:payment.mode.type,active:0 +msgid "Active" +msgstr "Ativo" + +#. module: account_banking_payment_export +#: field:bank.payment.line,amount_currency:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Amount" +msgstr "Total" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_bank +msgid "Bank" +msgstr "Banco" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Contas bancárias" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +#: field:payment.line,bank_line_id:0 +msgid "Bank Payment Line" +msgstr "Linha de pagamento bancário" + +#. module: account_banking_payment_export +#: field:bank.payment.line,name:0 +msgid "Bank Payment Line Ref" +msgstr "Referência do pagamento" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action +#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: field:payment.order,bank_line_ids:0 +msgid "Bank Payment Lines" +msgstr "Linhas de pagamento bancária" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Código" + +#. module: account_banking_payment_export +#: field:bank.payment.line,communication:0 +msgid "Communication" +msgstr "Comunicação" + +#. module: account_banking_payment_export +#: field:bank.payment.line,company_id:0 +msgid "Company" +msgstr "Empresa" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_uid:0 field:payment.manual,create_uid:0 +#: field:payment.mode.type,create_uid:0 +msgid "Created by" +msgstr "Criado por" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_date:0 field:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "Criado em" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "Débito" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "Débito direto" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Due" +msgstr "Vence em" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +msgid "Due Date" +msgstr "Data de vencimento" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Entry Information" +msgstr "Registro de informação" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:152 +#, python-format +msgid "Entry Lines" +msgstr "Linhas de pagamento" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:74 +#, python-format +msgid "Error" +msgstr "Erro" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "Tipo de exportação" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "General Information" +msgstr "Informação geral" + +#. module: account_banking_payment_export +#: field:payment.mode,group_lines:0 +msgid "Group lines in payment orders" +msgstr "Agrupar linhas nas ordens de pagamento" + +#. module: account_banking_payment_export +#: field:bank.payment.line,id:0 field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_payment_export +#: help:payment.mode,group_lines:0 +msgid "" +"If this mark is checked, the payment order lines will be grouped when validating the payment order before exporting the bank file. The grouping will be done only if the following fields matches:\n" +"* Partner\n" +"* Currency\n" +"* Destination Bank Account\n" +"* Communication Type (structured, free)\n" +"* Payment Date\n" +"(other modules can set additional fields to restrict the grouping.)" +msgstr "Se marcado, as linhas das ordens serão agrupadas quando validadas antes de exportar o arquivo do banco. O agrupamento será feito apenas se os campos forem iguais:\n* Parceiro\n* Moeda\n* Conta bancária destino\n* TIpo de comunicação\n* Data do pagamento\n(outros módulos podem adicionar campos adicionais)" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Information" +msgstr "Informação" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_invoice +msgid "Invoice" +msgstr "Fatura" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Journal Entry" +msgstr "Entrada do diário" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Itens de Diário" + +#. module: account_banking_payment_export +#: field:payment.mode,default_journal_ids:0 +#: field:payment.order.create,journal_ids:0 +msgid "Journals Filter" +msgstr "Filtro de diário" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "Keep empty for using all journals" +msgstr "Manter vazio para usar todos os diários" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_uid:0 field:payment.manual,write_uid:0 +#: field:payment.mode.type,write_uid:0 +msgid "Last Updated by" +msgstr "Última Atualização por" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_date:0 field:payment.manual,write_date:0 +#: field:payment.mode.type,write_date:0 +msgid "Last Updated on" +msgstr "Última Atualização em" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Line grouping" +msgstr "Agrupamento de linha" + +#. module: account_banking_payment_export +#: field:payment.mode,default_invoice:0 field:payment.order.create,invoice:0 +msgid "Linked to an Invoice or Refund" +msgstr "Vinculado a uma fatura ou reembolso" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "Pagamento manual" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Move" +msgstr "Movimentação" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +#: field:payment.order.create,move_date:0 +msgid "Move Date" +msgstr "Data da movimentação" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Nome" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +#: field:payment.mode,note:0 +msgid "Note" +msgstr "Nota" + +#. module: account_banking_payment_export +#: field:bank.payment.line,order_id:0 +msgid "Order" +msgstr "Ordem" + +#. module: account_banking_payment_export +#: field:payment.mode.type,payment_order_type:0 +msgid "Order type" +msgstr "Tipo de ordem" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Owner Account" +msgstr "Dono da conta" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Partner Bank Account" +msgstr "Conta bancária parceiro" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "Pagamento" + +#. module: account_banking_payment_export +#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type +#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type +msgid "Payment Export Types" +msgstr "Tipos de exportação dos Pagamentos" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Line" +msgstr "Linha de Pagamento" + +#. module: account_banking_payment_export +#: field:bank.payment.line,payment_line_ids:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Lines" +msgstr "Linhas do pagamento" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Modo de pagamento" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Tipo do Modo de Pagamento" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Ordem de Pagamento" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:59 +#, python-format +msgid "Payment Order Export" +msgstr "Exportação da Ordem de Pagamento" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:245 +#, python-format +msgid "Payment Orders" +msgstr "Ordens de Pagamento" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "Tipo de pagamento" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "Tipos de pagamento" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "Tipo da ordem de pagamento" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Assistente para Pagamentos" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "Por favor execute a ordem de pagamento manualmente, e clique OK quando terminar de enviar." + +#. module: account_banking_payment_export +#: field:payment.mode,default_populate_results:0 +#: field:payment.order.create,populate_results:0 +msgid "Populate Results Directly" +msgstr "Popular resultados diretamente" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +msgid "Related Payment Lines" +msgstr "Linhas relacionadas do pagamento" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Select Move Lines to Pay - Default Values" +msgstr "Selecionar os movimentos para pagar - Valores padrão" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "Selecione os tipos de pagamento que permitem exportação para o Modo de Pagamento." + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "Selecione o Assistente de Pagamento para pagamentos deste tipo. Deixe vazio para processamento manual" + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "Selecionável em operações de compra" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "Selecionável em operações de venda" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Enviar a(s) ordem(s) de pagamento manualmente" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Especifique o código para o Tipo de Pagamento" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_invoice.py:16 +#, python-format +msgid "Structured Reference" +msgstr "Referência estruturada" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "Tipos de contas bancárias adequadas" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:152 +#, python-format +msgid "The amount for Partner '%s' is negative or null (%.2f) !" +msgstr "O total para o parceiro '%s' é negativo ou nulo (%.2f) !" + +#. module: account_banking_payment_export +#: help:payment.mode.type,payment_order_type:0 +msgid "" +"This field determines if this type applies to customers (Debit) or suppliers" +" (Payment)" +msgstr "Este campo determina se este tipo se aplica a clientes (Cobrança) ou a fornecedores (Pagamentos)" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +msgid "Total Amount" +msgstr "Valor total" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Credit" +msgstr "Total de crédito" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Debit" +msgstr "Total débito" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Total in Company Currency" +msgstr "Total na moeda da empresa" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Transaction Information" +msgstr "Informação da transação" + +#. module: account_banking_payment_export +#: field:payment.mode,default_date_type:0 +#: field:payment.order.create,date_type:0 +msgid "Type of Date Filter" +msgstr "Tipo de filtro de data" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:75 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "Você pode combinar ordens de pagamento do mesmo tipo" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "launch_wizard" +msgstr "launch_wizard" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "" +"{\n" +" 'invisible': [('state', '!=', 'draft')]}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines +msgid "" +"{'display_credit': context.get('display_credit', False),'display_debit': " +"context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' " +": " +"'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "" +"{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', " +"'due')]}" +msgstr "" diff --git a/account_payment_order/i18n/sl.po b/account_payment_order/i18n/sl.po new file mode 100644 index 00000000000..202b5950492 --- /dev/null +++ b/account_payment_order/i18n/sl.po @@ -0,0 +1,489 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-payment (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-18 10:57+0000\n" +"PO-Revision-Date: 2016-04-19 08:59+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17 +#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31 +#, python-format +msgid "" +"A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, " +"so it is not valid." +msgstr "Veljavna BIC koda vsebuje 8 do 11 znakov. BIC '%s' vsebuje %d znakov, zato ni veljavna." + +#. module: account_banking_payment_export +#: field:payment.mode,active:0 field:payment.mode.type,active:0 +msgid "Active" +msgstr "Aktivno" + +#. module: account_banking_payment_export +#: field:bank.payment.line,amount_currency:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Amount" +msgstr "Znesek" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_bank +msgid "Bank" +msgstr "Banka" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Bančni računi" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +#: field:payment.line,bank_line_id:0 +msgid "Bank Payment Line" +msgstr "Postavka bančnega plačila" + +#. module: account_banking_payment_export +#: field:bank.payment.line,name:0 +msgid "Bank Payment Line Ref" +msgstr "Sklic postavke bančnega plačila" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action +#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: field:payment.order,bank_line_ids:0 +msgid "Bank Payment Lines" +msgstr "Postavke bančnih plačil" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Preklic" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Koda" + +#. module: account_banking_payment_export +#: field:bank.payment.line,communication:0 +msgid "Communication" +msgstr "Komunikacija" + +#. module: account_banking_payment_export +#: field:bank.payment.line,company_id:0 +msgid "Company" +msgstr "Družba" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_uid:0 field:payment.manual,create_uid:0 +#: field:payment.mode.type,create_uid:0 +msgid "Created by" +msgstr "Ustvaril" + +#. module: account_banking_payment_export +#: field:bank.payment.line,create_date:0 field:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "Ustvarjeno" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "Breme" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "Neposredno breme" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Due" +msgstr "Zapadlost" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +msgid "Due Date" +msgstr "Datum zapadlosti" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Entry Information" +msgstr "Podatki o vnosu" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:152 +#, python-format +msgid "Entry Lines" +msgstr "Postavke vnosa" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:74 +#, python-format +msgid "Error" +msgstr "Napaka" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "Tip izvoza" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "General Information" +msgstr "Splošne informacije" + +#. module: account_banking_payment_export +#: field:payment.mode,group_lines:0 +msgid "Group lines in payment orders" +msgstr "Združevanje postavk v plačilnih nalogih" + +#. module: account_banking_payment_export +#: field:bank.payment.line,id:0 field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_payment_export +#: help:payment.mode,group_lines:0 +msgid "" +"If this mark is checked, the payment order lines will be grouped when validating the payment order before exporting the bank file. The grouping will be done only if the following fields matches:\n" +"* Partner\n" +"* Currency\n" +"* Destination Bank Account\n" +"* Communication Type (structured, free)\n" +"* Payment Date\n" +"(other modules can set additional fields to restrict the grouping.)" +msgstr "Če označeno, se postavke plačilnega naloga združujejo ob overjanju plačilnega naloga pred izvozom v bančno datoteko. Združevanje se izvede le ob ujemanju naslednjih polj:\n* Partner\n* Valuta\n* Ciljni bančni račun\n* Tip komunikacije (strukturirana, prosta)\n* Datum plačila\n(drugi moduli lahko nastavijo tudi dodatna polja za omejevanje grupiranja)" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Information" +msgstr "Informacija" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_invoice +msgid "Invoice" +msgstr "Račun" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Journal Entry" +msgstr "Dnevniški vnos" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Dnevniške postavke" + +#. module: account_banking_payment_export +#: field:payment.mode,default_journal_ids:0 +#: field:payment.order.create,journal_ids:0 +msgid "Journals Filter" +msgstr "Dnevniški filter" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "Keep empty for using all journals" +msgstr "Pustite prazno za uporabo vseh dnevnikov" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_uid:0 field:payment.manual,write_uid:0 +#: field:payment.mode.type,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnji posodobil" + +#. module: account_banking_payment_export +#: field:bank.payment.line,write_date:0 field:payment.manual,write_date:0 +#: field:payment.mode.type,write_date:0 +msgid "Last Updated on" +msgstr "Zadnjič posodobljeno" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Line grouping" +msgstr "Združevanje postavk" + +#. module: account_banking_payment_export +#: field:payment.mode,default_invoice:0 field:payment.order.create,invoice:0 +msgid "Linked to an Invoice or Refund" +msgstr "Vezano na račun ali vračilo" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "Ročno plačilo" + +#. module: account_banking_payment_export +#: selection:payment.mode,default_date_type:0 +msgid "Move" +msgstr "Premik" + +#. module: account_banking_payment_export +#: selection:payment.order.create,date_type:0 +#: field:payment.order.create,move_date:0 +msgid "Move Date" +msgstr "Datum premika" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Naziv" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +#: field:payment.mode,note:0 +msgid "Note" +msgstr "Opomba" + +#. module: account_banking_payment_export +#: field:bank.payment.line,order_id:0 +msgid "Order" +msgstr "Nalog" + +#. module: account_banking_payment_export +#: field:payment.mode.type,payment_order_type:0 +msgid "Order type" +msgstr "Tip naloga" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Owner Account" +msgstr "Račun lastnika" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Partner Bank Account" +msgstr "Bančni račun partnerja" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "Plačilo" + +#. module: account_banking_payment_export +#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type +#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type +msgid "Payment Export Types" +msgstr "Tipi izvoza plačil" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_line +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Line" +msgstr "Plačilna postavka" + +#. module: account_banking_payment_export +#: field:bank.payment.line,payment_line_ids:0 +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Payment Lines" +msgstr "Plačilne postavke" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Metoda plačila" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Tip metode plačila" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Plačilni nalog" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:59 +#, python-format +msgid "Payment Order Export" +msgstr "Izvoz plačilnega naloga" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:245 +#, python-format +msgid "Payment Orders" +msgstr "Plačilni nalogi" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "Tip plačila" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "Tipi plačil" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "Tip plačilnega naloga" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Čarovnik za plačila" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "Ročno izvedite plačilni nalog in kliknite 'V redu' po uspešnem pošiljanju." + +#. module: account_banking_payment_export +#: field:payment.mode,default_populate_results:0 +#: field:payment.order.create,populate_results:0 +msgid "Populate Results Directly" +msgstr "Neposredno zapolni rezultate" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form +msgid "Related Payment Lines" +msgstr "Povezane plačilne postavke" + +#. module: account_banking_payment_export +#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit +msgid "Select Move Lines to Pay - Default Values" +msgstr "Izbira postavk premikov za plačilo - privzete vrednosti" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "Izbira tipa izvoza plačila za metodo plačila." + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "Izbira čarovnika za plačila za plačila tega tipa. Pustite prazno za ročno obdelavo." + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "Izbirno pri nabavnih operacijah" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "Izbirno pri prodajnih operacijah" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Ročno pošiljanje plačilnega naloga (plačilnih nalogov)" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Določi kodo za tip plačila" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_invoice.py:16 +#, python-format +msgid "Structured Reference" +msgstr "Strukturiran sklic" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "Ustrezni tipi bank" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:152 +#, python-format +msgid "The amount for Partner '%s' is negative or null (%.2f) !" +msgstr "Znesek za partnerja '%s' je negativen ali ničen (%.2f) !" + +#. module: account_banking_payment_export +#: help:payment.mode.type,payment_order_type:0 +msgid "" +"This field determines if this type applies to customers (Debit) or suppliers" +" (Payment)" +msgstr "To polje določa, če se ta tip nanaša na kupce (breme) ali dobavitelje (plačilo )" + +#. module: account_banking_payment_export +#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree +msgid "Total Amount" +msgstr "Skupni znesek" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Credit" +msgstr "Skupaj dobroimetje" + +#. module: account_banking_payment_export +#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree +msgid "Total Debit" +msgstr "Skupaj breme" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Total in Company Currency" +msgstr "Skupaj v valuti družbe" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "Transaction Information" +msgstr "Podatki o transakciji" + +#. module: account_banking_payment_export +#: field:payment.mode,default_date_type:0 +#: field:payment.order.create,date_type:0 +msgid "Type of Date Filter" +msgstr "Tip datumskega filtra" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:75 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "Kombinirate lahko le plačilne naloge istega tipa" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "launch_wizard" +msgstr "launch_wizard" + +#. module: account_banking_payment_export +#: view:payment.order:account_banking_payment_export.view_payment_order_form +msgid "" +"{\n" +" 'invisible': [('state', '!=', 'draft')]}" +msgstr "{\n 'invisible': [('state', '!=', 'draft')]}" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines +msgid "" +"{'display_credit': context.get('display_credit', False),'display_debit': " +"context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' " +": " +"'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" +msgstr "{'display_credit': context.get('display_credit', False),'display_debit': context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' : 'account_banking_payment_export.payment_order_populate_view_move_line_tree'}" + +#. module: account_banking_payment_export +#: view:payment.order.create:account_banking_payment_export.view_create_payment_order +msgid "" +"{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', " +"'due')]}" +msgstr "{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}" diff --git a/account_payment_order/migrations/8.0.0.1.166/pre-migrate.py b/account_payment_order/migrations/8.0.0.1.166/pre-migrate.py new file mode 100644 index 00000000000..8707478444f --- /dev/null +++ b/account_payment_order/migrations/8.0.0.1.166/pre-migrate.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module copyright (C) 2015 Therp BV (). +# +# 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 . +# +############################################################################## + + +def migrate(cr, version): + cr.execute( + 'SELECT count(attname) FROM pg_attribute ' + 'WHERE attrelid = ' + '( SELECT oid FROM pg_class WHERE relname = %s ) ' + 'AND attname = %s', + ('payment_order', 'total')) + if cr.fetchone()[0] == 0: + cr.execute('alter table payment_order add column total numeric') + cr.execute( + 'update payment_order ' + 'set total=totals.total ' + 'from ' + '(select order_id, sum(amount_currency) total ' + 'from payment_line group by order_id) totals ' + 'where payment_order.id=totals.order_id') diff --git a/account_payment_order/models/__init__.py b/account_payment_order/models/__init__.py new file mode 100644 index 00000000000..6504945708a --- /dev/null +++ b/account_payment_order/models/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +from . import account_payment_mode +from . import account_payment_order +from . import account_payment_line +from . import bank_payment_line +from . import account_move +from . import account_move_line +from . import account_invoice +from . import res_bank diff --git a/account_payment_order/models/account_invoice.py b/account_payment_order/models/account_invoice.py new file mode 100644 index 00000000000..e9cd0fe855b --- /dev/null +++ b/account_payment_order/models/account_invoice.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +# © 2013-2014 ACSONE SA (). +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import UserError + + +class AccountInvoice(models.Model): + _inherit = 'account.invoice' + + payment_order_ok = fields.Boolean( + related='payment_mode_id.payment_order_ok', readonly=True) + + @api.model + def _get_reference_type(self): + rt = super(AccountInvoice, self)._get_reference_type() + rt.append(('structured', _('Structured Reference'))) + return rt + + @api.model + def line_get_convert(self, line, part): + """Copy supplier bank account from invoice to account move line""" + res = super(AccountInvoice, self).line_get_convert(line, part) + if line.get('type') == 'dest' and line.get('invoice_id'): + invoice = self.browse(line['invoice_id']) + if invoice.type in ('in_invoice', 'in_refund'): + res['partner_bank_id'] = invoice.partner_bank_id.id or False + return res + + @api.multi + def _prepare_new_payment_order(self): + self.ensure_one() + vals = {'payment_mode_id': self.payment_mode_id.id} + return vals + + @api.multi + def create_account_payment_line(self): + apoo = self.env['account.payment.order'] + aplo = self.env['account.payment.line'] + result_payorder_ids = [] + action_payment_type = 'debit' + for inv in self: + if inv.state != 'open': + raise UserError(_( + "The invoice %s is not in Open state") % inv.number) + if not inv.payment_mode_id: + raise UserError(_( + "No Payment Mode on invoice %s") % inv.number) + if not inv.move_id: + raise UserError(_( + "No Journal Entry on invoice %s") % inv.number) + if not inv.payment_order_ok: + raise UserError(_( + "The invoice %s has a payment mode '%s' " + "which is not selectable in payment orders.")) + payorders = apoo.search([ + ('payment_mode_id', '=', inv.payment_mode_id.id), + ('state', '=', 'draft')]) + if payorders: + payorder = payorders[0] + new_payorder = False + else: + payorder = apoo.create(inv._prepare_new_payment_order()) + new_payorder = True + result_payorder_ids.append(payorder.id) + action_payment_type = payorder.payment_type + count = 0 + for line in inv.move_id.line_ids: + if line.account_id == inv.account_id and not line.reconciled: + paylines = aplo.search([ + ('move_line_id', '=', line.id), + ('state', '!=', 'cancel')]) + if not paylines: + line.create_payment_line_from_move_line(payorder) + count += 1 + if count: + if new_payorder: + inv.message_post(_( + '%d payment lines added to the new draft payment ' + 'order %s which has been automatically created.') + % (count, payorder.name)) + else: + inv.message_post(_( + '%d payment lines added to the existing draft ' + 'payment order %s.') + % (count, payorder.name)) + else: + raise UserError(_( + 'No Payment Line created for invoice %s because ' + 'it already exists or because this invoice is ' + 'already paid.') % inv.number) + action = self.env['ir.actions.act_window'].for_xml_id( + 'account_payment_order', + 'account_payment_order_%s_action' % action_payment_type) + if len(result_payorder_ids) == 1: + action.update({ + 'view_mode': 'form,tree,pivot,graph', + 'res_id': payorder.id, + 'views': False, + }) + else: + action.update({ + 'view_mode': 'tree,form,pivot,graph', + 'domain': "[('id', 'in', %s)]" % result_payorder_ids, + 'views': False, + }) + return action diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py new file mode 100644 index 00000000000..1fda028961e --- /dev/null +++ b/account_payment_order/models/account_move.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields + + +class AccountMove(models.Model): + _inherit = 'account.move' + + payment_order_id = fields.Many2one( + 'account.payment.order', string='Payment Order', copy=False, + readonly=True) diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py new file mode 100644 index 00000000000..d87b57351c5 --- /dev/null +++ b/account_payment_order/models/account_move_line.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# © 2014-2016 Akretion (Alexis de Lattre ) +# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api + + +class AccountMoveLine(models.Model): + _inherit = 'account.move.line' + + partner_bank_id = fields.Many2one( + 'res.partner.bank', string='Partner Bank Account', + help='Bank account on which we should pay the supplier') + bank_payment_line_id = fields.Many2one( + 'bank.payment.line', string='Bank Payment Line', + readonly=True) + + @api.multi + def _prepare_payment_line_vals(self, payment_order): + self.ensure_one() + assert payment_order, 'Missing payment order' + aplo = self.env['account.payment.line'] + # default values for communication_type and communication + communication_type = 'normal' + communication = self.move_id.name or '-' + # change these default values if move line is linked to an invoice + if self.invoice_id: + if self.invoice_id.reference_type != 'none': + communication = self.invoice_id.reference + ref2comm_type =\ + aplo.invoice_reference_type2communication_type() + communication_type =\ + ref2comm_type[self.invoice_id.reference_type] + else: + if ( + self.invoice_id.type in ('in_invoice', 'in_refund') and + self.invoice_id.reference): + communication = self.invoice_id.reference + if self.currency_id: + currency_id = self.currency_id.id + amount_currency = self.amount_residual_currency + else: + currency_id = self.company_id.currency_id.id + amount_currency = self.amount_residual + # TODO : check that self.amount_residual_currency is 0 + # in this case + if payment_order.payment_type == 'outbound': + amount_currency *= -1 + vals = { + 'order_id': payment_order.id, + 'partner_bank_id': self.partner_bank_id.id, + 'partner_id': self.partner_id.id, + 'move_line_id': self.id, + 'communication': communication, + 'communication_type': communication_type, + 'currency_id': currency_id, + 'amount_currency': amount_currency, + # date is set when the user confirms the payment order + } + return vals + + @api.multi + def create_payment_line_from_move_line(self, payment_order): + aplo = self.env['account.payment.line'] + for mline in self: + aplo.create(mline._prepare_payment_line_vals(payment_order)) + return diff --git a/account_payment_order/models/account_payment_line.py b/account_payment_order/models/account_payment_line.py new file mode 100644 index 00000000000..5df4c2644af --- /dev/null +++ b/account_payment_order/models/account_payment_line.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import UserError + + +class AccountPaymentLine(models.Model): + _name = 'account.payment.line' + _description = 'Payment Lines' + + name = fields.Char(string='Payment Reference', readonly=True, copy=False) + order_id = fields.Many2one( + 'account.payment.order', string='Payment Order', + ondelete='cascade', select=True) + company_id = fields.Many2one( + related='order_id.company_id', store=True, readonly=True) + company_currency_id = fields.Many2one( + related='order_id.company_currency_id', store=True, readonly=True) + payment_type = fields.Selection( + related='order_id.payment_type', store=True, readonly=True) + bank_account_required = fields.Boolean( + related='order_id.payment_method_id.bank_account_required', + readonly=True) + state = fields.Selection( + related='order_id.state', string='State', + readonly=True, store=True) + move_line_id = fields.Many2one( + 'account.move.line', string='Journal Item') + ml_maturity_date = fields.Date( + related='move_line_id.date_maturity', readonly=True) + currency_id = fields.Many2one( + 'res.currency', string='Currency of the Payment Transaction', + required=True, + default=lambda self: self.env.user.company_id.currency_id) + # v8 field : currency + amount_currency = fields.Monetary( + string="Amount", currency_field='currency_id') + amount_company_currency = fields.Monetary( + compute='compute_amount_company_currency', + string='Amount in Company Currency', readonly=True, + currency_field='company_currency_id') # v8 field : amount + partner_id = fields.Many2one( + 'res.partner', string='Partner', required=True, + domain=[('parent_id', '=', False)]) + partner_bank_id = fields.Many2one( + 'res.partner.bank', string='Partner Bank Account', required=False, + ondelete='restrict') # v8 field : bank_id + date = fields.Date(string='Payment Date') + communication = fields.Char( + string='Communication', required=True, + help="Label of the payment that will be seen by the destinee") + communication_type = fields.Selection([ + ('normal', 'Free'), + ], string='Communication Type', required=True, default='normal') + # v8 field : state + bank_line_id = fields.Many2one( + 'bank.payment.line', string='Bank Payment Line', readonly=True) + + _sql_constraints = [( + 'name_company_unique', + 'unique(name, company_id)', + 'A payment line already exists with this reference ' + 'in the same company!' + )] + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'account.payment.line') or 'New' + return super(AccountPaymentLine, self).create(vals) + + @api.multi + @api.depends( + 'amount_currency', 'currency_id', 'company_currency_id', 'date') + def compute_amount_company_currency(self): + for line in self: + if line.currency_id and line.company_currency_id: + line.amount_company_currency = line.currency_id.with_context( + date=line.date).compute( + line.amount_currency, line.company_currency_id) + + @api.multi + def payment_line_hashcode(self): + self.ensure_one() + bplo = self.env['bank.payment.line'] + values = [] + for field in bplo.same_fields_payment_line_and_bank_payment_line(): + values.append(unicode(self[field])) + # Don't group the payment lines that are attached to the same supplier + # but to move lines with different accounts (very unlikely), + # for easier generation/comprehension of the transfer move + values.append(unicode(self.move_line_id.account_id or False)) + # Don't group the payment lines that use a structured communication + # otherwise it would break the structured communication system ! + if self.communication_type != 'normal': + values.append(unicode(self.id)) + hashcode = '-'.join(values) + return hashcode + + @api.onchange('partner_id') + def partner_id_change(self): + partner_bank = False + if self.partner_id.bank_ids: + partner_bank = self.partner_id.bank_ids[0] + self.partner_bank_id = partner_bank + + @api.onchange('move_line_id') + def move_line_id_change(self): + if self.move_line_id: + vals = self.move_line_id._prepare_payment_line_vals(self.order_id) + vals.pop('order_id') + for field, value in vals.iteritems(): + self[field] = value + else: + self.partner_id = False + self.partner_bank_id = False + self.amount_currency = 0.0 + self.currency_id = False + self.communication = False + + def invoice_reference_type2communication_type(self): + """This method is designed to be inherited by + localization modules""" + # key = value of 'reference_type' field on account_invoice + # value = value of 'communication_type' field on account_payment_line + res = {'none': 'normal'} + return res + + @api.multi + def draft2open_payment_line_check(self): + self.ensure_one() + if self.bank_account_required and not self.partner_bank_id: + raise UserError(_( + 'Missing Partner Bank Account on payment line %s') % self.name) diff --git a/account_payment_order/models/account_payment_mode.py b/account_payment_order/models/account_payment_mode.py new file mode 100644 index 00000000000..263117b96ee --- /dev/null +++ b/account_payment_order/models/account_payment_mode.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- +# © 2009 EduSense BV () +# © 2011-2013 Therp BV () +# © 2014-2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import ValidationError + + +class AccountPaymentMode(models.Model): + """This corresponds to the object payment.mode of v8 with some + important changes""" + _inherit = "account.payment.mode" + + payment_order_ok = fields.Boolean( + string='Selectable in Payment Orders', default=True) + no_debit_before_maturity = fields.Boolean( + string="Disallow Debit Before Maturity Date", + help="If you activate this option on an Inbound payment mode, " + "you will have an error message when you confirm a debit order " + "that has a payment line with a payment date before the maturity " + "date.") + # Default options for the "payment.order.create" wizard + default_payment_mode = fields.Selection([ + ('same', 'Same'), + ('same_or_null', 'Same or empty'), + ('any', 'Any'), + ], string='Payment Mode on Invoice', default='same') + default_journal_ids = fields.Many2many( + 'account.journal', string="Journals Filter") + default_invoice = fields.Boolean( + string='Linked to an Invoice or Refund', default=False) + default_target_move = fields.Selection([ + ('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves', default='posted') + default_date_type = fields.Selection([ + ('due', 'Due'), + ('move', 'Move'), + ], default='due', string="Type of Date Filter") + group_lines = fields.Boolean( + string="Group Lines in Payment Orders", default=True, + help="If this mark is checked, the payment order lines will be " + "grouped when validating the payment order before exporting the " + "bank file. The grouping will be done only if the following " + "fields matches:\n" + "* Partner\n" + "* Currency\n" + "* Destination Bank Account\n" + "* Communication Type (structured, free)\n" + "* Payment Date\n" + "(other modules can set additional fields to restrict the " + "grouping.)") + generate_move = fields.Boolean( + string='Generate Accounting Entries On File Upload', default=True) + offsetting_account = fields.Selection([ + ('bank_account', 'Bank Account'), + ('transfer_account', 'Transfer Account'), + ], string='Offsetting Account', default='bank_account') + transfer_account_id = fields.Many2one( + 'account.account', string='Transfer Account', + domain=[('internal_type', '=', 'other'), ('reconcile', '=', True)], + help="Pay off lines in 'file uploaded' payment orders with a move on " + "this account. You can only select accounts of type regular " + "that are marked for reconciliation") + transfer_journal_id = fields.Many2one( + 'account.journal', string='Transfer Journal', + help='Journal to write payment entries when confirming ' + 'payment/debit orders of this mode') + move_option = fields.Selection([ + ('date', 'One move per payment date'), + ('line', 'One move per payment line'), + ], string='Move Option', default='date') + + @api.multi + @api.constrains( + 'generate_move', 'offsetting_account', + 'transfer_account_id', 'transfer_journal_id', 'move_option') + def transfer_move_constrains(self): + for mode in self: + if mode.generate_move: + if not mode.offsetting_account: + raise ValidationError(_( + "On the payment mode '%s', you must select an " + "option for the 'Offsetting Account' parameter") + % mode.name) + elif mode.offsetting_account == 'transfer_account': + if not mode.transfer_account_id: + raise ValidationError(_( + "On the payment mode '%s', you must " + "select a value for the 'Transfer Account'.") + % mode.name) + if not mode.transfer_journal_id: + raise ValidationError(_( + "On the payment mode '%s', you must " + "select a value for the 'Transfer Journal'.") + % mode.name) + if not mode.move_option: + raise ValidationError(_( + "On the payment mode '%s', you must " + "choose an option for the 'Move Option' " + "parameter.") % mode.name) + + @api.onchange('payment_method_id') + def payment_method_id_change(self): + if self.payment_method_id: + ajo = self.env['account.journal'] + aj_ids = [] + if self.payment_method_id.payment_type == 'outbound': + aj_ids = ajo.search([ + ('type', 'in', ('purchase_refund', 'purchase'))]).ids + elif self.payment_method_id.payment_type == 'inbound': + aj_ids = ajo.search([ + ('type', 'in', ('sale_refund', 'sale'))]).ids + self.default_journal_ids = [(6, 0, aj_ids)] + + @api.onchange('generate_move') + def generate_move_change(self): + if self.generate_move: + # default values + self.offsetting_account = 'bank_account' + self.move_option = 'date' + else: + self.offsetting_account = False + self.transfer_account_id = False + self.transfer_journal_id = False + self.move_option = False + + @api.onchange('offsetting_account') + def offsetting_account_change(self): + if self.offsetting_account == 'bank_account': + self.transfer_account_id = False + self.transfer_journal_id = False diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py new file mode 100644 index 00000000000..93777b9f2d6 --- /dev/null +++ b/account_payment_order/models/account_payment_order.py @@ -0,0 +1,440 @@ +# -*- coding: utf-8 -*- +# © 2009 EduSense BV () +# © 2011-2013 Therp BV () +# © 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Akretion (Alexis de Lattre - alexis.delattre@akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import UserError, ValidationError + + +class AccountPaymentOrder(models.Model): + _name = 'account.payment.order' + _description = 'Payment Order' + _inherit = ['mail.thread'] + _order = 'id desc' + + name = fields.Char( + string='Number', readonly=True, copy=False) # v8 field : name + payment_mode_id = fields.Many2one( + 'account.payment.mode', 'Payment Mode', required=True, + ondelete='restrict', track_visibility='onchange', + readonly=True, states={'draft': [('readonly', False)]}) + payment_type = fields.Selection([ + ('inbound', 'Inbound'), + ('outbound', 'Outbound'), + ], string='Payment Type', readonly=True, required=True) + payment_method_id = fields.Many2one( + 'account.payment.method', related='payment_mode_id.payment_method_id', + readonly=True, store=True) + company_id = fields.Many2one( + related='payment_mode_id.company_id', store=True, readonly=True) + company_currency_id = fields.Many2one( + related='payment_mode_id.company_id.currency_id', store=True, + readonly=True) + bank_account_link = fields.Selection( + related='payment_mode_id.bank_account_link', readonly=True) + journal_id = fields.Many2one( + 'account.journal', string='Bank Journal', ondelete='restrict', + readonly=True, states={'draft': [('readonly', False)]}, + track_visibility='onchange') + allowed_journal_ids = fields.Many2many( + 'account.journal', compute='_compute_allowed_journals', readonly=True, + string='Selectable Bank Journals') + # The journal_id field is only required at confirm step, to + # allow auto-creation of payment order from invoice + company_partner_bank_id = fields.Many2one( + related='journal_id.bank_account_id', string='Company Bank Account', + readonly=True) + state = fields.Selection([ + ('draft', 'Draft'), + ('open', 'Confirmed'), + ('generated', 'File Generated'), + ('uploaded', 'File Uploaded'), + ('cancel', 'Cancel'), + ], string='Status', readonly=True, copy=False, default='draft', + track_visibility='onchange') + date_prefered = fields.Selection([ + ('now', 'Immediately'), + ('due', 'Due Date'), + ('fixed', 'Fixed Date'), + ], string='Payment Execution Date Type', required=True, default='due', + track_visibility='onchange', readonly=True, + states={'draft': [('readonly', False)]}) + date_scheduled = fields.Date( + string='Payment Execution Date', readonly=True, + states={'draft': [('readonly', False)]}, track_visibility='onchange', + help="Select a requested date of execution if you selected 'Due Date' " + "as the Payment Execution Date Type.") + date_generated = fields.Date(string='File Generation Date', readonly=True) + date_uploaded = fields.Date(string='File Upload Date', readonly=True) + generated_user_id = fields.Many2one( + 'res.users', string='Generated by', readonly=True, ondelete='restrict', + copy=False) + payment_line_ids = fields.One2many( + 'account.payment.line', 'order_id', string='Transaction Lines', + readonly=True, states={'draft': [('readonly', False)]}) + # v8 field : line_ids + bank_line_ids = fields.One2many( + 'bank.payment.line', 'order_id', string="Bank Payment Lines", + readonly=True) + total_company_currency = fields.Monetary( + compute='_compute_total', store=True, readonly=True, + currency_field='company_currency_id') + bank_line_count = fields.Integer( + compute='_bank_line_count', string='Number of Bank Lines', + readonly=True) + move_ids = fields.One2many( + 'account.move', 'payment_order_id', string='Journal Entries', + readonly=True) + + @api.multi + @api.constrains('payment_type', 'payment_mode_id') + def payment_order_constraints(self): + for order in self: + if ( + order.payment_mode_id.payment_type and + order.payment_mode_id.payment_type != order.payment_type): + raise ValidationError(_( + "The payment type (%s) is not the same as the payment " + "type of the payment mode (%s)") % ( + order.payment_type, + order.payment_mode_id.payment_type)) + + @api.multi + @api.constrains('date_scheduled') + def check_date_scheduled(self): + today = fields.Date.context_today(self) + for order in self: + if order.date_scheduled: + if order.date_scheduled < today: + raise ValidationError(_( + "On payment order %s, the Payment Execution Date " + "is in the past (%s).") + % (order.name, order.date_scheduled)) + + @api.one + @api.depends( + 'payment_line_ids', 'payment_line_ids.amount_company_currency') + def _compute_total(self): + self.total_company_currency = sum( + self.mapped('payment_line_ids.amount_company_currency') or [0.0]) + + @api.multi + @api.depends('bank_line_ids') + def _bank_line_count(self): + for order in self: + order.bank_line_count = len(order.bank_line_ids) + + @api.multi + @api.depends('payment_mode_id') + def _compute_allowed_journals(self): + for order in self: + allowed_journal_ids = False + if order.payment_mode_id: + mode = order.payment_mode_id + if mode.bank_account_link == 'fixed': + allowed_journal_ids = mode.fixed_journal_id + else: + allowed_journal_ids = mode.variable_journal_ids + order.allowed_journal_ids = allowed_journal_ids + + @api.model + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'account.payment.order') or 'New' + if vals.get('payment_mode_id'): + payment_mode = self.env['account.payment.mode'].browse( + vals['payment_mode_id']) + vals['payment_type'] = payment_mode.payment_type + if payment_mode.bank_account_link == 'fixed': + vals['journal_id'] = payment_mode.fixed_journal_id.id + return super(AccountPaymentOrder, self).create(vals) + + @api.onchange('payment_mode_id') + def payment_mode_id_change(self): + journal_id = False + if self.payment_mode_id: + if self.payment_mode_id.bank_account_link == 'fixed': + journal_id = self.payment_mode_id.fixed_journal_id + self.journal_id = journal_id + + @api.multi + def action_done(self): + self.write({ + 'date_done': fields.Date.context_today(self), + 'state': 'done', + }) + return True + + @api.multi + def cancel2draft(self): + self.write({'state': 'draft'}) + return True + + @api.multi + def action_cancel(self): + for order in self: + order.write({'state': 'cancel'}) + order.bank_line_ids.unlink() + return True + + @api.model + def _prepare_bank_payment_line(self, paylines): + return { + 'order_id': paylines[0].order_id.id, + 'payment_line_ids': [(6, 0, paylines.ids)], + 'communication': '-'.join( + [line.communication for line in paylines]), + } + + @api.multi + def draft2open(self): + """ + Called when you click on the 'Confirm' button + Set the 'date' on payment line depending on the 'date_prefered' + setting of the payment.order + Re-generate the bank payment lines + """ + bplo = self.env['bank.payment.line'] + today = fields.Date.context_today(self) + for order in self: + if not order.journal_id: + raise UserError(_( + 'Missing Bank Journal on payment order %s.') % order.name) + if not order.payment_line_ids: + raise UserError(_( + 'There are no transactions on payment order %s.') + % order.name) + # Delete existing bank payment lines + order.bank_line_ids.unlink() + # Create the bank payment lines from the payment lines + group_paylines = {} # key = hashcode + for payline in order.payment_line_ids: + payline.draft2open_payment_line_check() + # Compute requested payment date + if order.date_prefered == 'due': + requested_date = payline.ml_maturity_date or today + elif order.date_prefered == 'fixed': + requested_date = order.date_scheduled or today + else: + requested_date = today + # No payment date in the past + if requested_date < today: + requested_date = today + # inbound: check option no_debit_before_maturity + if ( + order.payment_type == 'inbound' and + order.payment_mode_id.no_debit_before_maturity and + payline.ml_maturity_date and + requested_date < payline.ml_maturity_date): + raise UserError(_( + "The payment mode '%s' has the option " + "'Disallow Debit Before Maturity Date'. The " + "payment line %s has a maturity date %s " + "which is after the computed payment date %s.") % ( + order.payment_mode_id.name, + payline.name, + payline.ml_maturity_date, + requested_date)) + # Write requested_date on 'date' field of payment line + payline.date = requested_date + # Group options + if order.payment_mode_id.group_lines: + hashcode = payline.payment_line_hashcode() + else: + # Use line ID as hascode, which actually means no grouping + hashcode = payline.id + if hashcode in group_paylines: + group_paylines[hashcode]['paylines'] += payline + group_paylines[hashcode]['total'] +=\ + payline.amount_currency + else: + group_paylines[hashcode] = { + 'paylines': payline, + 'total': payline.amount_currency, + } + # Create bank payment lines + for paydict in group_paylines.values(): + # Block if a bank payment line is <= 0 + if paydict['total'] <= 0: + raise UserError(_( + "The amount for Partner '%s' is negative " + "or null (%.2f) !") + % (paydict['paylines'][0].partner_id.name, + paydict['total'])) + vals = self._prepare_bank_payment_line(paydict['paylines']) + bplo.create(vals) + self.write({'state': 'open'}) + return True + + @api.multi + def generate_payment_file(self): + """Returns (payment file as string, filename)""" + self.ensure_one() + if self.payment_method_id.code == 'manual': + return (False, False) + else: + raise UserError(_( + "No handler for this payment method. Maybe you haven't " + "installed the related Odoo module.")) + + @api.multi + def open2generated(self): + self.ensure_one() + payment_file_str, filename = self.generate_payment_file() + action = {} + if payment_file_str and filename: + attachment = self.env['ir.attachment'].create({ + 'res_model': 'account.payment.order', + 'res_id': self.id, + 'name': filename, + 'datas': payment_file_str.encode('base64'), + 'datas_fname': filename, + }) + simplified_form_view = self.env.ref( + 'account_payment_order.view_attachment_simplified_form') + action = { + 'name': _('Payment File'), + 'view_mode': 'form', + 'view_id': simplified_form_view.id, + 'res_model': 'ir.attachment', + 'type': 'ir.actions.act_window', + 'target': 'current', + 'res_id': attachment.id, + } + self.write({ + 'date_generated': fields.Date.context_today(self), + 'state': 'generated', + 'generated_user_id': self._uid, + }) + return action + + @api.multi + def generated2uploaded(self): + for order in self: + if order.payment_mode_id.generate_move: + order.generate_move() + self.write({ + 'state': 'uploaded', + 'date_uploaded': fields.Date.context_today(self), + }) + return True + + @api.multi + def _prepare_move(self): + if self.payment_type == 'outbound': + ref = _('Payment order %s') % self.name + else: + ref = _('Debit order %s') % self.name + if self.payment_mode_id.offsetting_account == 'bank_account': + journal_id = self.journal_id.id + elif self.payment_mode_id.offsetting_account == 'transfer_account': + journal_id = self.payment_mode_id.transfer_journal_id.id + vals = { + 'journal_id': journal_id, + 'ref': ref, + 'payment_order_id': self.id, + 'line_ids': [], + } + return vals + + @api.multi + def _prepare_move_line_offsetting_account( + self, amount, bank_payment_lines): + if self.payment_type == 'outbound': + name = _('Payment order %s') % self.name + else: + name = _('Debit order %s') % self.name + date_maturity = bank_payment_lines[0].date + if self.payment_mode_id.offsetting_account == 'bank_account': + account_id = self.journal_id.default_debit_account_id.id + elif self.payment_mode_id.offsetting_account == 'transfer_account': + account_id = self.payment_mode_id.transfer_account_id.id + vals = { + 'name': name, + 'partner_id': False, + 'account_id': account_id, + 'credit': (self.payment_type == 'outbound' and + amount or 0.0), + 'debit': (self.payment_type == 'inbound' and + amount or 0.0), + 'date_maturity': date_maturity, + } + return vals + + @api.multi + def _prepare_move_line_partner_account(self, bank_line): + # TODO : ALEXIS check don't group if move_line_id.account_id + # is not the same + if bank_line.payment_line_ids[0].move_line_id: + account_id =\ + bank_line.payment_line_ids[0].move_line_id.account_id.id + else: + if self.payment_type == 'inbound': + account_id =\ + bank_line.partner_id.property_account_receivable_id.id + else: + account_id =\ + bank_line.partner_id.property_account_payable_id.id + if self.payment_type == 'outbound': + name = _('Payment bank line %s') % bank_line.name + else: + name = _('Debit bank line %s') % bank_line.name + vals = { + 'name': name, + 'bank_payment_line_id': bank_line.id, + 'partner_id': bank_line.partner_id.id, + 'account_id': account_id, + 'credit': (self.payment_type == 'inbound' and + bank_line.amount_currency or 0.0), + 'debit': (self.payment_type == 'outbound' and + bank_line.amount_currency or 0.0), + } + return vals + + @api.multi + def generate_move(self): + """ + Create the moves that pay off the move lines from + the payment/debit order. + """ + self.ensure_one() + am_obj = self.env['account.move'] + # prepare a dict "trfmoves" that can be used when + # self.payment_mode_id.move_option = date or line + # key = unique identifier (date or True or line.id) + # value = bank_pay_lines (recordset that can have several entries) + trfmoves = {} + for bline in self.bank_line_ids: + hashcode = bline.move_line_offsetting_account_hashcode() + if hashcode in trfmoves: + trfmoves[hashcode] += bline + else: + trfmoves[hashcode] = bline + + company_currency = self.env.user.company_id.currency_id + for hashcode, blines in trfmoves.iteritems(): + mvals = self._prepare_move() + total_amount = 0 + for bline in blines: + total_amount += bline.amount_currency + if bline.currency_id != company_currency: + raise UserError(_( + "Cannot generate the account move when " + "the currency of the payment (%s) is not the " + "same as the currency of the company (%s). This " + "is not supported for the moment.") + % (bline.currency_id.name, company_currency.name)) + + partner_ml_vals = self._prepare_move_line_partner_account( + bline) + mvals['line_ids'].append((0, 0, partner_ml_vals)) + trf_ml_vals = self._prepare_move_line_offsetting_account( + total_amount, blines) + mvals['line_ids'].append((0, 0, trf_ml_vals)) + move = am_obj.create(mvals) + blines.reconcile_payment_lines() + move.post() diff --git a/account_payment_order/models/bank_payment_line.py b/account_payment_order/models/bank_payment_line.py new file mode 100644 index 00000000000..a1533f6adc0 --- /dev/null +++ b/account_payment_order/models/bank_payment_line.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +# © 2015 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ +from openerp.exceptions import UserError + + +class BankPaymentLine(models.Model): + _name = 'bank.payment.line' + _description = 'Bank Payment Lines' + + name = fields.Char( + string='Bank Payment Line Ref', required=True, + readonly=True) + order_id = fields.Many2one( + 'account.payment.order', string='Order', ondelete='cascade', + select=True) + payment_type = fields.Selection( + related='order_id.payment_type', string="Payment Type", + readonly=True, store=True) + state = fields.Selection( + related='order_id.state', string='State', + readonly=True, store=True) + payment_line_ids = fields.One2many( + 'account.payment.line', 'bank_line_id', string='Payment Lines', + readonly=True) + partner_id = fields.Many2one( + 'res.partner', related='payment_line_ids.partner_id', + readonly=True, store=True) # store=True for groupby + # Function Float fields are sometimes badly displayed in tree view, + # see bug report https://github.com/odoo/odoo/issues/8632 + # But is it still true in v9 ? + amount_currency = fields.Monetary( + string='Amount', currency_field='currency_id', + compute='_compute_amount', store=True, readonly=True) + currency_id = fields.Many2one( + 'res.currency', required=True, readonly=True, + related='payment_line_ids.currency_id') # v8 field: currency + partner_bank_id = fields.Many2one( + 'res.partner.bank', string='Bank Account', readonly=True, + related='payment_line_ids.partner_bank_id') # v8 field: bank_id + date = fields.Date( + related='payment_line_ids.date', readonly=True) + communication_type = fields.Selection( + related='payment_line_ids.communication_type', readonly=True) + communication = fields.Char( + string='Communication', required=True, + readonly=True) + company_id = fields.Many2one( + related='order_id.payment_mode_id.company_id', store=True, + readonly=True) + + @api.model + def same_fields_payment_line_and_bank_payment_line(self): + """ + This list of fields is used both to compute the grouping + hashcode and to copy the values from payment line + to bank payment line + The fields must have the same name on the 2 objects + """ + same_fields = [ + 'currency_id', 'partner_id', + 'partner_bank_id', 'date', 'communication_type'] + return same_fields + + @api.multi + @api.depends('payment_line_ids', 'payment_line_ids.amount_currency') + def _compute_amount(self): + for line in self: + line.amount_currency = sum( + line.mapped('payment_line_ids.amount_currency')) + + @api.model + @api.returns('self') + def create(self, vals): + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'bank.payment.line') or 'New' + return super(BankPaymentLine, self).create(vals) + + @api.multi + def move_line_offsetting_account_hashcode(self): + """ + This method is inherited in the module + account_banking_sepa_direct_debit + """ + self.ensure_one() + if self.order_id.payment_mode_id.move_option == 'date': + hashcode = self.date + else: + hashcode = unicode(self.id) + return hashcode + + @api.multi + def reconcile_payment_lines(self): + for bline in self: + if all([pline.move_line_id for pline in bline.payment_line_ids]): + bline.reconcile() + else: + bline.no_reconcile_hook() + + @api.multi + def no_reconcile_hook(self): + """This method is designed to be inherited if needed""" + return + + @api.multi + def reconcile(self): + self.ensure_one() + amlo = self.env['account.move.line'] + transit_mlines = amlo.search([('bank_payment_line_id', '=', self.id)]) + assert len(transit_mlines) == 1, 'We should have only 1 move' + transit_mline = transit_mlines[0] + assert not transit_mline.reconciled,\ + 'Transit move should not be reconciled' + lines_to_rec = transit_mline + for payment_line in self.payment_line_ids: + + if not payment_line.move_line_id: + raise UserError(_( + "Can not reconcile: no move line for " + "payment line %s of partner '%s'.") % ( + payment_line.name, + payment_line.partner_id.name)) + if payment_line.move_line_id.reconciled: + raise UserError(_( + "Move line '%s' of partner '%s' has already " + "been reconciled") % ( + payment_line.move_line_id.name, + payment_line.partner_id.name)) + if ( + payment_line.move_line_id.account_id != + transit_mline.account_id): + raise UserError(_( + "For partner '%s', the account of the account " + "move line to pay (%s) is different from the " + "account of of the transit move line (%s).") % ( + payment_line.move_line_id.partner_id.name, + payment_line.move_line_id.account_id.code, + transit_mline.account_id.code)) + + lines_to_rec += payment_line.move_line_id + + lines_to_rec.reconcile() diff --git a/account_payment_order/models/res_bank.py b/account_payment_order/models/res_bank.py new file mode 100644 index 00000000000..44dd6ecdbb9 --- /dev/null +++ b/account_payment_order/models/res_bank.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2015-2016 Akretion - Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, api, _ +from openerp.exceptions import ValidationError + + +class ResBank(models.Model): + _inherit = 'res.bank' + + @api.multi + @api.constrains('bic') + def check_bic_length(self): + for bank in self: + if bank.bic and len(bank.bic) not in (8, 11): + raise ValidationError(_( + "A valid BIC contains 8 or 11 characters. The BIC '%s' " + "contains %d characters, so it is not valid.") + % (bank.bic, len(bank.bic))) + +# in v9, on res.partner.bank bank_bic is a related of bank_id.bic diff --git a/account_payment_order/security/ir.model.access.csv b/account_payment_order/security/ir.model.access.csv new file mode 100644 index 00000000000..7537936467f --- /dev/null +++ b/account_payment_order/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_payment_order,Full access on account.payment.order to Payment Manager,model_account_payment_order,group_account_payment,1,1,1,1 +access_account_payment_line,Full access on account.payment.line to Payment Manager,model_account_payment_line,group_account_payment,1,1,1,1 +access_bank_payment_line,Full access on bank.payment.line to Payment Manager,model_bank_payment_line,group_account_payment,1,1,1,1 diff --git a/account_payment_order/security/payment_security.xml b/account_payment_order/security/payment_security.xml new file mode 100644 index 00000000000..cb5ce34f2d9 --- /dev/null +++ b/account_payment_order/security/payment_security.xml @@ -0,0 +1,39 @@ + + + + + + + Accounting / Payments + + + + + + + + + + + + Payment mode multi-company rule + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + + + + diff --git a/account_payment_order/static/description/icon.png b/account_payment_order/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/account_payment_order/test/data.yml b/account_payment_order/test/data.yml new file mode 100644 index 00000000000..c317b2059fa --- /dev/null +++ b/account_payment_order/test/data.yml @@ -0,0 +1,28 @@ +- + I create a transfer account +- + !record {model: account.account, id: account_account_transfer0}: + code: TRANSF + name: Transfer + user_type: account.data_account_type_liability + type: other + reconcile: True +- + I create a transfer journal +- + !record {model: account.journal, id: transfer_journal0}: + name: Transfer journal + code: TR + type: general + company_id: base.main_company +- + I create a payment mode +- + !record {model: payment.mode, id: payment_mode0}: + name: Payment Mode Test + journal: account.bank_journal + bank_id: account_payment.partner_bank_1 + company_id: base.main_company + transfer_account_id: account_account_transfer0 + transfer_journal_id: transfer_journal0 + type: account_banking_payment_export.manual_bank_tranfer diff --git a/account_payment_order/test/test_partial_payment_refunded.yml b/account_payment_order/test/test_partial_payment_refunded.yml new file mode 100644 index 00000000000..529a04e88e9 --- /dev/null +++ b/account_payment_order/test/test_partial_payment_refunded.yml @@ -0,0 +1,134 @@ +- + I create a supplier invoice +- + !record {model: account.invoice, id: account_invoice_supplier_refunded, view: account.invoice_supplier_form}: + check_total: 600.00 + partner_id: base.res_partner_12 + reference_type: none + type: in_invoice + account_id: account.a_pay + company_id: base.main_company + currency_id: base.EUR + invoice_line: + - account_id: account.a_expense + name: 'Some contact lenses' + price_unit: 600.00 + quantity: 1.0 + journal_id: account.expenses_journal +- + Make sure that the type is in_invoice +- + !python {model: account.invoice}: | + self.write(cr, uid, ref("account_invoice_supplier_refunded"), {'type': 'in_invoice'}) +- + I change the state of invoice to open by clicking Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier_refunded} +- + I create a supplier refund for this invoice +- + !record {model: account.invoice, id: account_refund_supplier_refunded, view: account.invoice_supplier_form}: + check_total: 200.00 + partner_id: base.res_partner_12 + reference_type: none + type: in_refund + account_id: account.a_pay + company_id: base.main_company + currency_id: base.EUR + invoice_line: + - account_id: account.a_expense + name: 'Some contact lenses' + price_unit: 200.00 + quantity: 1.0 + journal_id: account.expenses_journal +- + Make sure that the type is in_refund +- + !python {model: account.invoice}: | + self.write(cr, uid, ref("account_refund_supplier_refunded"), {'type': 'in_refund'}) +- + I change the state of invoice to open by clicking Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_refund_supplier_refunded} +- + I create a payment order +- + !record {model: payment.order, id: partial_payment_order_1}: + mode: account_banking_payment_transfer.payment_mode0 + date_prefered: 'now' +- + I run the select move line to pay wizard +- + !python {model: payment.order.create}: | + context = { + "active_model": "payment.order", + "active_ids": [ref("partial_payment_order_1")], + "active_id": ref("partial_payment_order_1"), + } + wiz_id = self.create(cr, uid, {}, context=context) + self.search_entries(cr, uid, [wiz_id], context=context) + mline_ids = [] + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_refunded")) + for l in invoice.move_id.line_id: + if not l.debit and l.credit: + mline_ids.append(l.id) + break + refund = self.pool.get('account.invoice').browse(cr, uid, ref("account_refund_supplier_refunded")) + for l in refund.move_id.line_id: + if not l.credit and l.debit: + mline_ids.append(l.id) + break + self.write(cr, uid, [wiz_id], {'entries': [(6, 0, mline_ids)]}) + self.create_payment(cr, uid, [wiz_id], context=context) + pay_obj = self.pool.get('payment.order') + pay = pay_obj.browse(cr, uid, ref('partial_payment_order_1')) + assert len(pay.line_ids) == 2 +- + I confirm the payment order. +- + !workflow {model: payment.order, action: open, ref: partial_payment_order_1} +- + I check that payment order is now "Confirmed". +- + !assert {model: payment.order, id: partial_payment_order_1, severity: error, string: Payment Order should be 'Confirmed'.}: + - state == 'open' + - total == 400.0 +- + I create the wizard for paying the payment +- + !record {model: payment.manual, id: payment_manual_partial}: + create_date: !eval time.strftime('%Y-%m-%d') +- + I click OK +- + !python {model: payment.manual}: | + if context is None: + context = {} + context.update({'active_ids': [ref("partial_payment_order_1")]}) + self.button_ok(cr, uid, ref("payment_manual_partial"), context) +- + I check that the payment order is now "Sent". +- + !assert {model: payment.order, id: partial_payment_order_1, severity: error, string: Payment Order should be 'Sent'.}: + - state == 'sent' +- + I check that the invoice has payments associated +- + !assert {model: account.invoice, id: account_invoice_supplier_refunded, severity: error, string: payment_ids should be populated}: + - payment_ids +- + I check the content of the payment of the invoice +- + !python {model: account.invoice}: | + inv = self.browse(cr, uid, ref("account_invoice_supplier_refunded")) + payment1, payment2 = sorted(inv.payment_ids, key=lambda line: line.id) + assert payment1.debit == 200 + assert payment2.debit == 400 + assert inv.payment_ids[0].reconcile_id.id != False +- + I check that the invoice balance (residual) is now 0 and the state is paid +- + !assert {model: account.invoice, id: account_invoice_supplier_refunded, severity: error, string: Invoice residual should be 0.}: + - residual == 0 + - amount_total == 600 + - state == 'paid' diff --git a/account_payment_order/test/test_partial_payment_transfer.yml b/account_payment_order/test/test_partial_payment_transfer.yml new file mode 100644 index 00000000000..2e7a05a7c69 --- /dev/null +++ b/account_payment_order/test/test_partial_payment_transfer.yml @@ -0,0 +1,252 @@ +- + I create a supplier invoice +- + !record {model: account.invoice, id: account_invoice_supplier_partial, view: account.invoice_supplier_form}: + check_total: 1000.00 + partner_id: base.res_partner_12 + reference_type: none + type: in_invoice + account_id: account.a_pay + company_id: base.main_company + currency_id: base.EUR + invoice_line: + - account_id: account.a_expense + name: 'Some glasses' + price_unit: 1000.00 + quantity: 1.0 + journal_id: account.expenses_journal +- + Make sure that the type is in_invoice +- + !python {model: account.invoice}: | + self.write(cr, uid, ref("account_invoice_supplier_partial"), {'type': 'in_invoice'}) +- + I change the state of invoice to open by clicking Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier_partial} +- + I create a payment order +- + !record {model: payment.order, id: partial_payment_order_2}: + mode: account_banking_payment_transfer.payment_mode0 + date_prefered: 'due' +- + I run the select move line to pay wizard +- + !python {model: payment.order.create}: | + context = { + "active_model": "payment.order", + "active_ids": [ref("partial_payment_order_2")], + "active_id": ref("partial_payment_order_2"), + } + wiz_id = self.create(cr, uid, {}, context=context) + self.search_entries(cr, uid, [wiz_id], context=context) + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial")) + move_line = invoice.move_id.line_id[0] + self.write(cr, uid, [wiz_id], {'entries': [(6, 0, [move_line.id])]}) + self.create_payment(cr, uid, [wiz_id], context=context) + pay_obj = self.pool.get('payment.order') + pay = pay_obj.browse(cr, uid, ref('partial_payment_order_2')) + assert pay.line_ids + assert pay.line_ids[0].amount_currency == 1000.0 +- + I change the amount paid to test the partial payment +- + !python {model: payment.order}: | + line_ids = self.browse(cr, uid, ref('partial_payment_order_2')).line_ids + line_to_change = line_ids[0] + assert line_to_change.amount_currency == 1000.00 + self.pool.get('payment.line').write(cr, uid, line_to_change.id, {'amount_currency':100}) +- + I confirm the payment order. +- + !workflow {model: payment.order, action: open, ref: partial_payment_order_2} +- + I check that payment order is now "Confirmed". +- + !assert {model: payment.order, id: partial_payment_order_2, severity: error, string: Payment Order should be 'Confirmed'.}: + - state == 'open' +- + I assume that the document is sent to the bank and validate. +- + !record {model: payment.manual, id: payment_manual_1}: + create_date: !eval time.strftime('%Y-%m-%d') +- + I click OK +- + !python {model: payment.manual}: | + if context is None: + context = {} + context.update({'active_ids': [ref("partial_payment_order_2")]}) + self.button_ok(cr, uid, ref("payment_manual_1"), context) +- + I check that the payment order is now "Sent". +- + !assert {model: payment.order, id: partial_payment_order_2, severity: error, string: Payment Order should be 'Sent'.}: + - state == 'sent' +- + I check that the invoice has payments associated +- + !assert {model: account.invoice, id: account_invoice_supplier_partial, severity: error, string: payment_ids should be populated}: + - payment_ids +- + I check the content of the payment of the invoice +- + !python {model: account.invoice}: | + inv = self.browse(cr, uid, ref("account_invoice_supplier_partial")) + assert round(inv.payment_ids[0].debit, 2) == 100 + assert inv.payment_ids[0].credit == 0 + assert not inv.payment_ids[0].reconcile_id.id + assert inv.payment_ids[0].reconcile_partial_id + sum_debit = 0.0 + sum_credit = 0.0 + for line in inv.payment_ids[0].reconcile_partial_id.line_partial_ids: + sum_debit += line.debit + sum_credit += line.credit + assert sum_debit == 100 + sum_credit == 1000 + assert inv.residual == 900 + assert inv.state == 'open' +- + I create a 2nd partial payment +- + !record {model: payment.order, id: partial_partial_payment_order_2}: + mode: account_banking_payment_transfer.payment_mode0 + date_prefered: 'due' +- + I search for the invoice entries to make the payment. +- + !python {model: payment.order.create}: | + context = { + "active_model": "payment.order", + "active_ids": [ref("partial_partial_payment_order_2")], + "active_id": ref("partial_partial_payment_order_2"), + } + wiz_id = self.create(cr, uid, {}, context=context) + self.search_entries(cr, uid, [wiz_id], context=context) + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial")) + for l in invoice.move_id.line_id: + if not l.debit and l.credit: + move_line = l + break + self.write(cr, uid, [wiz_id], {'entries': [(6,0,[move_line.id])]}) + self.create_payment(cr, uid, [wiz_id], context=context) + pay_obj = self.pool.get('payment.order') + pay = pay_obj.browse(cr, uid, ref('partial_partial_payment_order_2')) + assert len(pay.line_ids) == 1 + assert pay.line_ids[0].amount_currency == 900 +- + I change the amount paid to test the partial payment +- + !python {model: payment.order}: | + line_ids = self.browse(cr, uid, ref('partial_partial_payment_order_2')).line_ids + line_to_change = line_ids[0] + self.pool.get('payment.line').write(cr, uid, line_to_change.id, {'amount_currency':200}) +- + I confirm the payment order. +- + !workflow {model: payment.order, action: open, ref: partial_partial_payment_order_2} +- + I assume that the document is sent to the bank and validate. +- + !record {model: payment.manual, id: payment_manual_1}: + create_date: !eval time.strftime('%Y-%m-%d') +- + I click OK +- + !python {model: payment.manual}: | + if context is None: + context = {} + context.update({'active_ids': [ref("partial_partial_payment_order_2")]}) + self.button_ok(cr, uid, ref("payment_manual_1"), context) +- + I check that the payment order is now "Sent". +- + !assert {model: payment.order, id: partial_partial_payment_order_2, severity: error, string: Payment Order should be 'Sent'.}: + - state == 'sent' +- + I check the content of the payment of the invoice +- + !python {model: account.invoice}: | + inv = self.browse(cr, uid, ref("account_invoice_supplier_partial")) + assert len(inv.payment_ids) == 2 + assert inv.payment_ids[0].credit == 0 + assert not inv.payment_ids[0].reconcile_id.id + assert inv.payment_ids[0].reconcile_partial_id + sum_debit = 0.0 + sum_credit = 0.0 + for line in inv.payment_ids[0].reconcile_partial_id.line_partial_ids: + sum_debit += line.debit + sum_credit += line.credit + assert sum_debit == 300 + assert sum_credit == 1000 + assert inv.residual == 700 + assert inv.state == 'open' +- + I create the last partial payment for completing the payment +- + !record {model: payment.order, id: partial_partial_payment_order_3}: + mode: account_banking_payment_transfer.payment_mode0 + date_prefered: 'due' +- + I search for the invoice entries to make the payment. +- + !python {model: payment.order.create}: | + context = { + "active_model": "payment.order", + "active_ids": [ref("partial_partial_payment_order_3")], + "active_id": ref("partial_partial_payment_order_3"), + } + wiz_id = self.create(cr, uid, {}, context=context) + self.search_entries(cr, uid, [wiz_id], context=context) + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial")) + for l in invoice.move_id.line_id: + if not l.debit and l.credit: + move_line = l + break + self.write(cr, uid, [wiz_id], {'entries': [(6, 0, [move_line.id])]}) + self.create_payment(cr, uid, [wiz_id], context=context) + pay_obj = self.pool.get('payment.order') + pay = pay_obj.browse(cr, uid, ref('partial_partial_payment_order_3')) + assert len(pay.line_ids) == 1 + assert pay.line_ids[0].amount_currency == 700 +- + I confirm the payment order. +- + !workflow {model: payment.order, action: open, ref: partial_partial_payment_order_3} +- + I assume that the document is sent to the bank and validate. +- + !record {model: payment.manual, id: payment_manual_3}: + create_date: !eval time.strftime('%Y-%m-%d') +- + I click OK +- + !python {model: payment.manual}: | + if context is None: + context = {} + context.update({'active_ids': [ref("partial_partial_payment_order_3")]}) + self.button_ok(cr, uid, ref("payment_manual_3"), context) +- + I check that the payment order is now "Sent". +- + !assert {model: payment.order, id: partial_partial_payment_order_3, severity: error, string: Payment Order should be 'Sent'.}: + - state == 'sent' +- + I check the content of the payment of the invoice +- + !python {model: account.invoice}: | + inv = self.browse(cr, uid, ref("account_invoice_supplier_partial")) + assert len(inv.payment_ids) == 3 + assert inv.payment_ids[0].credit == 0 + assert inv.payment_ids[0].reconcile_id.id + #assert not inv.payment_ids[0].reconcile_partial_id ?? should we remove it? + sum_debit = 0.0 + sum_credit = 0.0 + for line in inv.payment_ids: + sum_debit += line.debit + sum_credit += line.credit + assert sum_debit == 1000 + assert sum_credit == 0 + assert inv.residual == 0 + assert inv.state == 'paid' diff --git a/account_payment_order/test/test_payment_method.yml b/account_payment_order/test/test_payment_method.yml new file mode 100644 index 00000000000..4a74dd8958d --- /dev/null +++ b/account_payment_order/test/test_payment_method.yml @@ -0,0 +1,159 @@ +- + I create a supplier invoice +- + !record {model: account.invoice, id: account_invoice_supplier0, view: account.invoice_supplier_form}: + check_total: 1005.55 + partner_id: base.res_partner_4 + reference_type: none + type: in_invoice + account_id: account.a_pay + company_id: base.main_company + currency_id: base.EUR + invoice_line: + - account_id: account.a_expense + name: 'Some expenses' + price_unit: 450.0 + quantity: 1.0 + - account_id: account.a_expense + name: 'Some other expenses' + price_unit: 555.55 + quantity: 1.0 + journal_id: account.expenses_journal +- + Make sure that the type is in_invoice +- + !python {model: account.invoice}: | + self.write(cr, uid, ref("account_invoice_supplier0"), {'type': 'in_invoice'}) +- + I change the state of invoice to open by clicking Validate button +- + !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier0} +- + I check that the invoice state is now "Open" +- + !assert {model: account.invoice, id: account_invoice_supplier0}: + - state == 'open' + - type == 'in_invoice' +- + I create a payment order +- + !record {model: payment.order, id: payment_order_0}: + mode: account_banking_payment_transfer.payment_mode0 + date_prefered: 'due' +- + I run the select move line to pay wizard +- + !python {model: payment.order.create}: | + context = { + "active_model": "payment.order", + "active_ids": [ref("payment_order_0")], + "active_id": ref("payment_order_0"), + } + wiz_id = self.create(cr, uid, {}, context=context) + self.search_entries(cr, uid, [wiz_id], context=context) + invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier0")) + entries = [] + for move_line in invoice.move_id.line_id: + if move_line.credit and not move_line.debit: + entries.append((6, 0, [move_line.id])) + self.write(cr, uid, [wiz_id], {'entries': entries}) + self.create_payment(cr, uid, [wiz_id], context=context) + pay_obj = self.pool.get('payment.order') + pay = pay_obj.browse(cr, uid, ref('payment_order_0')) + for line in pay.line_ids: + assert line.amount != 0.0 +- + I confirm the payment order. +- + !workflow {model: payment.order, action: open, ref: payment_order_0} +- + I check that payment order is now "Confirmed". +- + !assert {model: payment.order, id: payment_order_0, severity: error, string: Payment Order should be 'Confirmed'.}: + - state == 'open' +- + I create the wizard for paying the payment +- + !record {model: payment.manual, id: payment_manual_0}: + create_date: !eval time.strftime('%Y-%m-%d') +- + I click OK +- + !python {model: payment.manual}: | + if context is None: + context = {} + context.update({'active_ids': [ref("payment_order_0")]}) + self.button_ok(cr, uid, ref("payment_manual_0"), context) +- + I check that the payment order is now "Sent". +- + !assert {model: payment.order, id: payment_order_0, severity: error, string: Payment Order should be 'Sent'.}: + - state == 'sent' +- + I check that the invoice has payments associated +- + !assert {model: account.invoice, id: account_invoice_supplier0, severity: error, string: payment_ids should be populated}: + - payment_ids +- + I check the content of the payment of the invoice +- + !python {model: account.invoice}: | + inv = self.browse(cr, uid, ref("account_invoice_supplier0")) + assert round(inv.payment_ids[0].debit, 2) == 1005.55 + assert inv.payment_ids[0].credit == 0 + assert inv.payment_ids[0].reconcile_id.id != False + assert inv.payment_ids[0].reconcile_ref != False + assert inv.state == 'paid' +- + I create the bank statement to reconcile the transfer account move +- + !record {model: account.bank.statement, id: bank_statement_0}: + name: BK test + balance_end_real: 0.0 + balance_start: 0.0 + date: !eval time.strftime('%Y-%m-%d') + journal_id: account.bank_journal +- + I create bank statement line +- + !python {model: account.bank.statement.line}: | + vals = { + 'amount': -1005.55, + 'partner_id': ref('base.res_partner_4'), + 'statement_id': ref('bank_statement_0'), + 'name': 'Pay invoice', + 'journal_id': ref("account.bank_journal"), + } + line_id = self.create(cr, uid, vals) + assert line_id, "Account bank statement line has not been created" +- + I reconcile the move transfer (not the invoice) with the payment. +- + !python {model: account.bank.statement}: | + inv_obj = self.pool.get('account.invoice') + statement_obj = self.pool.get('account.bank.statement.line') + transfer_entry = inv_obj.browse(cr, uid, ref("account_invoice_supplier0")).payment_ids[0].move_id + for line in transfer_entry.line_id: + if not line.reconcile_id and line.credit: + counterpart_move_line = line + break + browse_payment = self.browse(cr, uid, ref("bank_statement_0")) + for line in browse_payment.line_ids: + statement_obj.process_reconciliation(cr, uid, line.id, [{ + 'counterpart_move_line_id': counterpart_move_line.id, + 'credit':0, + 'debit': counterpart_move_line.credit, + 'name': line.name, + }]) + self.write(cr, uid, ref("bank_statement_0"), {'balance_end_real': -1005.55}) + self.button_confirm_bank(cr, uid, ref("bank_statement_0")) +- + I check that the bank statement is confirm +- + !assert {model: account.bank.statement, id: bank_statement_0, severity: error, string: Bank Statement should be confirm}: + - state == 'confirm' +- + I check that the payment is done +- + !assert {model: payment.order, id: payment_order_0, severity: error, string: Payment Order should be done}: + - state == 'done' diff --git a/account_payment_order/views/account_invoice_view.xml b/account_payment_order/views/account_invoice_view.xml new file mode 100644 index 00000000000..2ca7919ff99 --- /dev/null +++ b/account_payment_order/views/account_invoice_view.xml @@ -0,0 +1,62 @@ + + + + + + + + account_payment_order.invoice_form + account.invoice + + + + + + + + + + + + account_payment_order.invoice_supplier_form + account.invoice + + + + + + + + + + + + + + diff --git a/account_payment_order/views/account_move_line.xml b/account_payment_order/views/account_move_line.xml new file mode 100644 index 00000000000..1179fe81785 --- /dev/null +++ b/account_payment_order/views/account_move_line.xml @@ -0,0 +1,28 @@ + + + + + + + + + + account_payment_order.move_line_form + account.move.line + + + + + + + + + + + + diff --git a/account_payment_order/views/account_payment_line.xml b/account_payment_order/views/account_payment_line.xml new file mode 100644 index 00000000000..c1155ac030a --- /dev/null +++ b/account_payment_order/views/account_payment_line.xml @@ -0,0 +1,69 @@ + + + + + + + account.payment.line.form + account.payment.line + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + account.payment.line.tree + account.payment.line + + + + + + + + + + + + + + + + + + + Payment Lines + account.payment.line + tree,form + {'account_payment_line_main_view': True} + + + +
+
diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml new file mode 100644 index 00000000000..951c59bf31a --- /dev/null +++ b/account_payment_order/views/account_payment_mode.xml @@ -0,0 +1,66 @@ + + + + + + + account_payment_order.account.payment.mode.form + account.payment.mode + + + + + + + + + + + + + + + + + + + + + + + + + + + + account_payment_order.account.payment.mode.tree + account.payment.mode + + + + + + + + + + account_payment_order.account.payment.mode.search + account.payment.mode + + + + + + + + + + diff --git a/account_payment_order/views/account_payment_order.xml b/account_payment_order/views/account_payment_order.xml new file mode 100644 index 00000000000..eec3c0e83fa --- /dev/null +++ b/account_payment_order/views/account_payment_order.xml @@ -0,0 +1,163 @@ + + + + + + + account.payment.order.form + account.payment.order + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + account.payment.order.tree + account.payment.order + + + + + + + + + + + + + + + + account.payment.order.search + account.payment.order + + + + + + + + + + + + + + + + + + + account.payment.order.graph + account.payment.order + + + + + + + + + + account.payment.order.pivot + account.payment.order + + + + + + + + + + + Payment Orders + account.payment.order + tree,form,pivot,graph + [('payment_type', '=', 'outbound')] + {'default_payment_type': 'outbound'} + + + + Debit Orders + account.payment.order + tree,form,pivot,graph + [('payment_type', '=', 'inbound')] + {'default_payment_type': 'inbound'} + + + + + + + + +
+
diff --git a/account_payment_order/views/bank_payment_line.xml b/account_payment_order/views/bank_payment_line.xml new file mode 100644 index 00000000000..f5ce6742a30 --- /dev/null +++ b/account_payment_order/views/bank_payment_line.xml @@ -0,0 +1,83 @@ + + + + + + + bank.payment.line.form + bank.payment.line + +
+ + + + + + + + + + + + + + + +
+
+
+ + + bank.payment.line.tree + bank.payment.line + + + + + + + + + + + + + + + + + bank.payment.line.search + bank.payment.line + + + + + + + + + + + + + + + Bank Payment Lines + bank.payment.line + tree,form + {'bank_payment_line_main_view': True} + + + + +
+
diff --git a/account_payment_order/views/ir_attachment.xml b/account_payment_order/views/ir_attachment.xml new file mode 100644 index 00000000000..98f5ac99141 --- /dev/null +++ b/account_payment_order/views/ir_attachment.xml @@ -0,0 +1,32 @@ + + + + + + + ir.attachment.simplified.form + ir.attachment + +
+ + +
+
+
+ +
+
diff --git a/account_payment_order/views/payment_order_create_view.xml b/account_payment_order/views/payment_order_create_view.xml new file mode 100644 index 00000000000..8a6d69a47dc --- /dev/null +++ b/account_payment_order/views/payment_order_create_view.xml @@ -0,0 +1,23 @@ + + + + + + + add.context.to.display.maturity.date + payment.order.create + + + + {'journal_type': 'sale'} + 1 + + + + + + diff --git a/account_payment_order/wizard/__init__.py b/account_payment_order/wizard/__init__.py new file mode 100644 index 00000000000..1262d2ded0b --- /dev/null +++ b/account_payment_order/wizard/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import account_payment_line_create +from . import account_invoice_payment_line_multi diff --git a/account_payment_order/wizard/account_invoice_payment_line_multi.py b/account_payment_order/wizard/account_invoice_payment_line_multi.py new file mode 100644 index 00000000000..0abd6766951 --- /dev/null +++ b/account_payment_order/wizard/account_invoice_payment_line_multi.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, api + + +class AccountInvoicePaymentLineMulti(models.TransientModel): + _name = 'account.invoice.payment.line.multi' + _description = 'Create payment lines from invoice tree view' + + @api.multi + def run(self): + self.ensure_one() + assert self._context['active_model'] == 'account.invoice',\ + 'Active model should be account.invoice' + invoices = self.env['account.invoice'].browse( + self._context['active_ids']) + action = invoices.create_account_payment_line() + return action diff --git a/account_payment_order/wizard/account_invoice_payment_line_multi_view.xml b/account_payment_order/wizard/account_invoice_payment_line_multi_view.xml new file mode 100644 index 00000000000..b8a0447f216 --- /dev/null +++ b/account_payment_order/wizard/account_invoice_payment_line_multi_view.xml @@ -0,0 +1,31 @@ + + + + + + + + + account_invoice_payment_line_multi.form + account.invoice.payment.line.multi + +
+

This wizard will create payment lines for the selected invoices:

+
    +
  • if there are existing draft payment orders for the payment modes of the invoices, the payment lines will be added to those payment orders
  • +
  • otherwise, new payment orders will be created (one per payment mode).
  • +
+
+
+
+
+
+ + +
+
diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py new file mode 100644 index 00000000000..f131db88645 --- /dev/null +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- +# © 2009 EduSense BV () +# © 2011-2013 Therp BV () +# © 2014-2015 ACSONE SA/NV () +# © 2015-2016 Akretion () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api, _ + + +class AccountPaymentLineCreate(models.TransientModel): + _name = 'account.payment.line.create' + _description = 'Wizard to create payment lines' + + order_id = fields.Many2one( + 'account.payment.order', string='Payment Order') + journal_ids = fields.Many2many( + 'account.journal', string='Journals Filter') + target_move = fields.Selection([ + ('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves') + allow_blocked = fields.Boolean( + string='Allow Litigation Move Lines') + invoice = fields.Boolean( + string='Linked to an Invoice or Refund') + date_type = fields.Selection([ + ('due', 'Due Date'), + ('move', 'Move Date'), + ], string="Type of Date Filter", required=True) + due_date = fields.Date(string="Due Date") + move_date = fields.Date( + string='Move Date', default=fields.Date.context_today) + payment_mode = fields.Selection([ + ('same', 'Same'), + ('same_or_null', 'Same or Empty'), + ('any', 'Any'), + ], string='Payment Mode') + move_line_ids = fields.Many2many( + 'account.move.line', string='Move Lines') + + @api.model + def default_get(self, field_list): + res = super(AccountPaymentLineCreate, self).default_get(field_list) + context = self.env.context + assert context.get('active_model') == 'account.payment.order',\ + 'active_model should be payment.order' + assert context.get('active_id'), 'Missing active_id in context !' + order = self.env['account.payment.order'].browse(context['active_id']) + mode = order.payment_mode_id + res.update({ + 'journal_ids': mode.default_journal_ids.ids or False, + 'target_move': mode.default_target_move, + 'invoice': mode.default_invoice, + 'date_type': mode.default_date_type, + 'payment_mode': mode.default_payment_mode, + 'order_id': order.id, + }) + return res + + @api.multi + def _prepare_move_line_domain(self): + self.ensure_one() + journals = self.journal_ids or self.env['account.journal'].search([]) + domain = [('reconciled', '=', False), + ('company_id', '=', self.order_id.company_id.id), + ('journal_id', 'in', journals.ids)] + if self.target_move == 'posted': + domain += [('move_id.state', '=', 'posted')] + if not self.allow_blocked: + domain += [('blocked', '!=', True)] + if self.date_type == 'due': + domain += [ + '|', + ('date_maturity', '<=', self.due_date), + ('date_maturity', '=', False)] + elif self.date_type == 'move': + domain.append(('date', '<=', self.move_date)) + if self.invoice: + domain.append(('invoice_id', '!=', False)) + if self.payment_mode: + if self.payment_mode == 'same': + domain.append( + ('payment_mode_id', '=', self.order_id.payment_mode_id.id)) + elif self.payment_mode == 'same_or_null': + domain += [ + '|', + ('payment_mode_id', '=', False), + ('payment_mode_id', '=', self.order_id.payment_mode_id.id)] + + if self.order_id.payment_type == 'outbound': + # For payables, propose all unreconciled credit lines, + # including partially reconciled ones. + # If they are partially reconciled with a supplier refund, + # the residual will be added to the payment order. + # + # For receivables, propose all unreconciled credit lines. + # (ie customer refunds): they can be refunded with a payment. + # Do not propose partially reconciled credit lines, + # as they are deducted from a customer invoice, and + # will not be refunded with a payment. + domain += [ + ('credit', '>', 0), + # '|', + ('account_id.internal_type', '=', 'payable'), + # '&', + # ('account_id.internal_type', '=', 'receivable'), + # ('reconcile_partial_id', '=', False), # TODO uncomment + ] + elif self.order_id.payment_type == 'inbound': + domain += [ + ('debit', '>', 0), + ('account_id.internal_type', '=', 'receivable'), + ] + # Exclude lines that are already in a non-cancelled payment order + paylines = self.env['account.payment.line'].search([ + ('state', '!=', 'cancel'), + ('move_line_id', '!=', False)]) + if paylines: + move_lines_ids = [payline.move_line_id.id for payline in paylines] + domain += [('id', 'not in', move_lines_ids)] + return domain + + @api.multi + def populate(self): + domain = self._prepare_move_line_domain() + lines = self.env['account.move.line'].search(domain) + self.move_line_ids = lines + action = { + 'name': _('Select Move Lines to Create Transactions'), + 'type': 'ir.actions.act_window', + 'res_model': 'account.payment.line.create', + 'view_mode': 'form', + 'target': 'new', + 'res_id': self.id, + 'context': self._context, + } + return action + + @api.onchange( + 'date_type', 'move_date', 'due_date', 'journal_ids', 'invoice') + def move_line_filters_change(self): + domain = self._prepare_move_line_domain() + res = {'domain': {'move_line_ids': domain}} + return res + + @api.multi + def create_payment_lines(self): + if self.move_line_ids: + self.move_line_ids.create_payment_line_from_move_line( + self.order_id) + return True diff --git a/account_payment_order/wizard/account_payment_line_create_view.xml b/account_payment_order/wizard/account_payment_line_create_view.xml new file mode 100644 index 00000000000..de7d836d0ee --- /dev/null +++ b/account_payment_order/wizard/account_payment_line_create_view.xml @@ -0,0 +1,65 @@ + + + + + + + account_payment_line_create.form + account.payment.line.create + +
+ + + + + + + + + + +