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
This commit is contained in:
Alexis de Lattre
2016-04-30 01:46:34 +02:00
committed by Pedro M. Baeza
parent 5f51370795
commit c51c659623
41 changed files with 5186 additions and 0 deletions

View File

@@ -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
<https://github.com/OCA/bank-payment/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 <stephane.bidoul@acsone.eu>
* Alexis de Lattre <alexis.delattre@akretion.com>
* Pedro M. Baeza
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* Stefan Rijnhart
* Laurent Mignon <laurent.mignon@acsone.eu>
* Alexandre Fayolle
* Danimar Ribeiro
* Erwin van der Ploeg
* Raphaël Valyi
* Sandy Carter
* Angel Moya <angel.moya@domatix.com>
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.

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
from . import wizard

View File

@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# © 2014-2016 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2016 Akretion (<http://www.akretion.com>).
# 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,
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add manual bank transfer as default payment option -->
<record model="payment.mode.type" id="manual_bank_tranfer">
<field name="name">Manual Bank Transfer</field>
<field name="code">BANKMAN</field>
<field name="suitable_bank_types"
eval="[(6,0,[ref('base.bank_normal'),ref('base_iban.bank_iban'),])]" />
<field name="ir_model_id"
ref="model_payment_manual"/>
<field name="payment_order_type">payment</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="bank_payment_line_seq" model="ir.sequence">
<field name="name">Bank Payment Line</field>
<field name="code">bank.payment.line</field>
<field name="prefix">L</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
<record id="account_payment_line_seq" model="ir.sequence">
<field name="name">Payment Line</field>
<field name="code">account.payment.line</field>
<field name="prefix">P</field>
<field name="padding">5</field>
<field name="company_id" eval="False"/>
</record>
<record id="account_payment_order_seq" model="ir.sequence">
<field name="name">Payment Order</field>
<field name="code">account.payment.order</field>
<field name="prefix">PAY</field>
<field name="padding">4</field>
<field name="company_id" eval="False"/>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="account_payment_mode.payment_mode_outbound_dd1" model="account.payment.mode">
<field name="payment_order_ok" eval="False"/>
</record>
<record id="account_payment_mode.payment_mode_outbound_dd2" model="account.payment.mode">
<field name="payment_order_ok" eval="False"/>
</record>
<record id="account_payment_mode.payment_mode_inbound_ct1" model="account.payment.mode">
<field name="payment_order_ok" eval="False"/>
</record>
<record id="account_payment_mode.payment_mode_inbound_ct2" model="account.payment.mode">
<field name="payment_order_ok" eval="False"/>
</record>
<record id="account_payment_mode.payment_mode_outbound_ct1" model="account.payment.mode">
<!-- Credit Transfer to Suppliers -->
<field name="default_journal_ids" search="[('type', 'in', ('purchase', 'purchase_refund'))]"/>
</record>
<record id="account_payment_mode.payment_mode_inbound_dd1" model="account.payment.mode">
<!-- Direct Debit of customers -->
<field name="default_journal_ids" search="[('type', 'in', ('sale', 'sale_refund'))]"/>
</record>
</data>
</openerp>

View File

@@ -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 <transbot@odoo-community.org>\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')]}"

View File

@@ -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 ""

View File

@@ -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 <transbot@odoo-community.org>\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 ""

View File

@@ -0,0 +1,489 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_payment_export
#
# Translators:
# danimaribeiro <danimaribeiro@gmail.com>, 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 <danimaribeiro@gmail.com>\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 ""

View File

@@ -0,0 +1,489 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_payment_export
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 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č <m.mozetic@matmoz.si>\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')]}"

View File

@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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')

View File

@@ -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

View File

@@ -0,0 +1,110 @@
# -*- coding: utf-8 -*-
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# © 2014 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
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

View File

@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# © 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
class AccountMove(models.Model):
_inherit = 'account.move'
payment_order_id = fields.Many2one(
'account.payment.order', string='Payment Order', copy=False,
readonly=True)

View File

@@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# © 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

View File

@@ -0,0 +1,137 @@
# -*- coding: utf-8 -*-
# © 2015-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
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)

View File

@@ -0,0 +1,135 @@
# -*- coding: utf-8 -*-
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014-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 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

View File

@@ -0,0 +1,440 @@
# -*- coding: utf-8 -*-
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 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()

View File

@@ -0,0 +1,145 @@
# -*- coding: utf-8 -*-
# © 2015 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
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()

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2015-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, 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

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_payment_order Full access on account.payment.order to Payment Manager model_account_payment_order group_account_payment 1 1 1 1
3 access_account_payment_line Full access on account.payment.line to Payment Manager model_account_payment_line group_account_payment 1 1 1 1
4 access_bank_payment_line Full access on bank.payment.line to Payment Manager model_bank_payment_line group_account_payment 1 1 1 1

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="group_account_payment" model="res.groups">
<field name="name">Accounting / Payments</field>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
<field name="category_id" ref="base.module_category_extra"/>
</record>
</data>
<data noupdate="1">
<record id="account_payment_mode_company_rule" model="ir.rule">
<field name="name">Payment mode multi-company rule</field>
<field name="model_id" ref="model_account_payment_mode"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
<!--
<record id="account_payment_order_company_rule" model="ir.rule">
<field name="name">Payment order multi-company rule</field>
<field name="model_id" ref="model_account_payment_order"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
<record id="account_payment_line_company_rule" model="ir.rule">
<field name="name">Payment line multi-company rule</field>
<field name="model_id" ref="model_account_payment_line"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
-->
</data>
</openerp>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -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

View File

@@ -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'

View File

@@ -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'

View File

