[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
|
||||
: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 <hbrunn@therp.nl>
|
||||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue