From 673d8b0de613d9905706fb13f8fcfe7ff68b2817 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 19 Aug 2015 02:26:12 +0200 Subject: [PATCH] [FIX+IMP] account_reconcile_payment_order: Take into account payment orders "non transferred" + Improvements in README+manifest --- account_reconcile_payment_order/README.rst | 33 +++++++++++++++---- .../__openerp__.py | 8 +++-- .../i18n/account_reconcile_payment_order.pot | 20 +++++++++++ account_reconcile_payment_order/i18n/de.po | 24 ++++++++++++++ account_reconcile_payment_order/i18n/fr.po | 24 ++++++++++++++ account_reconcile_payment_order/i18n/it.po | 24 ++++++++++++++ account_reconcile_payment_order/i18n/nl_NL.po | 24 ++++++++++++++ account_reconcile_payment_order/i18n/sl.po | 25 ++++++++++++++ .../models/account_bank_statement_line.py | 11 +++++-- 9 files changed, 180 insertions(+), 13 deletions(-) create mode 100644 account_reconcile_payment_order/i18n/account_reconcile_payment_order.pot create mode 100644 account_reconcile_payment_order/i18n/de.po create mode 100644 account_reconcile_payment_order/i18n/fr.po create mode 100644 account_reconcile_payment_order/i18n/it.po create mode 100644 account_reconcile_payment_order/i18n/nl_NL.po create mode 100644 account_reconcile_payment_order/i18n/sl.po diff --git a/account_reconcile_payment_order/README.rst b/account_reconcile_payment_order/README.rst index 9ce5ae5f..d16c8eae 100644 --- a/account_reconcile_payment_order/README.rst +++ b/account_reconcile_payment_order/README.rst @@ -1,23 +1,41 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================== Reconcile payment orders ======================== -Payment orders that show up as as one big transaction can be difficult for the accounting to handle if a transfer acount is used. In this case, we need to reconcile this transaction with possibly hunderds of move lines, which can be a bit tiresome. This module tries to recognize transactions deriving from payment orders and propose the unreconciled move lines from this payment order. +Payment orders that show up as one big transaction can be difficult for the +accounting to handle if a transfer account is used. In this case, we need to +reconcile this transaction with possibly hundreds of move lines, which can be a +bit tiresome. This module tries to recognize transactions deriving from payment +orders and propose the unreconciled move lines from this payment order. + +Installation +============ + +This module requires the module **account_banking_payment_transfer**, available +in https://github.com/OCA/bank-payment. Usage ===== -It should just work. What the module does is to search for a payment order in state 'sent' that has the same amount as the statement line, and the same bank account than the statement. +It should just work. What the module does is to search for a payment order in +state 'sent' (for orders transferred to an intermediate account) or done (for +orders non transferred) that has the same amount as the statement line, and the +same bank account than the statement. If any, all move lines are automatically +proposed for the reconcile. -For further information, please visit: - -* https://www.odoo.com/forum/help-1 +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/98/8.0 Known issues / Roadmap ====================== -* it would be good to check references too, but at least the bank in use here changes some characters, so this doesn't seem to be a general solution. +* it would be good to check references too, but at least the bank in use here + changes some characters, so this doesn't seem to be a general solution. Bug Tracker =========== @@ -34,6 +52,7 @@ Contributors ------------ * Holger Brunn +* Pedro M. Baeza Maintainer ---------- diff --git a/account_reconcile_payment_order/__openerp__.py b/account_reconcile_payment_order/__openerp__.py index 3b45c14e..84e2a80d 100644 --- a/account_reconcile_payment_order/__openerp__.py +++ b/account_reconcile_payment_order/__openerp__.py @@ -19,11 +19,13 @@ ############################################################################## { "name": "Reconcile payment orders", - "version": "1.0", - "author": "Therp BV,Odoo Community Association (OCA)", + "version": "8.0.1.0.0", + "author": "Therp BV," + "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Accounting & Finance", - "summary": "Automatically reconcile all lines from sent payment orders", + "summary": "Automatically reconcile all lines from payment orders", "depends": [ 'account_banking_payment_transfer', ], diff --git a/account_reconcile_payment_order/i18n/account_reconcile_payment_order.pot b/account_reconcile_payment_order/i18n/account_reconcile_payment_order.pot new file mode 100644 index 00000000..1eb8ac1c --- /dev/null +++ b/account_reconcile_payment_order/i18n/account_reconcile_payment_order.pot @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \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_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "" + diff --git a/account_reconcile_payment_order/i18n/de.po b/account_reconcile_payment_order/i18n/de.po new file mode 100644 index 00000000..525c694d --- /dev/null +++ b/account_reconcile_payment_order/i18n/de.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-14 09:25+0000\n" +"PO-Revision-Date: 2015-08-19 00:32+0000\n" +"Last-Translator: <>\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-bank-statement-" +"reconcile-8-0/language/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Kontoauszugzeile" diff --git a/account_reconcile_payment_order/i18n/fr.po b/account_reconcile_payment_order/i18n/fr.po new file mode 100644 index 00000000..a0f73c7c --- /dev/null +++ b/account_reconcile_payment_order/i18n/fr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-20 02:39+0000\n" +"PO-Revision-Date: 2015-08-19 00:32+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-bank-statement-" +"reconcile-8-0/language/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Ligne de relevé bancaire" diff --git a/account_reconcile_payment_order/i18n/it.po b/account_reconcile_payment_order/i18n/it.po new file mode 100644 index 00000000..b34c2286 --- /dev/null +++ b/account_reconcile_payment_order/i18n/it.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-14 09:25+0000\n" +"PO-Revision-Date: 2015-08-19 00:32+0000\n" +"Last-Translator: <>\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-bank-statement-" +"reconcile-8-0/language/it/)\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Linea estratto conto" diff --git a/account_reconcile_payment_order/i18n/nl_NL.po b/account_reconcile_payment_order/i18n/nl_NL.po new file mode 100644 index 00000000..1485a844 --- /dev/null +++ b/account_reconcile_payment_order/i18n/nl_NL.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 00:30+0000\n" +"PO-Revision-Date: 2015-08-19 00:32+0000\n" +"Last-Translator: <>\n" +"Language-Team: Dutch (Netherlands) (http://www.transifex.com/oca/OCA-bank-" +"statement-reconcile-8-0/language/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Bankafschriftregel" diff --git a/account_reconcile_payment_order/i18n/sl.po b/account_reconcile_payment_order/i18n/sl.po new file mode 100644 index 00000000..86e86e8b --- /dev/null +++ b/account_reconcile_payment_order/i18n/sl.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_payment_order +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-reconcile (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-19 00:32+0000\n" +"PO-Revision-Date: 2015-08-19 00:32+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-statement-" +"reconcile-8-0/language/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \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_reconcile_payment_order +#: model:ir.model,name:account_reconcile_payment_order.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Postavka bančnega izpiska" diff --git a/account_reconcile_payment_order/models/account_bank_statement_line.py b/account_reconcile_payment_order/models/account_bank_statement_line.py index 759f3aee..ece9f634 100644 --- a/account_reconcile_payment_order/models/account_bank_statement_line.py +++ b/account_reconcile_payment_order/models/account_bank_statement_line.py @@ -35,7 +35,7 @@ class AccountBankStatementLine(models.Model): select order_id, sum(amount_currency) as amount from payment_line join payment_order o on o.id=order_id - where o.state = 'sent' + where o.state in ('sent', 'done') group by order_id) select order_id from order_sums where amount = %s''', (Decimal(float_repr(abs(this.amount), digits)),)) @@ -55,9 +55,14 @@ class AccountBankStatementLine(models.Model): def get_reconcile_lines_from_order(self, this, orders, excluded_ids=None): """return lines to reconcile our statement line with""" order = orders[0] + if order.state == 'sent': + move_lines_list = list(set(order._get_transfer_move_lines())) + else: + move_lines = order.line_ids.mapped('move_line_id').filtered( + lambda x: not x.reconcile_id) + move_lines_list = [x for x in move_lines] return self.env['account.move.line']\ - .prepare_move_lines_for_reconciliation_widget( - list(set(order._get_transfer_move_lines()))) + .prepare_move_lines_for_reconciliation_widget(move_lines_list) @api.model def get_reconciliation_proposition(self, this, excluded_ids=None):