@@ -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'

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">account_payment_order.invoice_form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_payment_partner.invoice_form" />
<field name="arch" type="xml">
<button name="%(account.action_account_invoice_payment)d" type="action" position="after">
<button name="create_account_payment_line" type="object"
string="Add to Debit Order"
groups="account_payment_order.group_account_payment"
attrs="{'invisible': ['|', ('payment_order_ok', '=', False), ('state', '!=', 'open')]}"/>
<!-- For customer refunds:
'Add to Direct Debit Order' will deduct the refund from a customer invoice
We could also need a button 'Add to Payment Order' to reimburse
a customer via wire transfer... but I prefer to keep things
simple ; to do that, the user should manually create a payment order
and select the move lines -->
</button>
<field name="payment_mode_id" position="after">
<field name="payment_order_ok" invisible="1"/>
</field>
</field>
</record>
<record id="invoice_supplier_form" model="ir.ui.view">
<field name="name">account_payment_order.invoice_supplier_form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_payment_partner.invoice_supplier_form" />
<field name="arch" type="xml">
<button name="%(account.action_account_invoice_payment)d" type="action" position="after">
<button name="create_account_payment_line" type="object"
string="Add to Payment Order"
groups="account_payment_order.group_account_payment"
attrs="{'invisible': ['|', ('payment_order_ok', '=', False), ('state', '!=', 'open')]}"/>
</button>
<field name="payment_mode_id" position="after">
<field name="payment_order_ok" invisible="1"/>
</field>
</field>
</record>
<act_window id="account_invoice_create_account_payment_line_action"
multi="True"
key2="client_action_multi"
name="Add to Payment/Debit Order"
res_model="account.invoice.payment.line.multi"
src_model="account.invoice"
view_mode="form"
target="new"/>
</data>
</odoo>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account_payment_order.move_line_form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account_payment_partner.view_move_line_form" />
<field name="arch" type="xml">
<group name="payments" position="inside">
<field name="partner_bank_id"
domain="[('partner_id', '=', partner_id)]"/>
<field name="bank_payment_line_id"/>
</group>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_payment_line_form" model="ir.ui.view">
<field name="name">account.payment.line.form</field>
<field name="model">account.payment.line</field>
<field name="arch" type="xml">
<form string="Payment Lines">
<group name="main" col="2">
<group name="left">
<field name="order_id" invisible="not context.get('account_payment_line_main_view')"/>
<field name="name"/>
<field name="move_line_id"
domain="[('reconciled','=', False), ('account_id.reconcile', '=', True)] "/> <!-- we removed the filter on amount_to_pay, because we want to be able to select refunds -->
<field name="date"/>
<field name="amount_currency"/>
<field name="currency_id"/>
<field name="partner_id"/>
<field name="partner_bank_id"
domain="[('partner_id', '=', partner_id)]"
attrs="{'required': [('bank_account_required', '=', True)]}"/>
<field name="bank_account_required" invisible="1"/>
<field name="communication_type"/>
<field name="communication"/>
</group>
<group name="right">
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="amount_company_currency"/>
<field name="company_currency_id" invisible="1"/>
<field name="bank_line_id"/>
<field name="payment_type" invisible="1"/>
</group>
</group>
</form>
</field>
</record>
<record id="account_payment_line_tree" model="ir.ui.view">
<field name="name">account.payment.line.tree</field>
<field name="model">account.payment.line</field>
<field name="arch" type="xml">
<tree string="Payment Lines">
<field name="order_id" invisible="not context.get('account_payment_line_main_view')"/>
<field name="partner_id"/>
<field name="communication"/>
<field name="partner_bank_id"/>
<field name="ml_maturity_date"/>
<field name="date"/>
<field name="amount_currency" string="Amount"/>
<field name="currency_id"/>
<field name="name"/>
<field name="amount_company_currency" sum="Total in Company Currency" invisible="1"/>
<field name="payment_type" invisible="1"/>
</tree>
</field>
</record>
<record id="account_payment_line_action" model="ir.actions.act_window">
<field name="name">Payment Lines</field>
<field name="res_model">account.payment.line</field>
<field name="view_mode">tree,form</field>
<field name="context">{'account_payment_line_main_view': True}</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_payment_mode_form" model="ir.ui.view">
<field name="name">account_payment_order.account.payment.mode.form</field>
<field name="model">account.payment.mode</field>
<field name="inherit_id" ref="account_payment_mode.account_payment_mode_form"/>
<field name="arch" type="xml">
<group name="main" position="after">
<group name="payment_order_options" string="Options for Payment Orders">
<field name="payment_order_ok"/>
<field name="no_debit_before_maturity"
attrs="{'invisible': ['|', ('payment_type', '!=', 'inbound'), ('payment_order_ok', '!=', True)]}"/>
<field name="group_lines"/>
</group>
<group name="payment_order_create_defaults" string="Select Move Lines to Pay - Default Values">
<field name="default_journal_ids" widget="many2many_tags"/>
<field name="default_payment_mode"/>
<field name="default_target_move" widget="radio"/>
<field name="default_invoice"/>
<field name="default_date_type"/>
</group>
<group name="accounting-config" string="Accounting Entries Options">
<field name="generate_move"/>
<field name="offsetting_account" widget="radio"
attrs="{'required': [('generate_move', '=', True)], 'invisible': [('generate_move', '=', False)]}"/>
<field name="transfer_account_id"
attrs="{'invisible': [('offsetting_account', '!=', 'transfer_account')], 'required': [('offsetting_account', '=', 'transfer_account')]}"
context="{'default_reconcile': True, 'default_company_id': company_id}"/> <!-- We can't put a default vue to user_type_id... -->
<field name="transfer_journal_id"
attrs="{'invisible': [('offsetting_account', '!=', 'transfer_account')], 'required': [('offsetting_account', '=', 'transfer_account')]}"/>
<field name="move_option"
attrs="{'invisible': [('generate_move', '=', False)], 'required': [('generate_move', '=', True)]}"/>
</group>
</group>
</field>
</record>
<record id="account_payment_mode_tree" model="ir.ui.view">
<field name="name">account_payment_order.account.payment.mode.tree</field>
<field name="model">account.payment.mode</field>
<field name="inherit_id" ref="account_payment_mode.account_payment_mode_tree"/>
<field name="arch" type="xml">
<field name="payment_type" position="after">
<field name="payment_order_ok"/>
</field>
</field>
</record>
<record id="account_payment_mode_search" model="ir.ui.view">
<field name="name">account_payment_order.account.payment.mode.search</field>
<field name="model">account.payment.mode</field>
<field name="inherit_id" ref="account_payment_mode.account_payment_mode_search"/>
<field name="arch" type="xml">
<filter name="outbound" position="after">
<filter name="payment_order_ok"
string="Selectable in Payment Orders"
domain="[('payment_order_ok', '=', 1)]"/>
</filter>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_payment_order_form" model="ir.ui.view">
<field name="name">account.payment.order.form</field>
<field name="model">account.payment.order</field>
<field name="arch" type="xml">
<form string="Payment Order">
<header>
<button name="%(account_payment_line_create_action)d" type="action"
string="Create Payment Lines from Journal Items"
states="draft" class="oe_highlight" />
<button name="draft2open" type="object" states="draft"
string="Confirm Payments" class="oe_highlight"/>
<button name="open2generated" type="object" states="open"
string="Generate Payment File" class="oe_highlight"/>
<button name="generated2uploaded" type="object" states="generated"
string="File Successfully Uploaded" class="oe_highlight"/>
<button name="cancel2draft" type="object" states="cancel"
string="Back to Draft" />
<button name="action_cancel" type="object" states="draft,open,generated"
string="Cancel Payments"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group name="head" col="2">
<group name="head-left">
<field name="payment_mode_id"
domain="[('payment_order_ok', '=', True), ('payment_type', '=', payment_type)]"
widget="selection"/>
<field name="journal_id" widget="selection"
domain="[('id', 'in', allowed_journal_ids and allowed_journal_ids[0] and allowed_journal_ids[0][2] or False)]"/>
<field name="allowed_journal_ids" invisible="1"/>
<field name="bank_account_link" invisible="1"/>
<field name="company_partner_bank_id" widget="selection"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="payment_type" invisible="0"/>
<field name="bank_line_count"/>
</group>
<group name="head-right">
<field name="date_prefered"/>
<field name="date_scheduled"
attrs="{'invisible': [('date_prefered', '!=', 'fixed')], 'required': [('date_prefered', '=', 'fixed')]}"/>
<field name="date_generated"/>
<field name="generated_user_id"/>
<field name="date_uploaded"/>
</group>
</group>
<notebook>
<page name="payment-lines" string="Transactions">
<field name="payment_line_ids"
context="{'default_payment_type': payment_type}"/>
</page>
<page name="bank-payment-lines" string="Bank Payment Lines">
<field name="bank_line_ids"
context="{'default_payment_type': payment_type}"/>
</page>
<page name="moves" string="Transfer Journal Entries">
<field name="move_ids"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="account_payment_order_tree" model="ir.ui.view">
<field name="name">account.payment.order.tree</field>
<field name="model">account.payment.order</field>
<field name="arch" type="xml">
<tree string="Payment Orders" colors="blue: state=='draft'; green: state=='generated'; gray: state=='cancel'; red: state=='open'" decoration-muted="state=='cancel'">
<field name="name"/>
<field name="payment_mode_id"/>
<field name="journal_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="date_uploaded"/>
<field name="total_company_currency" sum="Total Company Currency"/>
<field name="company_currency_id" invisible="1"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="account_payment_order_search" model="ir.ui.view">
<field name="name">account.payment.order.search</field>
<field name="model">account.payment.order</field>
<field name="arch" type="xml">
<search string="Search Payment Orders">
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="open" string="Confirmed" domain="[('state', '=', 'open')]"/>
<filter name="generated" string="File Generated" domain="[('state', '=', 'generated')]"/>
<filter name="uploaded" string="File Uploaded" domain="[('state', '=', 'uploaded')]"/>
<group string="Group By" name="groupby">
<filter name="payment_mode_groupby" string="Payment Mode" context="{'group_by': 'payment_mode_id'}"/>
<filter name="journal_groupby" string="Bank Journal" context="{'group_by': 'journal_id'}"/>
<filter name="date_generated_groupby" string="File Generation Date" context="{'group_by': 'date_generated'}"/>
<filter name="date_uploaded_groupby" string="File Upload Date" context="{'group_by': 'date_uploaded'}"/>
<filter name="state_groupby" string="State" context="{'group_by': 'state'}"/>
</group>
</search>
</field>
</record>
<record id="account_payment_order_graph" model="ir.ui.view">
<field name="name">account.payment.order.graph</field>
<field name="model">account.payment.order</field>
<field name="arch" type="xml">
<graph string="Payment Orders">
<field name="date_uploaded" type="row" interval="month"/>
<field name="total_company_currency" type="measure"/>
</graph>
</field>
</record>
<record id="account_payment_order_pivot" model="ir.ui.view">
<field name="name">account.payment.order.pivot</field>
<field name="model">account.payment.order</field>
<field name="arch" type="xml">
<pivot string="Payment Orders">
<field name="date_uploaded" type="row" interval="month"/>
<field name="total_company_currency" type="measure"/>
</pivot>
</field>
</record>
<record id="account_payment_order_outbound_action" model="ir.actions.act_window">
<field name="name">Payment Orders</field>
<field name="res_model">account.payment.order</field>
<field name="view_mode">tree,form,pivot,graph</field>
<field name="domain">[('payment_type', '=', 'outbound')]</field>
<field name="context">{'default_payment_type': 'outbound'}</field>
</record>
<record id="account_payment_order_inbound_action" model="ir.actions.act_window">
<field name="name">Debit Orders</field>
<field name="res_model">account.payment.order</field>
<field name="view_mode">tree,form,pivot,graph</field>
<field name="domain">[('payment_type', '=', 'inbound')]</field>
<field name="context">{'default_payment_type': 'inbound'}</field>
</record>
<menuitem id="payment_root" name="Payments" parent="account.menu_finance"
sequence="7"/>
<menuitem id="account_payment_order_outbound_menu" action="account_payment_order_outbound_action"
parent="payment_root" sequence="10"/>
<menuitem id="account_payment_order_inbound_menu" action="account_payment_order_inbound_action"
parent="payment_root" sequence="20"/>
</data>
</openerp>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">bank.payment.line.form</field>
<field name="model">bank.payment.line</field>
<field name="arch" type="xml">
<form string="Bank Payment Line">
<group name="main">
<field name="order_id"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="partner_id"/>
<field name="date"/>
<field name="amount_currency"/>
<field name="currency_id" invisible="1"/>
<field name="partner_bank_id"/>
<field name="communication_type"/>
<field name="communication"/>
</group>
<group string="Related Payment Lines" name="payment-lines">
<field name="payment_line_ids" nolabel="1"/>
</group>
</form>
</field>
</record>
<record id="bank_payment_line_tree" model="ir.ui.view">
<field name="name">bank.payment.line.tree</field>
<field name="model">bank.payment.line</field>
<field name="arch" type="xml">
<tree string="Bank Payment Lines">
<field name="order_id"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="partner_id"/>
<field name="communication"/>
<field name="partner_bank_id"/>
<field name="date"/>
<field name="amount_currency" sum="Total Amount"/>
<field name="currency_id"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"
invisible="not context.get('bank_payment_line_main_view')"/>
</tree>
</field>
</record>
<record id="bank_payment_line_search" model="ir.ui.view">
<field name="name">bank.payment.line.search</field>
<field name="model">bank.payment.line</field>
<field name="arch" type="xml">
<search string="Search Bank Payment Lines">
<field name="partner_id"/>
<filter name="inbound" string="Inbound" domain="[('payment_type', '=', 'inbound')]" />
<filter name="outbound" string="Outbound" domain="[('payment_type', '=', 'outbound')]" />
<group string="Group By" name="groupby">
<filter name="state_groupby" string="State" context="{'group_by': 'state'}"/>
<filter name="partner_groupby" string="Partner" context="{'group_by': 'partner_id'}"/>
</group>
</search>
</field>
</record>
<record id="bank_payment_line_action" model="ir.actions.act_window">
<field name="name">Bank Payment Lines</field>
<field name="res_model">bank.payment.line</field>
<field name="view_mode">tree,form</field>
<field name="context">{'bank_payment_line_main_view': True}</field>
</record>
<menuitem id="bank_payment_line_menu" action="bank_payment_line_action"
parent="payment_root" sequence="50" groups="group_account_payment"/>
</data>
</openerp>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) -->
<openerp>
<data>
<record id="view_attachment_simplified_form" model="ir.ui.view">
<field name="name">ir.attachment.simplified.form</field>
<field name="model">ir.attachment</field>
<field name="arch" type="xml">
<form string="Attachments">
<sheet>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name"/>
</h1>
<group name="main">
<field name="datas" filename="datas_fname"
string="Generated File"/>
<field name="datas_fname" invisible="1"/>
<label for="create_uid" string="Created by"/>
<div name="creation_div">
<field name="create_uid" readonly="1" class="oe_inline"/> on
<field name="create_date" readonly="1" class="oe_inline"/>
</div>
</group>
</sheet>
</form>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_create_payment_order_lines" model="ir.ui.view">
<field name="name">add.context.to.display.maturity.date</field>
<field name="model">payment.order.create</field>
<field name="inherit_id" ref="account_payment.view_create_payment_order_lines"/>
<field name="arch" type="xml">
<field name="entries" position="attributes">
<attribute name="context">{'journal_type': 'sale'}</attribute>
<attribute name="nolabel">1</attribute>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import account_payment_line_create
from . import account_invoice_payment_line_multi

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (<http://www.akretion.com>)
# 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

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<data>
<record id="account_invoice_payment_line_multi_form" model="ir.ui.view">
<field name="name">account_invoice_payment_line_multi.form</field>
<field name="model">account.invoice.payment.line.multi</field>
<field name="arch" type="xml">
<form string="Create Payment Lines">
<p>This wizard will create payment lines for the selected invoices:</p>
<ul>
<li>if there are existing draft payment orders for the payment modes of the invoices, the payment lines will be added to those payment orders</li>
<li>otherwise, new payment orders will be created (one per payment mode).</li>
</ul>
<footer>
<button type="object" name="run" string="Create" class="oe_highlight"/>
<button special="cancel" string="Cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,152 @@
# -*- coding: utf-8 -*-
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014-2015 ACSONE SA/NV (<http://acsone.eu>)
# © 2015-2016 Akretion (<http://www.akretion.com>)
# 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

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="account_payment_line_create_form" model="ir.ui.view">
<field name="name">account_payment_line_create.form</field>
<field name="model">account.payment.line.create</field>
<field name="arch" type="xml">
<form string="Choose Move Lines Filter Options">
<group name="main">
<field name="order_id" invisible="1"/>
<field name="date_type"/>
<field name="move_date" attrs="{'required': [('date_type', '=', 'move')], 'invisible': [('date_type', '!=', 'move')]}"/>
<field name="due_date" attrs="{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}"/>
<field name="journal_ids"
widget="many2many_tags"
placeholder="Keep empty for using all journals"/>
<field name="payment_mode"/>
<field name="target_move" widget="radio"/>
<field name="invoice"/>
<field name="allow_blocked"/>
<label string="Click on Add All Move Lines to auto-select the move lines matching the above criteria or click on Add an item to manually select the move lines filtered by the above criteria." colspan="2"/>
<button name="populate" type="object" string="Add All Move Lines"/>
</group>
<group name="move_lines" string="Selected Move Lines to Create Transactions">
<field name="move_line_ids" nolabel="1">
<tree>
<field name="date"/>
<field name="move_id" required="0"/>
<field name="journal_id"/>
<field name="name"/>
<field name="partner_id"/>
<field name="account_id"/>
<field name="date_maturity"/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="amount_currency" invisible="1"/>
<field name="currency_id" invisible="1" />
<field name="company_currency_id" invisible="1"/>
</tree>
</field>
</group>
<footer>
<button name="create_payment_lines" type="object"
string="Create Transactions" class="oe_highlight"/>
<button string="Cancel" special="cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>
<record id="account_payment_line_create_action" model="ir.actions.act_window">
<field name="name">Create Transactions from Move Lines</field>
<field name="res_model">account.payment.line.create</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</openerp>