Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17.0 mig account caba payment date #769

Open
wants to merge 4 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions account_caba_payment_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
=========================
Account CABA Payment Date
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:214539255d584a94952b8c2f037206ee10c394a2e2634a2ccfea4bbd6ac72ea8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/17.0/account_caba_payment_date
: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-17-0/account-payment-17-0-account_caba_payment_date
: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=17.0
:alt: Try me on Runboat

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

This module change the date of the CABA move to the day of the payment.

This module is required to fix the following use case:

Create a payment at day 1 of the month Create an invoice at day 15 of
the month

The CABA move will be created at day 15 of the month, but it needs to be
the day of the payment to comply with the fiscal requirements.

.. 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:

Usage
=====

To use this module, you need to go to:

- Create an Invoice and Register Payment
- On the CABA move, you can see that the date is the same as the
payment date

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_caba_payment_date%0Aversion:%2017.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
-------

* Jarsa

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

- `Jarsa <https://www.jarsa.com>`__:

- Alan Ramos <[email protected]>

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-alan196| image:: https://github.com/alan196.png?size=40px
:target: https://github.com/alan196
:alt: alan196

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

|maintainer-alan196|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions account_caba_payment_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Jarsa (https://www.jarsa.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from . import models
16 changes: 16 additions & 0 deletions account_caba_payment_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Jarsa (https://www.jarsa.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

{
"name": "Account CABA Payment Date",
"version": "17.0.1.0.0",
"author": "Jarsa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-payment",
"license": "LGPL-3",
"category": "Accounting & Finance",
"summary": "Set CABA date based on payment date",
"depends": ["account"],
"installable": True,
"development_status": "Alpha",
"maintainers": ["alan196"],
}
4 changes: 4 additions & 0 deletions account_caba_payment_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2024 Jarsa (https://www.jarsa.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from . import account_partial_reconcile
21 changes: 21 additions & 0 deletions account_caba_payment_date/models/account_partial_reconcile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Jarsa (https://www.jarsa.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import models


class AccountPartialReconcile(models.Model):
_inherit = "account.partial.reconcile"

def _create_tax_cash_basis_moves(self):
moves = super()._create_tax_cash_basis_moves()
date = self.max_date

Check warning on line 12 in account_caba_payment_date/models/account_partial_reconcile.py

View check run for this annotation

Codecov / codecov/patch

account_caba_payment_date/models/account_partial_reconcile.py#L11-L12

Added lines #L11 - L12 were not covered by tests
if self.debit_move_id.journal_id.type in ["bank", "cash"]:
date = self.debit_move_id.date

Check warning on line 14 in account_caba_payment_date/models/account_partial_reconcile.py

View check run for this annotation

Codecov / codecov/patch

account_caba_payment_date/models/account_partial_reconcile.py#L14

Added line #L14 was not covered by tests
elif self.credit_move_id.journal_id.type in ["bank", "cash"]:
date = self.credit_move_id.date
vals = {"date": date}
moves.write(vals)

Check warning on line 18 in account_caba_payment_date/models/account_partial_reconcile.py

View check run for this annotation

Codecov / codecov/patch

account_caba_payment_date/models/account_partial_reconcile.py#L16-L18

Added lines #L16 - L18 were not covered by tests
if date.month != self.max_date.month:
moves._compute_name()
return moves

Check warning on line 21 in account_caba_payment_date/models/account_partial_reconcile.py

View check run for this annotation

Codecov / codecov/patch

account_caba_payment_date/models/account_partial_reconcile.py#L20-L21

Added lines #L20 - L21 were not covered by tests
3 changes: 3 additions & 0 deletions account_caba_payment_date/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions account_caba_payment_date/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Jarsa](https://www.jarsa.com):
- Alan Ramos \<<[email protected]>\>
9 changes: 9 additions & 0 deletions account_caba_payment_date/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This module change the date of the CABA move to the day of the payment.

This module is required to fix the following use case:

Create a payment at day 1 of the month Create an invoice at day 15 of
the month

The CABA move will be created at day 15 of the month, but it needs to be
the day of the payment to comply with the fiscal requirements.
5 changes: 5 additions & 0 deletions account_caba_payment_date/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to go to:

- Create an Invoice and Register Payment
- On the CABA move, you can see that the date is the same as the payment
date
Loading
Loading