From 51301645fa9b948e4bb13131ab92e2408bb0b16c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 6 May 2016 22:14:56 +0200 Subject: [PATCH] Finalise merge of account_banking_payment_transfer into account_payment_order Add support for transfer moves Display transfer moves in a dedicated tab in payment order view Code cleanup --- .../models/account_move_line.py | 4 +- .../models/account_payment_line.py | 56 +-- .../models/account_payment_mode.py | 17 +- .../models/banking_export_pain.py | 2 +- account_banking_payment_transfer/README.rst | 78 ---- account_banking_payment_transfer/__init__.py | 2 - .../__openerp__.py | 33 -- .../i18n/account_banking_payment.pot | 340 ------------------ account_banking_payment_transfer/i18n/en.po | 170 --------- account_banking_payment_transfer/i18n/es.po | 170 --------- account_banking_payment_transfer/i18n/fr.po | 170 --------- account_banking_payment_transfer/i18n/nl.po | 170 --------- .../i18n/pt_BR.po | 172 --------- account_banking_payment_transfer/i18n/sl.po | 171 --------- .../model/__init__.py | 7 - .../model/account_payment.py | 273 -------------- .../model/bank_payment_line.py | 94 ----- .../post_install.py | 7 - .../static/description/icon.png | Bin 9455 -> 0 bytes .../view/account_payment.xml | 35 -- .../workflow/account_payment.xml | 90 ----- account_payment_order/models/__init__.py | 1 + .../models/account_invoice.py | 3 +- account_payment_order/models/account_move.py | 13 + .../models/account_move_line.py | 34 +- .../models/account_payment_order.py | 130 +++---- .../models/bank_payment_line.py | 78 ++-- .../test/data.yml | 0 .../test/test_partial_payment_refunded.yml | 0 .../test/test_partial_payment_transfer.yml | 0 .../test/test_payment_method.yml | 0 .../views/account_move_line.xml | 1 + .../views/account_payment_mode.xml | 2 +- .../views/account_payment_order.xml | 3 + .../wizard/account_payment_line_create.py | 8 +- 35 files changed, 156 insertions(+), 2178 deletions(-) delete mode 100644 account_banking_payment_transfer/README.rst delete mode 100644 account_banking_payment_transfer/__init__.py delete mode 100644 account_banking_payment_transfer/__openerp__.py delete mode 100644 account_banking_payment_transfer/i18n/account_banking_payment.pot delete mode 100644 account_banking_payment_transfer/i18n/en.po delete mode 100644 account_banking_payment_transfer/i18n/es.po delete mode 100644 account_banking_payment_transfer/i18n/fr.po delete mode 100644 account_banking_payment_transfer/i18n/nl.po delete mode 100644 account_banking_payment_transfer/i18n/pt_BR.po delete mode 100644 account_banking_payment_transfer/i18n/sl.po delete mode 100644 account_banking_payment_transfer/model/__init__.py delete mode 100644 account_banking_payment_transfer/model/account_payment.py delete mode 100644 account_banking_payment_transfer/model/bank_payment_line.py delete mode 100644 account_banking_payment_transfer/post_install.py delete mode 100644 account_banking_payment_transfer/static/description/icon.png delete mode 100644 account_banking_payment_transfer/view/account_payment.xml delete mode 100644 account_banking_payment_transfer/workflow/account_payment.xml create mode 100644 account_payment_order/models/account_move.py rename {account_banking_payment_transfer => account_payment_order}/test/data.yml (100%) rename {account_banking_payment_transfer => account_payment_order}/test/test_partial_payment_refunded.yml (100%) rename {account_banking_payment_transfer => account_payment_order}/test/test_partial_payment_transfer.yml (100%) rename {account_banking_payment_transfer => account_payment_order}/test/test_payment_method.yml (100%) diff --git a/account_banking_mandate/models/account_move_line.py b/account_banking_mandate/models/account_move_line.py index 2aa599796..1ededbb6a 100644 --- a/account_banking_mandate/models/account_move_line.py +++ b/account_banking_mandate/models/account_move_line.py @@ -17,6 +17,6 @@ class AccountMoveLine(models.Model): vals = super(AccountMoveLine, self)._prepare_payment_line_vals( payment_order) if payment_order.payment_type == 'inbound' and self.mandate_id: - vals['mandate_id'] = self.mandate_id.id or False - vals['partner_bank_id'] = self.mandate_id.partner_bank_id.id or False + vals['mandate_id'] = self.mandate_id.id + vals['partner_bank_id'] = self.mandate_id.partner_bank_id.id return vals diff --git a/account_banking_mandate/models/account_payment_line.py b/account_banking_mandate/models/account_payment_line.py index 7083d3352..bb0a2cb43 100644 --- a/account_banking_mandate/models/account_payment_line.py +++ b/account_banking_mandate/models/account_payment_line.py @@ -15,49 +15,23 @@ class AccountPaymentLine(models.Model): comodel_name='account.banking.mandate', string='Direct Debit Mandate', domain=[('state', '=', 'valid')]) - # TODO : remove this - @api.model - def create(self, vals=None): - """If the customer invoice has a mandate, take it - otherwise, take the first valid mandate of the bank account - """ - if vals is None: - vals = {} - partner_bank_id = vals.get('partner_bank_id') - move_line_id = vals.get('move_line_id') - if (self.env.context.get('search_payment_order_type') == 'debit' and - 'mandate_id' not in vals): - if move_line_id: - line = self.env['account.move.line'].browse(move_line_id) - if (line.invoice and line.invoice.type == 'out_invoice' and - line.invoice.mandate_id): - vals.update({ - 'mandate_id': line.invoice.mandate_id.id, - 'partner_bank_id': line.invoice.mandate_id.partner_bank_id.id, - }) - if partner_bank_id and 'mandate_id' not in vals: - mandates = self.env['account.banking.mandate'].search( - [('partner_bank_id', '=', partner_bank_id), - ('state', '=', 'valid')]) - if mandates: - vals['mandate_id'] = mandates[0].id - return super(AccountPaymentLine, self).create(vals) - - @api.one + @api.multi @api.constrains('mandate_id', 'partner_bank_id') def _check_mandate_bank_link(self): - if (self.mandate_id and self.partner_bank_id and - self.mandate_id.partner_bank_id.id != - self.partner_bank_id.id): - raise ValidationError( - _("The payment line with reference '%s' has the bank account " - "'%s' which is not attached to the mandate '%s' (this " - "mandate is attached to the bank account '%s').") % - (self.name, - self.partner_bank_id.name_get()[0][1], - self.mandate_id.unique_mandate_reference, - self.mandate_id.partner_bank_id.name_get()[0][1])) + for pline in self: + if (pline.mandate_id and pline.partner_bank_id and + pline.mandate_id.partner_bank_id != + pline.partner_bank_id): + raise ValidationError(_( + "The payment line number %s has the bank account " + "'%s' which is not attached to the mandate '%s' (this " + "mandate is attached to the bank account '%s').") % + (pline.name, + pline.partner_bank_id.acc_number, + pline.mandate_id.unique_mandate_reference, + pline.mandate_id.partner_bank_id.acc_number)) # @api.multi # def check_payment_line(self): -# TODO : i would like to block here is mandate is missing... but how do you know it's required ? => create option on payment order ? +# TODO : i would like to block here is mandate is missing... +# but how do you know it's required ? => create option on payment order ? diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index 48febc536..fd36ea3cd 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -4,7 +4,7 @@ # © 2016 Antiun Ingenieria S.L. - Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from openerp import models, fields class AccountPaymentMode(models.Model): @@ -33,18 +33,3 @@ class AccountPaymentMode(models.Model): "- Country code (2, optional)\n" "- Company idenfier (N, VAT)\n" "- Service suffix (N, issued by bank)") - # I plan to change this -- Alexis - #sepa_type = fields.Char(compute="_compute_sepa_type") - - #def _sepa_type_get(self): - # """Defined to be inherited by child addons, for instance: - # - account_banking_sepa_credit_transfer - # - account_banking_sepa_direct_debit - # """ - # return False - - #@api.multi - #@api.depends('type') - #def _compute_sepa_type(self): - # for mode in self: - # mode.sepa_type = mode._sepa_type_get() diff --git a/account_banking_pain_base/models/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py index af178327d..ab3a05383 100644 --- a/account_banking_pain_base/models/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -283,7 +283,7 @@ class AccountPaymentOrder(models.Model): viban = self._prepare_field( '%s IBAN' % party_type_label, iban, eval_ctx, gen_args=gen_args) # TODO : add support for bank accounts other than IBAN - #viban = self._validate_iban(piban) + # viban = self._validate_iban(piban) # At C level, the order is : BIC, Name, IBAN # At B level, the order is : Name, IBAN, BIC if order == 'B': diff --git a/account_banking_payment_transfer/README.rst b/account_banking_payment_transfer/README.rst deleted file mode 100644 index 31bb64483..000000000 --- a/account_banking_payment_transfer/README.rst +++ /dev/null @@ -1,78 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 - -Account Banking - Payments Transfer Account -=========================================== - -Payment order reconciliation infrastructure - -This module reconciles invoices as soon as the payment order -is sent, by creating a move to a transfer account (aka suspense account). -When the moves on the suspense account are reconciled (typically through -the bank statement reconciliation, the payment order moves to the done -status). - -Installation -============ - -This module depends on : -* account_banking_payment_export - -This module is part of the OCA/bank-payment suite. - -Configuration -============= - -To configure this module, you need to: - - * create a transfer account who allow reconciliation : option "Allow Reconciliation" activated. - * configure transfer account on payment mode. Go to the menu Accounting > Configuration > Miscellaneous > Payment Mode and complete the section "Transfer move settings". - -Usage -===== - -This module allows to reconcile transfer account and invoice by selecting on a payment order a payment mode with the option "transfer account" activated. - - -For further information, please visit: - - * https://www.odoo.com/forum/help-1 - -Known issues / Roadmap -====================== - - * No known issues - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - -Credits -======= - -Contributors ------------- - -* Stéphane Bidoul -* Adrien Peiffer -* Alexis de Lattre -* Matt Choplin -* Alexandre Fayolle -* Danimar Ribeiro - -Maintainer ----------- - -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org - -This module is maintained by the OCA. - -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. - -To contribute to this module, please visit http://odoo-community.org. diff --git a/account_banking_payment_transfer/__init__.py b/account_banking_payment_transfer/__init__.py deleted file mode 100644 index 9180c0e2e..000000000 --- a/account_banking_payment_transfer/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import model -from .post_install import set_date_sent diff --git a/account_banking_payment_transfer/__openerp__.py b/account_banking_payment_transfer/__openerp__.py deleted file mode 100644 index 29fae9fe4..000000000 --- a/account_banking_payment_transfer/__openerp__.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2009 EduSense BV () -# © 2011-2013 Therp BV () -# © 2013-2014 ACSONE SA (). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -{ - 'name': 'Account Banking - Payments Transfer Account', - 'version': '8.0.0.3.0', - 'license': 'AGPL-3', - 'author': "Banking addons community,Odoo Community Association (OCA)", - 'website': 'https://github.com/OCA/banking', - 'category': 'Banking addons', - 'post_init_hook': 'set_date_sent', - 'depends': [ - 'account_banking_payment_export', - ], - 'data': [ - 'view/payment_mode.xml', - 'workflow/account_payment.xml', - 'view/account_payment.xml', - ], - 'test': [ - 'test/data.yml', - 'test/test_payment_method.yml', - 'test/test_partial_payment_refunded.yml', - 'test/test_partial_payment_transfer.yml', - - - ], - 'auto_install': False, - 'installable': False, -} diff --git a/account_banking_payment_transfer/i18n/account_banking_payment.pot b/account_banking_payment_transfer/i18n/account_banking_payment.pot deleted file mode 100644 index b870ba42c..000000000 --- a/account_banking_payment_transfer/i18n/account_banking_payment.pot +++ /dev/null @@ -1,340 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_payment -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-25 15:58+0000\n" -"PO-Revision-Date: 2013-10-25 15:58+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_payment_order_create -msgid "payment.order.create" -msgstr "" - -#. module: account_banking_payment -#: view:payment.order:0 -msgid "{\n" -" 'readonly': [('state', '=', 'normal')]\n" -" }" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:204 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:224 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:236 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:240 -#, python-format -msgid "Cannot unreconcile" -msgstr "" - -#. module: account_banking_payment -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_payment_order -msgid "Payment Order" -msgstr "" - -#. module: account_banking_payment -#: field:payment.mode.type,payment_order_type:0 -#: field:payment.order,payment_order_type:0 -msgid "Payment order type" -msgstr "" - -#. module: account_banking_payment -#: help:payment.mode,payment_term_ids:0 -msgid "Limit selected invoices to invoices with these payment terms" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:251 -#, python-format -msgid "No move line provided for line %s" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_payment_mode -msgid "Payment Mode" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/payment_line.py:131 -#, python-format -msgid "Can not reconcile" -msgstr "" - -#. module: account_banking_payment -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:179 -#, python-format -msgid "Cannot reconcile" -msgstr "" - -#. module: account_banking_payment -#: field:banking.transaction.wizard,manual_payment_order_id:0 -msgid "Match this payment order" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:255 -#, python-format -msgid "Move line %s has already been paid/reconciled" -msgstr "" - -#. module: account_banking_payment -#: help:payment.mode,transfer_account_id:0 -msgid "Pay off lines in sent orders with a move on this account. For debit type modes only. You can only select accounts of type regular that are marked for reconciliation" -msgstr "" - -#. module: account_banking_payment -#: view:payment.order:0 -msgid "{\n" -" 'invisible':[('state','!=','draft')]\n" -" }" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:261 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:265 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:284 -#, python-format -msgid "Cannot cancel link with storno" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:237 -#, python-format -msgid "Cannot unreconcile: no payment or direct debit order" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:205 -#, python-format -msgid "Cannot unreconcile payment order: Workflow will not allow it." -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:241 -#, python-format -msgid "Direct debit order" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:154 -#, python-format -msgid "Cannot link with storno" -msgstr "" - -#. module: account_banking_payment -#: field:banking.import.transaction,payment_order_id:0 -#: field:banking.transaction.wizard,payment_order_id:0 -msgid "Payment order to reconcile" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:241 -#, python-format -msgid "Payment orders without transfer move lines cannot be unreconciled this way" -msgstr "" - -#. module: account_banking_payment -#: selection:payment.mode.type,payment_order_type:0 -#: selection:payment.order,payment_order_type:0 -msgid "Payment" -msgstr "" - -#. module: account_banking_payment -#: field:payment.mode,payment_term_ids:0 -msgid "Payment terms" -msgstr "" - -#. module: account_banking_payment -#: view:payment.mode:0 -msgid "Transfer move settings" -msgstr "" - -#. module: account_banking_payment -#: selection:payment.mode.type,payment_order_type:0 -#: selection:payment.order,payment_order_type:0 -msgid "Direct debit" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_banking_import_transaction -msgid "Bank import transaction" -msgstr "" - -#. module: account_banking_payment -#: view:payment.mode:0 -msgid "Optional filter by payment term" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/payment_line.py:136 -#: code:addons/account_banking_payment/model/payment_line.py:142 -#, python-format -msgid "Move line %s has already been reconciled" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:271 -#, python-format -msgid "%s for %s" -msgstr "" - -#. module: account_banking_payment -#: field:banking.import.transaction,payment_order_ids:0 -msgid "Payment orders" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:155 -#: code:addons/account_banking_payment/model/banking_import_transaction.py:262 -#, python-format -msgid "No direct debit order item" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:266 -#, python-format -msgid "The direct debit order item is not marked for storno" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:285 -#, python-format -msgid "Line id not found" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_transaction_wizard.py:62 -#, python-format -msgid "When matching a payment order, the amounts have to match exactly" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:250 -#: code:addons/account_banking_payment/model/account_payment.py:254 -#: code:addons/account_banking_payment/model/banking_transaction_wizard.py:61 -#: code:addons/account_banking_payment/model/payment_line.py:135 -#: code:addons/account_banking_payment/model/payment_line.py:141 -#, python-format -msgid "Error" -msgstr "" - -#. module: account_banking_payment -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:225 -#, python-format -msgid "Cannot unreconcile: this operation is not yet supported for match type 'payment'" -msgstr "" - -#. module: account_banking_payment -#: field:banking.transaction.wizard,payment_line_id:0 -msgid "Matching payment or storno" -msgstr "" - -#. module: account_banking_payment -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_banking_import_line -msgid "Bank import lines" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/payment_order_create.py:88 -#, python-format -msgid "Entry Lines" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/payment_line.py:132 -#, python-format -msgid "No move line for line %s" -msgstr "" - -#. module: account_banking_payment -#: field:banking.transaction.wizard,manual_payment_line_id:0 -msgid "Match this payment line" -msgstr "" - -#. module: account_banking_payment -#: field:banking.transaction.wizard,payment_order_ids:0 -msgid "Matching payment orders" -msgstr "" - -#. module: account_banking_payment -#: field:payment.line,transit_move_line_id:0 -msgid "Debit move line" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/account_payment.py:240 -#: field:banking.import.line,payment_order_id:0 -#, python-format -msgid "Payment order" -msgstr "" - -#. module: account_banking_payment -#: code:addons/account_banking_payment/model/banking_import_transaction.py:180 -#, python-format -msgid "Cannot reconcile: no direct debit order" -msgstr "" - -#. module: account_banking_payment -#: help:payment.mode,transfer_journal_id:0 -msgid "Journal to write payment entries when confirming a debit order of this mode" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_payment_mode_type -msgid "Payment Mode Type" -msgstr "" - -#. module: account_banking_payment -#: field:banking.import.transaction,payment_line_id:0 -msgid "Payment line" -msgstr "" - -#. module: account_banking_payment -#: model:ir.model,name:account_banking_payment.model_banking_transaction_wizard -msgid "Match transaction" -msgstr "" - -#. module: account_banking_payment -#: help:payment.line,transit_move_line_id:0 -msgid "Move line through which the debit order pays the invoice" -msgstr "" - -#. module: account_banking_payment -#: field:payment.line,msg:0 -msgid "Message" -msgstr "" - diff --git a/account_banking_payment_transfer/i18n/en.po b/account_banking_payment_transfer/i18n/en.po deleted file mode 100644 index 3ba770cb0..000000000 --- a/account_banking_payment_transfer/i18n/en.po +++ /dev/null @@ -1,170 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# Translators: -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-18 10:57+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "%s bank line %s" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "%s line %s" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "Account Reconciliation" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "Bank Payment Lines" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "Can not reconcile: no move line for payment line %s of partner '%s'." - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer 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." -msgstr "Cannot generate the transfer 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." - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "Date Confirmed" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "Direct debit" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "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)." - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "Journal to write payment entries when confirming a debit order of this mode" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "Message" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "Move line '%s' of partner '%s' has already been reconciled" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "Move line through which the payment/debit order pays the invoice" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "One move per payment date" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "One move per payment line" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "Partial Reconcile Moves Line" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "Pay off lines in sent orders with a move on this account. You can only select accounts of type regular that are marked for reconciliation" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "Payment" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Payment Line" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Payment Mode" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "Payment Order" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "Send date" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "Transfer account" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "Transfer journal" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "Transfer move line" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "Transfer move option" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "Transfer move settings" diff --git a/account_banking_payment_transfer/i18n/es.po b/account_banking_payment_transfer/i18n/es.po deleted file mode 100644 index d057d672a..000000000 --- a/account_banking_payment_transfer/i18n/es.po +++ /dev/null @@ -1,170 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# 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: 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_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "Líneas de pago bancario" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer move when the currency of the payment (%s) is " -"not the same as the currency of the company. This is not supported for the " -"moment." -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "Adeudo directo (cobro)" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "Pago" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Línea de pago" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Modo de pago" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "Orden de pago" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "" diff --git a/account_banking_payment_transfer/i18n/fr.po b/account_banking_payment_transfer/i18n/fr.po deleted file mode 100644 index 6fc56ad88..000000000 --- a/account_banking_payment_transfer/i18n/fr.po +++ /dev/null @@ -1,170 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# 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_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer move when the currency of the payment (%s) is " -"not the same as the currency of the company. This is not supported for the " -"moment." -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Ligne de paiement" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Mode de paiement" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "" diff --git a/account_banking_payment_transfer/i18n/nl.po b/account_banking_payment_transfer/i18n/nl.po deleted file mode 100644 index 23aeee59b..000000000 --- a/account_banking_payment_transfer/i18n/nl.po +++ /dev/null @@ -1,170 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: bank-payment (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-08 00:46+0000\n" -"PO-Revision-Date: 2016-04-06 00:14+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: 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_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer move when the currency of the payment (%s) is " -"not the same as the currency of the company. This is not supported for the " -"moment." -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "Datum bevestigd" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "Incasso-opdracht" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "Dagboek voor het boeken van betalingen bij het bevestigen van een incasso in deze mode" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "Bericht" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "Betaling" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Betaalregel" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Betaalwijze" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "Betalingsopdracht" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "Datum verstuurd" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "Overschrijf rekening" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "Overschrijf dagboek" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "Overschrijving instellingen" diff --git a/account_banking_payment_transfer/i18n/pt_BR.po b/account_banking_payment_transfer/i18n/pt_BR.po deleted file mode 100644 index d626acd07..000000000 --- a/account_banking_payment_transfer/i18n/pt_BR.po +++ /dev/null @@ -1,172 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# Translators: -# danimaribeiro , 2016 -# danimaribeiro , 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-18 10:57+0000\n" -"Last-Translator: OCA Transbot \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_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "%s linha bancária %s" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "%s linha %s" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "Conta de reconciliação" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "Linhas de pagamento bancária" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "Não pode reconciliar: nenhum movimentação para a linha de pagamento %s do parceiro '%s'." - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer 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." -msgstr "" - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "Data Confirmada" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "Débito Direto" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "Para o parceiro '%s', a conta da movimentação para pagar (%s) é diferente da conta da movimentação de trânsito (%s)." - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "Entrada de diário para salvar os pagamentos quando confirmar a ordem de pagamento deste mododeze mode" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "Mensagem" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "Linha de movimentação '%s' do parceiro '%s' já foi reconciliada" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "Linha de movimentação na qual o pagamento/débito paga a fatura" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "Uma movimentação por data de pagamento" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "Uma movimentação por linha de pagamento" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "Reconciliação parcial das linhas do movimento" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "Pagamento" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Linha de Pagamento" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Modo de Pagamento" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "Ordem de Pagamento" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "Data de envio" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "Conta de Transferência" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "Transferir Diário" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "Linha de transferência da movimentação" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "Opção de transferência" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "Definições de transferência e movimentações" diff --git a/account_banking_payment_transfer/i18n/sl.po b/account_banking_payment_transfer/i18n/sl.po deleted file mode 100644 index dc499a785..000000000 --- a/account_banking_payment_transfer/i18n/sl.po +++ /dev/null @@ -1,171 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_banking_payment_transfer -# -# Translators: -# Matjaž Mozetič , 2016 -msgid "" -msgstr "" -"Project-Id-Version: bank-payment (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-18 10:57+0000\n" -"PO-Revision-Date: 2016-04-19 08:58+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-payment-8-0/language/sl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:128 -#, python-format -msgid "%s bank line %s" -msgstr "%s bančna postavka %s" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:162 -#, python-format -msgid "%s line %s" -msgstr "%s postavka %s" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_account_move_reconcile -msgid "Account Reconciliation" -msgstr "Uskladitev konta" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_bank_payment_line -msgid "Bank Payment Lines" -msgstr "Postavke bančnih plačil" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:70 -#, python-format -msgid "Can not reconcile: no move line for payment line %s of partner '%s'." -msgstr "Ni mogoče uskladiti: ni postavke premika za plačilno postavko %s partnerja '%s'." - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:185 -#, python-format -msgid "" -"Cannot generate the transfer 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." -msgstr "Ni mogoče ustvariti premika transferja, kadar je valuta plačila (%s) drugačna od valute družbe (%s). Ta opcija trenutno ni podprta." - -#. module: account_banking_payment_transfer -#: field:payment.line,date_done:0 -msgid "Date Confirmed" -msgstr "Datum potrditve" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:221 -#, python-format -msgid "Direct debit" -msgstr "Direktna obremenitev" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:84 -#, python-format -msgid "" -"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)." -msgstr "Pri partnerju '%s', je konto postavke premika za plačilo (%s) drugačen od konta postavke tranzitnega premika (%s)." - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_journal_id:0 -msgid "" -"Journal to write payment entries when confirming a debit order of this mode" -msgstr "Dnevnik za zapis plačilnih vnosov pri potrjevanju obremenitvenega naloga v tem načinu" - -#. module: account_banking_payment_transfer -#: field:payment.line,msg:0 -msgid "Message" -msgstr "Sporočilo" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/bank_payment_line.py:76 -#, python-format -msgid "Move line '%s' of partner '%s' has already been reconciled" -msgstr "Postavka premika '%s' partnerja '%s' je že bila usklajena" - -#. module: account_banking_payment_transfer -#: help:bank.payment.line,transit_move_line_id:0 -msgid "Move line through which the payment/debit order pays the invoice" -msgstr "Posavka premika, preko katere plačilni/obremenitveni nalog plača račun" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment date" -msgstr "En premik za vsak datum plačila" - -#. module: account_banking_payment_transfer -#: selection:payment.mode,transfer_move_option:0 -msgid "One move per payment line" -msgstr "En premik za vsako plačilno postavko" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:264 -#, python-format -msgid "Partial Reconcile Moves Line" -msgstr "Delno usklajevanje postavk premikov" - -#. module: account_banking_payment_transfer -#: help:payment.mode,transfer_account_id:0 -msgid "" -"Pay off lines in sent orders with a move on this account. You can only " -"select accounts of type regular that are marked for reconciliation" -msgstr "Postavke izplačil v poslanih nalogih s premikom na ta konto. Izberete lahko le konte običajnega tipa, ki so označeni za uskladitev" - -#. module: account_banking_payment_transfer -#: code:addons/account_banking_payment_transfer/model/account_payment.py:220 -#, python-format -msgid "Payment" -msgstr "Plačilo" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_line -msgid "Payment Line" -msgstr "Plačilna postavka" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_mode -msgid "Payment Mode" -msgstr "Metoda plačila" - -#. module: account_banking_payment_transfer -#: model:ir.model,name:account_banking_payment_transfer.model_payment_order -msgid "Payment Order" -msgstr "Plačilni nalog" - -#. module: account_banking_payment_transfer -#: field:payment.order,date_sent:0 -msgid "Send date" -msgstr "Datum odpošiljanja" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_account_id:0 -msgid "Transfer account" -msgstr "Konto transferja" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_journal_id:0 -msgid "Transfer journal" -msgstr "Dnevnik transferja" - -#. module: account_banking_payment_transfer -#: field:bank.payment.line,transit_move_line_id:0 -msgid "Transfer move line" -msgstr "Postavka premika transferja" - -#. module: account_banking_payment_transfer -#: field:payment.mode,transfer_move_option:0 -msgid "Transfer move option" -msgstr "Opcija premika transferja" - -#. module: account_banking_payment_transfer -#: view:payment.mode:account_banking_payment_transfer.view_payment_mode_form_inherit -msgid "Transfer move settings" -msgstr "Nastavitve premikov transferja" diff --git a/account_banking_payment_transfer/model/__init__.py b/account_banking_payment_transfer/model/__init__.py deleted file mode 100644 index 09e695000..000000000 --- a/account_banking_payment_transfer/model/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import account_payment -from . import payment_line -from . import bank_payment_line -from . import payment_mode -from . import account_move_reconcile diff --git a/account_banking_payment_transfer/model/account_payment.py b/account_banking_payment_transfer/model/account_payment.py deleted file mode 100644 index b34f70ad6..000000000 --- a/account_banking_payment_transfer/model/account_payment.py +++ /dev/null @@ -1,273 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2009 EduSense BV () -# © 2011-2013 Therp BV () -# © 2013-2014 ACSONE SA (). -# © 2014-2015 Akretion (www.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 Warning as UserError - - -class PaymentOrder(models.Model): - ''' - Enable extra states for payment exports - ''' - _inherit = 'payment.order' - - @api.multi - def get_partial_reconcile_ids(self): - self.ensure_one() - reconcile_partial_ids = [line.move_line_id.reconcile_partial_id.id - for line in self.line_ids if - line.move_line_id.reconcile_partial_id.id] - return reconcile_partial_ids - - @api.one - def get_partial_reconcile_count(self): - self.partial_reconcile_count = len(self.get_partial_reconcile_ids()) - - date_scheduled = fields.Date(states={ - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)], - }) - reference = fields.Char(states={ - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)], - }) - mode = fields.Many2one(states={ - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)], - }) - state = fields.Selection(selection_add=[ - ('sent', 'Sent'), - ('rejected', 'Rejected'), - ], string='State') - line_ids = fields.One2many(states={ - 'open': [('readonly', True)], - 'cancel': [('readonly', True)], - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)] - }) - user_id = fields.Many2one(states={ - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)] - }) - date_prefered = fields.Selection(states={ - 'sent': [('readonly', True)], - 'rejected': [('readonly', True)], - 'done': [('readonly', True)] - }) - date_sent = fields.Date(string='Send date', readonly=True) - partial_reconcile_count = fields\ - .Integer(string='Partial Reconciles Counter', - compute='get_partial_reconcile_count') - - @api.multi - def action_rejected(self): - return True - - @api.multi - def action_done(self): - for line in self.line_ids: - line.date_done = fields.Date.context_today(self) - return super(PaymentOrder, self).action_done() - - @api.multi - def _get_transfer_move_lines(self): - """ - Get the transfer move lines (on the transfer account). - """ - res = [] - for order in self: - for bank_line in order.bank_line_ids: - move_line = bank_line.transfer_move_line_id - if move_line: - res.append(move_line) - return res - - @api.multi - def get_transfer_move_line_ids(self, *args): - '''Used in the workflow for trigger_expr_id''' - return [move_line.id for move_line in self._get_transfer_move_lines()] - - @api.multi - def test_done(self): - """ - Test if all moves on the transfer account are reconciled. - - Called from the workflow to move to the done state when - all transfer move have been reconciled through bank statements. - """ - return all([move_line.reconcile_id for move_line in - self._get_transfer_move_lines()]) - - @api.multi - def test_undo_done(self): - return not self.test_done() - - @api.multi - def _prepare_transfer_move(self): - vals = { - 'journal_id': self.mode.transfer_journal_id.id, - 'ref': '%s %s' % ( - self.payment_order_type[:3].upper(), self.reference) - } - return vals - - @api.multi - def _prepare_move_line_transfer_account( - self, amount, move, bank_payment_lines, labels): - if len(bank_payment_lines) == 1: - partner_id = bank_payment_lines[0].partner_id.id - name = _('%s bank line %s') % (labels[self.payment_order_type], - bank_payment_lines[0].name) - else: - partner_id = False - name = '%s %s' % ( - labels[self.payment_order_type], self.reference) - date_maturity = bank_payment_lines[0].date - vals = { - 'name': name, - 'move_id': move.id, - 'partner_id': partner_id, - 'account_id': self.mode.transfer_account_id.id, - 'credit': (self.payment_order_type == 'payment' and - amount or 0.0), - 'debit': (self.payment_order_type == 'debit' and - amount or 0.0), - 'date_maturity': date_maturity, - } - return vals - - @api.multi - def _prepare_move_line_partner_account(self, bank_line, move, labels): - # 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_order_type == 'debit': - account_id =\ - bank_line.partner_id.property_account_receivable.id - else: - account_id = bank_line.partner_id.property_account_payable.id - vals = { - 'name': _('%s line %s') % ( - labels[self.payment_order_type], bank_line.name), - 'move_id': move.id, - 'partner_id': bank_line.partner_id.id, - 'account_id': account_id, - 'credit': (self.payment_order_type == 'debit' and - bank_line.amount_currency or 0.0), - 'debit': (self.payment_order_type == 'payment' and - bank_line.amount_currency or 0.0), - } - return vals - - @api.multi - def action_sent_no_move_line_hook(self, pay_line): - """This function is designed to be inherited""" - return - - @api.multi - def _create_move_line_partner_account(self, bank_line, move, labels): - """This method is designed to be inherited in a custom module""" - # TODO: take multicurrency into account - company_currency = self.env.user.company_id.currency_id - if bank_line.currency != company_currency: - raise UserError(_( - "Cannot generate the transfer 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.") - % (bank_line.currency.name, company_currency.name)) - aml_obj = self.env['account.move.line'] - # create the payment/debit counterpart move line - # on the partner account - partner_ml_vals = self._prepare_move_line_partner_account( - bank_line, move, labels) - partner_move_line = aml_obj.create(partner_ml_vals) - - # register the payment/debit move line - # on the payment line and call reconciliation on it - bank_line.write({'transit_move_line_id': partner_move_line.id}) - - @api.multi - def _reconcile_payment_lines(self, bank_payment_lines): - for bline in bank_payment_lines: - if all([pline.move_line_id for pline in bline.payment_line_ids]): - bline.debit_reconcile() - else: - self.action_sent_no_move_line_hook(bline) - - @api.one - def action_sent(self): - """ - Create the moves that pay off the move lines from - the debit order. This happens when the debit order file is - generated. - """ - am_obj = self.env['account.move'] - aml_obj = self.env['account.move.line'] - labels = { - 'payment': _('Payment'), - 'debit': _('Direct debit'), - } - if self.mode.transfer_journal_id and self.mode.transfer_account_id: - # prepare a dict "trfmoves" that can be used when - # self.mode.transfer_move_option = date or line - # key = unique identifier (date or True or line.id) - # value = [pay_line1, pay_line2, ...] - trfmoves = {} - for bline in self.bank_line_ids: - hashcode = bline.move_line_transfer_account_hashcode() - if hashcode in trfmoves: - trfmoves[hashcode].append(bline) - else: - trfmoves[hashcode] = [bline] - - for hashcode, blines in trfmoves.iteritems(): - mvals = self._prepare_transfer_move() - move = am_obj.create(mvals) - total_amount = 0 - for bline in blines: - total_amount += bline.amount_currency - self._create_move_line_partner_account(bline, move, labels) - # create the payment/debit move line on the transfer account - trf_ml_vals = self._prepare_move_line_transfer_account( - total_amount, move, blines, labels) - aml_obj.create(trf_ml_vals) - self._reconcile_payment_lines(blines) - # consider entry_posted on account_journal - if move.journal_id.entry_posted: - move.post() - - # State field is written by act_sent_wait - self.write({'date_sent': fields.Date.context_today(self)}) - return True - - @api.multi - def partial(self): - self.ensure_one() - view_id = self.env.ref('account.view_move_line_tree').id - reconcile_partial_ids = self.get_partial_reconcile_ids() - reconcile_partial_domain = [('reconcile_partial_id', 'in', - reconcile_partial_ids)] - return { - 'name': _('Partial Reconcile Moves Line'), - 'context': self.env.context, - 'domain': reconcile_partial_domain, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'account.move.line', - 'views': [(view_id, 'tree')], - 'type': 'ir.actions.act_window', - 'target': 'current', - } diff --git a/account_banking_payment_transfer/model/bank_payment_line.py b/account_banking_payment_transfer/model/bank_payment_line.py deleted file mode 100644 index f0494dbe2..000000000 --- a/account_banking_payment_transfer/model/bank_payment_line.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2009 EduSense BV () -# © 2011-2013 Therp BV () -# © 2015 Akretion (www.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 Warning as UserError - - -class BankPaymentLine(models.Model): - _inherit = 'bank.payment.line' - - transit_move_line_id = fields.Many2one( - 'account.move.line', string='Transfer move line', readonly=True, - help="Move line through which the payment/debit order " - "pays the invoice") - transfer_move_line_id = fields.Many2one( - 'account.move.line', compute='_get_transfer_move_line', - string='Transfer move line counterpart', - help="Counterpart move line on the transfer account") - - @api.multi - def move_line_transfer_account_hashcode(self): - """ - This method is inherited in the module - account_banking_sepa_direct_debit - """ - self.ensure_one() - if self.order_id.mode.transfer_move_option == 'date': - hashcode = self.date - else: - hashcode = unicode(self.id) - return hashcode - - @api.multi - def _get_transfer_move_line(self): - for bank_line in self: - if bank_line.transit_move_line_id: - order_type = bank_line.order_id.payment_order_type - trf_lines = bank_line.transit_move_line_id.move_id.line_id - for move_line in trf_lines: - if order_type == 'debit' and move_line.debit > 0: - bank_line.transfer_move_line_id = move_line - elif order_type == 'payment' and move_line.credit > 0: - bank_line.transfer_move_line_id = move_line - - @api.one - def debit_reconcile(self): - """ - Reconcile a debit order's payment line with the the move line - that it is based on. Called from payment_order.action_sent(). - As the amount is derived directly from the counterpart move line, - we do not expect a write off. Take partial reconciliations into - account though. - - :param payment_line_id: the single id of the canceled payment line - """ - - transit_move_line = self.transit_move_line_id - - assert not transit_move_line.reconcile_id,\ - 'Transit move should not be reconciled' - assert not transit_move_line.reconcile_partial_id,\ - 'Transit move should not be partially reconciled' - lines_to_rec = transit_move_line - 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.reconcile_id: - 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_move_line.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_move_line.account_id.code)) - - lines_to_rec += payment_line.move_line_id - - lines_to_rec.reconcile_partial(type='auto') diff --git a/account_banking_payment_transfer/post_install.py b/account_banking_payment_transfer/post_install.py deleted file mode 100644 index e8b85ea5b..000000000 --- a/account_banking_payment_transfer/post_install.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2015 Akretion - Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - - -def set_date_sent(cr, pool): - cr.execute('UPDATE payment_order set date_sent=date_done') diff --git a/account_banking_payment_transfer/static/description/icon.png b/account_banking_payment_transfer/static/description/icon.png deleted file mode 100644 index 3a0328b516c4980e8e44cdb63fd945757ddd132d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPh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iG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I diff --git a/account_banking_payment_transfer/view/account_payment.xml b/account_banking_payment_transfer/view/account_payment.xml deleted file mode 100644 index 4ed6b9c62..000000000 --- a/account_banking_payment_transfer/view/account_payment.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - account.payment.order.form (account_banking_payment_transfer) - payment.order - - - - - - - - - - - - - account_banking_payment_transfer.payment.order.tree - payment.order - - - - - - - - - - diff --git a/account_banking_payment_transfer/workflow/account_payment.xml b/account_banking_payment_transfer/workflow/account_payment.xml deleted file mode 100644 index ec49fa56b..000000000 --- a/account_banking_payment_transfer/workflow/account_payment.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - sent - - action_sent() - function - - - - sent_wait - - write({'state': 'sent'}) - function - - - - rejected - - action_rejected() -write({'state':'rejected'}) - function - - - - - - sent - - - - - - done - - - - - - - - - - - test_done() - done - - - - - test_done() - account.move.line - get_transfer_move_line_ids() - - - - - - rejected - - - - - - - - - - - test_undo_done() - undo_done - - - - - test_undo_done() - account.move.line - get_transfer_move_line_ids() - - - - diff --git a/account_payment_order/models/__init__.py b/account_payment_order/models/__init__.py index 48e597645..650494570 100644 --- a/account_payment_order/models/__init__.py +++ b/account_payment_order/models/__init__.py @@ -4,6 +4,7 @@ from . import account_payment_mode from . import account_payment_order from . import account_payment_line from . import bank_payment_line +from . import account_move from . import account_move_line from . import account_invoice from . import res_bank diff --git a/account_payment_order/models/account_invoice.py b/account_payment_order/models/account_invoice.py index 79290ca53..7431e12b2 100644 --- a/account_payment_order/models/account_invoice.py +++ b/account_payment_order/models/account_invoice.py @@ -38,7 +38,8 @@ class AccountInvoice(models.Model): } if self.payment_mode_id.bank_account_link == 'fixed': vals['journal_id'] = self.payment_mode_id.fixed_journal_id.id - # TODO : else: no filter on allowed bank accounts, because onchange not played ?? + # TODO : else: no filter on allowed bank accounts, + # because onchange not played ?? return vals @api.multi diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py new file mode 100644 index 000000000..1fda02896 --- /dev/null +++ b/account_payment_order/models/account_move.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields + + +class AccountMove(models.Model): + _inherit = 'account.move' + + payment_order_id = fields.Many2one( + 'account.payment.order', string='Payment Order', copy=False, + readonly=True) diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index ab8a58aea..1a7870950 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -4,41 +4,17 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, fields, api -from openerp.tools import float_is_zero class AccountMoveLine(models.Model): _inherit = 'account.move.line' - # TODO Should we keep this field ? -# journal_entry_ref = fields.Char(compute='_get_journal_entry_ref', -# string='Journal Entry Ref') partner_bank_id = fields.Many2one( 'res.partner.bank', string='Partner Bank Account', help='Bank account on which we should pay the supplier') - -# @api.one -# def _get_journal_entry_ref(self): -# if self.move_id.state == 'draft': -# if self.invoice.id: -# self.journal_entry_ref = self.invoice.number -# else: -# self.journal_entry_ref = '*' + str(self.move_id.id) -# else: -# self.journal_entry_ref = self.move_id.name - - @api.multi - def get_balance(self): - """ - Return the balance of any set of move lines. - - Not to be confused with the 'balance' field on this model, which - returns the account balance that the move line applies to. - """ - total = 0.0 - for line in self: - total += (line.debit or 0.0) - (line.credit or 0.0) - return total + 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): @@ -67,8 +43,8 @@ class AccountMoveLine(models.Model): 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 - precision = self.env['decimal.precision'].precision_get('Account') + # TODO : check that self.amount_residual_currency is 0 + # in this case if payment_order.payment_type == 'outbound': amount_currency *= -1 vals = { diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index 2503b813c..99dd15de2 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -80,6 +80,9 @@ class AccountPaymentOrder(models.Model): 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='Transfer Journal Entries', + readonly=True) @api.multi @api.constrains('payment_type', 'payment_mode_id') @@ -271,135 +274,108 @@ class AccountPaymentOrder(models.Model): # Generation of transfer move @api.multi def _prepare_transfer_move(self): + if self.payment_type == 'outbound': + ref = _('Payment order %s') % self.name + else: + ref = _('Debit order %s') % self.name vals = { - 'journal_id': self.mode.transfer_journal_id.id, - 'ref': '%s %s' % ( - self.payment_order_type[:3].upper(), self.reference) + 'journal_id': self.payment_mode_id.transfer_journal_id.id, + 'ref': ref, + 'payment_order_id': self.id, + 'line_ids': [], } return vals @api.multi def _prepare_move_line_transfer_account( - self, amount, move, bank_payment_lines, labels): - if len(bank_payment_lines) == 1: - partner_id = bank_payment_lines[0].partner_id.id - name = _('%s bank line %s') % (labels[self.payment_order_type], - bank_payment_lines[0].name) + self, amount, bank_payment_lines): + if self.payment_type == 'outbound': + name = _('Payment order %s') % self.name else: - partner_id = False - name = '%s %s' % ( - labels[self.payment_order_type], self.reference) + name = _('Debit order %s') % self.name date_maturity = bank_payment_lines[0].date vals = { 'name': name, - 'move_id': move.id, - 'partner_id': partner_id, - 'account_id': self.mode.transfer_account_id.id, - 'credit': (self.payment_order_type == 'payment' and + 'partner_id': False, + 'account_id': self.payment_mode_id.transfer_account_id.id, + 'credit': (self.payment_type == 'outbound' and amount or 0.0), - 'debit': (self.payment_order_type == 'debit' and + '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, move, labels): + 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_order_type == 'debit': + if self.payment_type == 'inbound': account_id =\ - bank_line.partner_id.property_account_receivable.id + bank_line.partner_id.property_account_receivable_id.id else: - account_id = bank_line.partner_id.property_account_payable.id + 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': _('%s line %s') % ( - labels[self.payment_order_type], bank_line.name), - 'move_id': move.id, + 'name': name, + 'bank_payment_line_id': bank_line.id, 'partner_id': bank_line.partner_id.id, 'account_id': account_id, - 'credit': (self.payment_order_type == 'debit' and + 'credit': (self.payment_type == 'inbound' and bank_line.amount_currency or 0.0), - 'debit': (self.payment_order_type == 'payment' and + 'debit': (self.payment_type == 'outbound' and bank_line.amount_currency or 0.0), } return vals - @api.multi - def action_sent_no_move_line_hook(self, pay_line): - """This function is designed to be inherited""" - return - - @api.multi - def _create_move_line_partner_account(self, bank_line, move, labels): - """This method is designed to be inherited in a custom module""" - # TODO: take multicurrency into account - company_currency = self.env.user.company_id.currency_id - if bank_line.currency != company_currency: - raise UserError(_( - "Cannot generate the transfer 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.") - % (bank_line.currency.name, company_currency.name)) - aml_obj = self.env['account.move.line'] - # create the payment/debit counterpart move line - # on the partner account - partner_ml_vals = self._prepare_move_line_partner_account( - bank_line, move, labels) - partner_move_line = aml_obj.create(partner_ml_vals) - - # register the payment/debit move line - # on the payment line and call reconciliation on it - bank_line.write({'transit_move_line_id': partner_move_line.id}) - - @api.multi - def _reconcile_payment_lines(self, bank_payment_lines): - for bline in bank_payment_lines: - if all([pline.move_line_id for pline in bline.payment_line_ids]): - bline.debit_reconcile() - else: - self.action_sent_no_move_line_hook(bline) - @api.multi def generate_transfer_move(self): """ Create the moves that pay off the move lines from - the debit order. + the payment/debit order. """ self.ensure_one() am_obj = self.env['account.move'] - aml_obj = self.env['account.move.line'] - labels = { - 'outbound': _('Payment'), - 'inbound': _('Direct debit'), - } # prepare a dict "trfmoves" that can be used when - # self.mode.transfer_move_option = date or line + # self.payment_mode_id.transfer_move_option = date or line # key = unique identifier (date or True or line.id) - # value = [pay_line1, pay_line2, ...] + # value = bank_pay_lines (recordset that can have several entries) trfmoves = {} for bline in self.bank_line_ids: hashcode = bline.move_line_transfer_account_hashcode() if hashcode in trfmoves: - trfmoves[hashcode].append(bline) + trfmoves[hashcode] += bline else: - trfmoves[hashcode] = [bline] + trfmoves[hashcode] = bline + company_currency = self.env.user.company_id.currency_id for hashcode, blines in trfmoves.iteritems(): mvals = self._prepare_transfer_move() - move = am_obj.create(mvals) total_amount = 0 for bline in blines: total_amount += bline.amount_currency - self._create_move_line_partner_account(bline, move, labels) - # create the payment/debit move line on the transfer account + if bline.currency_id != company_currency: + raise UserError(_( + "Cannot generate the transfer 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_transfer_account( - total_amount, move, blines, labels) - aml_obj.create(trf_ml_vals) - self._reconcile_payment_lines(blines) + total_amount, blines) + mvals['line_ids'].append((0, 0, trf_ml_vals)) + move = am_obj.create(mvals) + blines.reconcile_payment_lines() move.post() diff --git a/account_payment_order/models/bank_payment_line.py b/account_payment_order/models/bank_payment_line.py index 6eab672dd..8126709cf 100644 --- a/account_payment_order/models/bank_payment_line.py +++ b/account_payment_order/models/bank_payment_line.py @@ -2,7 +2,8 @@ # © 2015 Akretion - Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import models, fields, api +from openerp import models, fields, api, _ +from openerp.exceptions import UserError class BankPaymentLine(models.Model): @@ -45,32 +46,10 @@ class BankPaymentLine(models.Model): related='payment_line_ids.communication_type', readonly=True) communication = fields.Char( string='Communication', required=True, - readonly=True) #, states={'draft': [('readonly', False)]}) + readonly=True) company_id = fields.Many2one( related='order_id.payment_mode_id.company_id', store=True, readonly=True) - # TODO : not shown in view ? - # why on bank payment line and not on payment line ? - transit_move_line_id = fields.Many2one( - 'account.move.line', string='Transfer Move Line', readonly=True, - help="Move line through which the payment/debit order " - "pays the invoice") - transfer_move_line_id = fields.Many2one( - 'account.move.line', compute='_get_transfer_move_line', - string='Transfer move line counterpart', - help="Counterpart move line on the transfer account") - - @api.multi - def _get_transfer_move_line(self): - for bank_line in self: - if bank_line.transit_move_line_id: - payment_type = bank_line.payment_type - trf_lines = bank_line.transit_move_line_id.move_id.line_id - for move_line in trf_lines: - if payment_type == 'inbound' and move_line.debit > 0: - bank_line.transfer_move_line_id = move_line - elif payment_type == 'outbound' and move_line.credit > 0: - bank_line.transfer_move_line_id = move_line @api.model def same_fields_payment_line_and_bank_payment_line(self): @@ -113,3 +92,54 @@ class BankPaymentLine(models.Model): hashcode = unicode(self.id) return hashcode + @api.multi + def reconcile_payment_lines(self): + for bline in self: + if all([pline.move_line_id for pline in bline.payment_line_ids]): + bline.reconcile() + else: + bline.no_reconcile_hook() + + @api.multi + def no_reconcile_hook(self): + """This method is designed to be inherited if needed""" + return + + @api.multi + def reconcile(self): + self.ensure_one() + amlo = self.env['account.move.line'] + transit_mlines = amlo.search([('bank_payment_line_id', '=', self.id)]) + assert len(transit_mlines) == 1, 'We should have only 1 move' + transit_mline = transit_mlines[0] + assert not transit_mline.reconciled,\ + 'Transit move should not be reconciled' + lines_to_rec = transit_mline + for payment_line in self.payment_line_ids: + + if not payment_line.move_line_id: + raise UserError(_( + "Can not reconcile: no move line for " + "payment line %s of partner '%s'.") % ( + payment_line.name, + payment_line.partner_id.name)) + if payment_line.move_line_id.reconciled: + raise UserError(_( + "Move line '%s' of partner '%s' has already " + "been reconciled") % ( + payment_line.move_line_id.name, + payment_line.partner_id.name)) + if ( + payment_line.move_line_id.account_id != + transit_mline.account_id): + raise UserError(_( + "For partner '%s', the account of the account " + "move line to pay (%s) is different from the " + "account of of the transit move line (%s).") % ( + payment_line.move_line_id.partner_id.name, + payment_line.move_line_id.account_id.code, + transit_mline.account_id.code)) + + lines_to_rec += payment_line.move_line_id + + lines_to_rec.reconcile() diff --git a/account_banking_payment_transfer/test/data.yml b/account_payment_order/test/data.yml similarity index 100% rename from account_banking_payment_transfer/test/data.yml rename to account_payment_order/test/data.yml diff --git a/account_banking_payment_transfer/test/test_partial_payment_refunded.yml b/account_payment_order/test/test_partial_payment_refunded.yml similarity index 100% rename from account_banking_payment_transfer/test/test_partial_payment_refunded.yml rename to account_payment_order/test/test_partial_payment_refunded.yml diff --git a/account_banking_payment_transfer/test/test_partial_payment_transfer.yml b/account_payment_order/test/test_partial_payment_transfer.yml similarity index 100% rename from account_banking_payment_transfer/test/test_partial_payment_transfer.yml rename to account_payment_order/test/test_partial_payment_transfer.yml diff --git a/account_banking_payment_transfer/test/test_payment_method.yml b/account_payment_order/test/test_payment_method.yml similarity index 100% rename from account_banking_payment_transfer/test/test_payment_method.yml rename to account_payment_order/test/test_payment_method.yml diff --git a/account_payment_order/views/account_move_line.xml b/account_payment_order/views/account_move_line.xml index d9e606d11..1179fe817 100644 --- a/account_payment_order/views/account_move_line.xml +++ b/account_payment_order/views/account_move_line.xml @@ -18,6 +18,7 @@ + diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml index b6eb332e7..47ba96f79 100644 --- a/account_payment_order/views/account_payment_mode.xml +++ b/account_payment_order/views/account_payment_mode.xml @@ -23,7 +23,7 @@ + context="{'default_reconcile': True, 'default_company_id': company_id}"/> + + + diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index 7703d885d..043fd3565 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -91,11 +91,11 @@ class AccountPaymentLineCreate(models.TransientModel): # 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 + # '&', + # ('account_id.internal_type', '=', 'receivable'), + # ('reconcile_partial_id', '=', False), # TODO uncomment ] elif self.order_id.payment_type == 'inbound': domain += [