Skip to content

Commit

Permalink
[ADD] account_move_line_payment: simple partial overdue payment flow
Browse files Browse the repository at this point in the history
New module that simplifies the use case of registering partial invoice payments.

@moduon MT-5071
  • Loading branch information
yajo committed Feb 14, 2024
1 parent 0fe5098 commit 24c73f3
Show file tree
Hide file tree
Showing 17 changed files with 791 additions and 0 deletions.
159 changes: 159 additions & 0 deletions account_move_line_payment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
=====================
Register due payments
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b954e30cc41e6c3b424294b7eff1a2e1968588e534affb4f5275962087e9981d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--payment-lightgray.png?logo=github
:target: https://github.com/OCA/account-payment/tree/16.0/account_move_line_payment
:alt: OCA/account-payment
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-payment-16-0/account-payment-16-0-account_move_line_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-payment&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of accounting to let you quickly
find which journal items are due today and register payments for them
individually, even if they are partial invoice payments. They also get
appropriately matched automatically.

In simpler words, you can find and register due payments, regardless if
the invoice had one or more payment terms.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

This module was developed because in the invoices list view, Odoo only
displays the due date of each invoice's last payment. However, most
times you only need to know which payments are due *today*, even if
there's a later payment for that invoice.

At the same time, if you register a partial payment, Odoo will match it
only partially, even when that was the expected payment due.

When there are a lot of partial payments, it becomes impossible to
handle manually without a module like this one.

Configuration
=============

To use this module, if you're using Odoo CE:

#. Activate the developer mode. #. Go to *Settings > Users & Companies >
Groups*. #. Edit *Technical / Show Full Accounting Features*. #. Add
yourself to *Users*

Usage
=====

To find unmatched payments due today (or before):

1. Go to *Accounting > Accounting > Journals > Journal Items*.
2. Go to *Filters > Overdue*.
3. Filter also by *Filters > Receivable* or *Filters > Payable*. You
can't mix both in the next step.
4. Select all payments to pay.
5. Click on *Actions > Register payment*.
6. Register the payment as you usually do from the invoices view.

Only those payments that you selected will be registered. They will
become fully matched.

Known issues / Roadmap
======================

- To use this new feature, you need full accounting permissions (a.k.a.
Bookkeeper).
- Invoicing users should be able too.
- A good improvement would be to display *Next due date* in invoices
views.
- Also to allow somehow paying only overdue payments when using the
register payment wizard.
- This feature already exists in Odoo 17 under *Invoicing >
Customers/Vendors > Amounts to settle*, so there's no need to
forward-port this module.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-payment/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-payment/issues/new?body=module:%20account_move_line_payment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Moduon

Contributors
------------

- Rafael Blasco (`Moduon <https://www.moduon.team/>`__)
- Jairo Llopis (`Moduon <https://www.moduon.team/>`__)

Other credits
-------------

The development of this module has been financially supported by:

- `Moduon Team S.L. <https://www.moduon.team/>`__

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px
:target: https://github.com/yajo
:alt: yajo
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
:target: https://github.com/rafaelbn
:alt: rafaelbn

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-yajo| |maintainer-rafaelbn|

This module is part of the `OCA/account-payment <https://github.com/OCA/account-payment/tree/16.0/account_move_line_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 6 additions & 0 deletions account_move_line_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import models

# from . import wizards
# from . import controllers
# from . import report
# from .hooks import pre_init_hook, post_load, post_init_hook, uninstall_hook
20 changes: 20 additions & 0 deletions account_move_line_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

{
"name": "Register due payments",
"summary": "Register only due payments",
"version": "16.0.1.0.0",
"development_status": "Alpha",
"category": "Accounting/Payment",
"website": "https://github.com/OCA/account-payment",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["yajo", "rafaelbn"],
"license": "LGPL-3",
"application": False,
"auto_install": False,
"depends": ["account"],
"data": [
"views/account_move_line_view.xml",
],
}
1 change: 1 addition & 0 deletions account_move_line_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move_line
29 changes: 29 additions & 0 deletions account_move_line_payment/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)


from odoo import api, fields, models


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

pending_due_date = fields.Date(
string="Remaining due days",
compute="_compute_pending_due_date",
store=True,
index=True,
help="The date when the payment is due, or empty if it's done.",
)

@api.depends("date_maturity", "matching_number")
def _compute_pending_due_date(self):
"""Establish due date for pending payments.
If a payment is matched, it means it's paid. We empty the field if the
payment is done, so the `remaining_days` widget is nicer for the user.
"""
matched = self.filtered("matching_number")
matched.pending_due_date = False
for move in self - matched:
move.pending_due_date = move.date_maturity
6 changes: 6 additions & 0 deletions account_move_line_payment/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, if you're using Odoo CE:

#. Activate the developer mode.
#. Go to *Settings > Users & Companies > Groups*.
#. Edit *Technical / Show Full Accounting Features*.
#. Add yourself to *Users*
10 changes: 10 additions & 0 deletions account_move_line_payment/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This module was developed because in the invoices list view, Odoo only displays
the due date of each invoice's last payment. However, most times you only need
to know which payments are due *today*, even if there's a later payment for
that invoice.

At the same time, if you register a partial payment, Odoo will match it only
partially, even when that was the expected payment due.

When there are a lot of partial payments, it becomes impossible to handle
manually without a module like this one.
2 changes: 2 additions & 0 deletions account_move_line_payment/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Rafael Blasco ([Moduon](https://www.moduon.team/))
- Jairo Llopis ([Moduon](https://www.moduon.team/))
3 changes: 3 additions & 0 deletions account_move_line_payment/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The development of this module has been financially supported by:

- [Moduon Team S.L.](https://www.moduon.team/)
7 changes: 7 additions & 0 deletions account_move_line_payment/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module extends the functionality of accounting to let you quickly find
which journal items are due today and register payments for them individually,
even if they are partial invoice payments. They also get appropriately matched
automatically.

In simpler words, you can find and register due payments, regardless if the
invoice had one or more payment terms.
5 changes: 5 additions & 0 deletions account_move_line_payment/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- To use this new feature, you need full accounting permissions (a.k.a. Bookkeeper).
- Invoicing users should be able too.
- A good improvement would be to display *Next due date* in invoices views.
- Also to allow somehow paying only overdue payments when using the register payment wizard.
- This feature already exists in Odoo 17 under *Invoicing > Customers/Vendors > Amounts to settle*, so there's no need to forward-port this module.
12 changes: 12 additions & 0 deletions account_move_line_payment/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
To find unmatched payments due today (or before):

1. Go to *Accounting > Accounting > Journals > Journal Items*.
1. Go to *Filters > Overdue*.
1. Filter also by *Filters > Receivable* or *Filters > Payable*. You can't mix
both in the next step.
1. Select all payments to pay.
1. Click on *Actions > Register payment*.
1. Register the payment as you usually do from the invoices view.

Only those payments that you selected will be registered. They will become
fully matched.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 24c73f3

Please sign in to comment.