Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ addon | version | maintainers | summary
[purchase_requisition_line_description](purchase_requisition_line_description/) | 18.0.1.0.0 | | Extends the functionality of Purchase Agreements to show line description.
[purchase_sale_link_by_origin](purchase_sale_link_by_origin/) | 18.0.1.0.0 | | Link PO/SO by the PO's Origin in addition to the default behavior that only links them by their lines
[purchase_security](purchase_security/) | 18.0.1.1.0 | <a href='https://github.com/pilarvargas-tecnativa'><img src='https://github.com/pilarvargas-tecnativa.png' width='32' height='32' style='border-radius:50%;' alt='pilarvargas-tecnativa'/></a> | See only your purchase orders
[purchase_stock_cost_update](purchase_stock_cost_update/) | 18.0.1.0.0 | <a href='https://github.com/chienandalu'><img src='https://github.com/chienandalu.png' width='32' height='32' style='border-radius:50%;' alt='chienandalu'/></a> <a href='https://github.com/rafaelbn'><img src='https://github.com/rafaelbn.png' width='32' height='32' style='border-radius:50%;' alt='rafaelbn'/></a> | Allows to update valuation layers once the purchase is received
[purchase_stock_manual_currency](purchase_stock_manual_currency/) | 18.0.1.0.0 | | Extends manual currency from purchase to stock moves
[purchase_stock_packaging](purchase_stock_packaging/) | 18.0.1.0.0 | <a href='https://github.com/rousseldenis'><img src='https://github.com/rousseldenis.png' width='32' height='32' style='border-radius:50%;' alt='rousseldenis'/></a> | Allows to transmit the product packaging from the procurement values to the generated purchase order line
[purchase_stock_price_unit_sync](purchase_stock_price_unit_sync/) | 18.0.1.0.0 | | Update cost price in stock moves already done
Expand Down
149 changes: 149 additions & 0 deletions purchase_stock_cost_update/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========================
Update costs from purchase
==========================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_stock_cost_update
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_stock_cost_update
: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/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

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

This module allows to adjust the valuation of the incoming goods related
to their purchase order from the purchase line itself.

**Table of contents**

.. contents::
:local:

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

When a purchase order is confirmed, the value of the received goods is
updated upon reception. It can happen anyway that the reception of the
goods is confirmed before the final price is recorded in the
corresponding purchase line.

For that, Odoo will fix the valuation when the invoice for that purchase
is confirmed, but that moment could be delayed for an uncertain period
of time while thos stored goods are being selled with wrong margins and
the value being discounted for a wrong price unit.

We want to fix those disalignments as soon as possible from the purchase
order while keeping the native mechanism to add later corrections from
the invoice itself.

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

In order to use this module, you need to have some storable products
valued on average cost (AVCO).

To do so:

- Go to *Inventory > Configuration > Product Categories* and select one.
- In the **Inventory valuation** section, select the **Costing method**
as **Average Cost (AVCO)**.
- Now all the products in that category will have that valuation rules.

Usage
=====

In order to test the module:

- Go to *Purchase > Orders* and create a new quotation.
- Add a product with AVCO valuation and set a price.
- Validate the purchase order.
- Receive the products.
- The products are now valued at the price you set in the order line.
- You can check it in *Inventory > Reporting > Valuation* (debug mode
needed).
- Now change the price in the order line.
- You'll see that the line has changed its color to yellow and a new
button *Fix valuation* shows up in the header.
- When you click that button, every disaligned valuation will be fixed.
If you go to the *Valuation* report you'll see the adjustment layer.
- After this, when you invoice the purchase you won't be able to edit
the price anymore.
- You can anyway add an additional valuation when you post the new
invoice prices.

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

- Only AVCO is supported

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/purchase-workflow/issues/new?body=module:%20purchase_stock_cost_update%0Aversion:%2018.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
------------

