Skip to content

Commit

Permalink
[IMP] stock_account_move_reset_to_draft: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leemannd committed Nov 26, 2024
1 parent 6fd7805 commit 921bb40
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 94 deletions.
78 changes: 43 additions & 35 deletions stock_account_move_reset_to_draft/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ Stock account move reset to draft
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/16.0/stock_account_move_reset_to_draft
:target: https://github.com/OCA/account-invoicing/tree/17.0/stock_account_move_reset_to_draft
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-stock_account_move_reset_to_draft
:target: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-stock_account_move_reset_to_draft
: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-invoicing&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=17.0
:alt: Try me on Runboat

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

This module allows a vendor bill to be reverted to draft status even
when an SVL (Stock Valuation Layer) record is created due to a price difference between the receipt and the vendor bill,
when inventory from the receipt has yet to be consumed.
When a vendor bill is reset to draft, as applicable, a new SVL record is generated to offset the valuation difference that was generated upon the bill's confirmation.
when an SVL (Stock Valuation Layer) record is created due to a price
difference between the receipt and the vendor bill, when inventory from
the receipt has yet to be consumed. When a vendor bill is reset to
draft, as applicable, a new SVL record is generated to offset the
valuation difference that was generated upon the bill's confirmation.

**Table of contents**

Expand All @@ -41,61 +43,67 @@ When a vendor bill is reset to draft, as applicable, a new SVL record is generat
Use Cases / Context
===================

Typically, when a purchase invoice is created at a price different from the price
at which the SVLs of the incoming picking were initially created and confirmed,
SVLs are generated to account for the price difference.
Once this happens, the invoice cannot normally be reverted to draft due to stock_account restrictions.
Typically, when a purchase invoice is created at a price different from
the price at which the SVLs of the incoming picking were initially
created and confirmed, SVLs are generated to account for the price
difference. Once this happens, the invoice cannot normally be reverted
to draft due to stock_account restrictions.

Imagine international business settings where exchange rates are updated daily;
this limitation can be problematic. For example, if goods are received on April
17th and the vendor bill is processed on April 18th with a different exchange rate,
an SVL record is generated, locking the vendor bill. If a user then realizes a
mistake, such as processing the bill for the incorrect purchase order, they are
unable to cancel it.
Imagine international business settings where exchange rates are updated
daily; this limitation can be problematic. For example, if goods are
received on April 17th and the vendor bill is processed on April 18th
with a different exchange rate, an SVL record is generated, locking the
vendor bill. If a user then realizes a mistake, such as processing the
bill for the incorrect purchase order, they are unable to cancel it.

Usage
=====

#. Create a product category with Costing Method: Average Cost (AVCO) or First In First Out (FIFO).
#. Create a product linked to the category created before.
#. Create a purchase order and adds a product line with quantity 1 and price 10.
#. Confirms the purchase order and validates the incoming picking.
#. Creates an invoice from the purchase order.
#. Changes the invoice line price to 12 and confirm the invoice.
#. It is possible to reset the invoice to draft (a new SVL record to offset the existing SVL difference will be created).

When attempting to reset an invoice to draft for a product that has been partially or fully consumed,
the system will display the following error message: "The inventory has already been (partially) consumed."
In that case, consider using landed costs to adjust the valuation of the product as necessary.
1. Create a product category with Costing Method: Average Cost (AVCO) or
First In First Out (FIFO).
2. Create a product linked to the category created before.
3. Create a purchase order and adds a product line with quantity 1 and
price 10.
4. Confirms the purchase order and validates the incoming picking.
5. Creates an invoice from the purchase order.
6. Changes the invoice line price to 12 and confirm the invoice.
7. It is possible to reset the invoice to draft (a new SVL record to
offset the existing SVL difference will be created).

When attempting to reset an invoice to draft for a product that has been
partially or fully consumed, the system will display the following error
message: "The inventory has already been (partially) consumed." In that
case, consider using landed costs to adjust the valuation of the product
as necessary.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/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-invoicing/issues/new?body=module:%20stock_account_move_reset_to_draft%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20stock_account_move_reset_to_draft%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
~~~~~~~
-------

* Tecnativa

Contributors
~~~~~~~~~~~~
------------

* `Tecnativa <https://www.tecnativa.com>`_:
- `Tecnativa <https://www.tecnativa.com>`__:

* Víctor Martínez
* Pedro M. Baeza
- Víctor Martínez
- Pedro M. Baeza

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -115,6 +123,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-victoralmau|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions stock_account_move_reset_to_draft/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
12 changes: 12 additions & 0 deletions stock_account_move_reset_to_draft/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Typically, when a purchase invoice is created at a price different from
the price at which the SVLs of the incoming picking were initially
created and confirmed, SVLs are generated to account for the price
difference. Once this happens, the invoice cannot normally be reverted
to draft due to stock_account restrictions.

Imagine international business settings where exchange rates are updated
daily; this limitation can be problematic. For example, if goods are
received on April 17th and the vendor bill is processed on April 18th
with a different exchange rate, an SVL record is generated, locking the
vendor bill. If a user then realizes a mistake, such as processing the
bill for the incorrect purchase order, they are unable to cancel it.
11 changes: 0 additions & 11 deletions stock_account_move_reset_to_draft/readme/CONTEXT.rst

This file was deleted.

3 changes: 3 additions & 0 deletions stock_account_move_reset_to_draft/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- Pedro M. Baeza
4 changes: 0 additions & 4 deletions stock_account_move_reset_to_draft/readme/CONTRIBUTORS.rst

This file was deleted.

6 changes: 6 additions & 0 deletions stock_account_move_reset_to_draft/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module allows a vendor bill to be reverted to draft status even
when an SVL (Stock Valuation Layer) record is created due to a price
difference between the receipt and the vendor bill, when inventory from
the receipt has yet to be consumed. When a vendor bill is reset to
draft, as applicable, a new SVL record is generated to offset the
valuation difference that was generated upon the bill's confirmation.
4 changes: 0 additions & 4 deletions stock_account_move_reset_to_draft/readme/DESCRIPTION.rst

This file was deleted.

16 changes: 16 additions & 0 deletions stock_account_move_reset_to_draft/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
1. Create a product category with Costing Method: Average Cost (AVCO)
or First In First Out (FIFO).
2. Create a product linked to the category created before.
3. Create a purchase order and adds a product line with quantity 1 and
price 10.
4. Confirms the purchase order and validates the incoming picking.
5. Creates an invoice from the purchase order.
6. Changes the invoice line price to 12 and confirm the invoice.
7. It is possible to reset the invoice to draft (a new SVL record to
offset the existing SVL difference will be created).

When attempting to reset an invoice to draft for a product that has been
partially or fully consumed, the system will display the following error
message: "The inventory has already been (partially) consumed." In that
case, consider using landed costs to adjust the valuation of the product
as necessary.
11 changes: 0 additions & 11 deletions stock_account_move_reset_to_draft/readme/USAGE.rst

This file was deleted.

Loading

0 comments on commit 921bb40

Please sign in to comment.