[FIX+IMP] account_reconcile_payment_order: Take into account payment orders "non transferred" + Improvements in README+manifest
parent
b797b149fb
commit
5937302724
|
@ -1,23 +1,41 @@
|
||||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
.. 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
|
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
|
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:
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
|
:alt: Try me on Runbot
|
||||||
* https://www.odoo.com/forum/help-1
|
:target: https://runbot.odoo-community.org/runbot/98/8.0
|
||||||
|
|
||||||
Known issues / Roadmap
|
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
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
@ -34,6 +52,7 @@ Contributors
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* Holger Brunn <hbrunn@therp.nl>
|
* Holger Brunn <hbrunn@therp.nl>
|
||||||
|
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -19,11 +19,13 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
{
|
{
|
||||||
"name": "Reconcile payment orders",
|
"name": "Reconcile payment orders",
|
||||||
"version": "1.0",
|
"version": "8.0.1.0.0",
|
||||||
"author": "Therp BV,Odoo Community Association (OCA)",
|
"author": "Therp BV,"
|
||||||
|
"Serv. Tecnol. Avanzados - Pedro M. Baeza,"
|
||||||
|
"Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"category": "Accounting & Finance",
|
"category": "Accounting & Finance",
|
||||||
"summary": "Automatically reconcile all lines from sent payment orders",
|
"summary": "Automatically reconcile all lines from payment orders",
|
||||||
"depends": [
|
"depends": [
|
||||||
'account_banking_payment_transfer',
|
'account_banking_payment_transfer',
|
||||||
],
|
],
|
||||||
|
|
|
@ -35,7 +35,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
select order_id, sum(amount_currency) as amount
|
select order_id, sum(amount_currency) as amount
|
||||||
from payment_line
|
from payment_line
|
||||||
join payment_order o on o.id=order_id
|
join payment_order o on o.id=order_id
|
||||||
where o.state = 'sent'
|
where o.state in ('sent', 'done')
|
||||||
group by order_id)
|
group by order_id)
|
||||||
select order_id from order_sums where amount = %s''',
|
select order_id from order_sums where amount = %s''',
|
||||||
(Decimal(float_repr(abs(this.amount), digits)),))
|
(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):
|
def get_reconcile_lines_from_order(self, this, orders, excluded_ids=None):
|
||||||
"""return lines to reconcile our statement line with"""
|
"""return lines to reconcile our statement line with"""
|
||||||
order = orders[0]
|
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']\
|
return self.env['account.move.line']\
|
||||||
.prepare_move_lines_for_reconciliation_widget(
|
.prepare_move_lines_for_reconciliation_widget(move_lines_list)
|
||||||
list(set(order._get_transfer_move_lines())))
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_reconciliation_proposition(self, this, excluded_ids=None):
|
def get_reconciliation_proposition(self, this, excluded_ids=None):
|
||||||
|
|
Loading…
Reference in New Issue