- David Vidal (`Moduon <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-chienandalu| image:: https://github.com/chienandalu.png?size=40px
:target: https://github.com/chienandalu
:alt: chienandalu
.. |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-chienandalu| |maintainer-rafaelbn|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_stock_cost_update>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions purchase_stock_cost_update/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions purchase_stock_cost_update/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2025 Moduon Team S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html).
{
"name": "Update costs from purchase",
"summary": "Allows to update valuation layers once the purchase is received",
"version": "18.0.1.0.0",
"category": "Purchase Management",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["chienandalu", "rafaelbn"],
"website": "https://github.com/OCA/purchase-workflow",
"license": "LGPL-3",
"depends": ["purchase_stock"],
"data": [
"views/purchase_order_form_views.xml",
"views/stock_valuation_layer_views.xml",
],
}
99 changes: 99 additions & 0 deletions purchase_stock_cost_update/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_cost_update
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-28 14:47+0000\n"
"PO-Revision-Date: 2025-10-28 15:50+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid "<i class=\"fa fa-info-circle\" role=\"img\"/> Details"
msgstr "<i class=\"fa fa-info-circle\" role=\"img\"/> Detalles"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid ""
"<i class=\"fa fa-warning\"/> There are lines (marked in yellow) which\n"
" prices have changed since they where received in stock."
msgstr ""
"<i class=\"fa fa-warning\"/> Hay líneas (resaltadas en amarillo) cuyos\n"
" precios han cambiado desde que se recibieron en almacén."

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__cost_update_history
msgid "Cost Update History"
msgstr "Historial de actualizaciones de coste"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid "Fix valuation"
msgstr "Corregir valoración"

#. module: purchase_stock_cost_update
#. odoo-python
#: code:addons/purchase_stock_cost_update/models/purchase_order.py:0
#, python-format
msgid "Price difference layer created from %(line)s"
msgstr "Capa de diferencia de valoración creada desde %(line)s"

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__purchase_line_id
msgid "Purchase Line"
msgstr "Línea de compra"

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de compra"

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea de pedido de compra"

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_stock_valuation_layer
msgid "Stock Valuation Layer"
msgstr "Capa de valoración de stock"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid ""
"This will make unreversible changes to the valuation layers related to the "
"affected products"
msgstr ""
"Esto realizará cambios irreversibles en las capas de valoración "
"relacionadas con los productos afectados"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.stock_valuation_layer_form
msgid "Update history"
msgstr "Historial de actualizaciones"

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_difference
msgid "Valuation Difference"
msgstr "Diferencia de valoración"

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_difference_report
msgid "Valuation Difference Report"
msgstr "Informe de diferencias de valoración"

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_differs
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_differs
msgid "Valuation Differs"
msgstr "La valoración difiere"
90 changes: 90 additions & 0 deletions purchase_stock_cost_update/i18n/purchase_stock_cost_update.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_stock_cost_update
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid "<i class=\"fa fa-info-circle\" role=\"img\"/> Details"
msgstr ""

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid ""
"<i class=\"fa fa-warning\"/> There are lines (marked in yellow) which\n"
" prices have changed since they where received in stock."
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__cost_update_history
msgid "Cost Update History"
msgstr ""

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid "Fix valuation"
msgstr ""

#. module: purchase_stock_cost_update
#. odoo-python
#: code:addons/purchase_stock_cost_update/models/purchase_order.py:0
msgid "Price difference layer created from %(line)s"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__purchase_line_id
msgid "Purchase Line"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model,name:purchase_stock_cost_update.model_stock_valuation_layer
msgid "Stock Valuation Layer"
msgstr ""

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
msgid ""
"This will make unreversible changes to the valuation layers related to the "
"affected products"
msgstr ""

#. module: purchase_stock_cost_update
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.stock_valuation_layer_form
msgid "Update history"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_difference
msgid "Valuation Difference"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_difference_report
msgid "Valuation Difference Report"
msgstr ""

#. module: purchase_stock_cost_update
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_differs
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_differs
msgid "Valuation Differs"
msgstr ""
2 changes: 2 additions & 0 deletions purchase_stock_cost_update/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import purchase_order
from . import stock_valuation_layer
Loading