Skip to content

Commit 0c3da20

Browse files
authored
Merge pull request #2033 from OCA/16.0
Syncing from upstream OCA/purchase-workflow (16.0)
2 parents a9ba314 + 0e33ee2 commit 0c3da20

25 files changed

+1690
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ addon | version | maintainers | summary
110110
[purchase_security](purchase_security/) | 16.0.2.0.2 | <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
111111
[purchase_sign](purchase_sign/) | 16.0.1.0.0 | | Purchase Sign
112112
[purchase_split_by_route](purchase_split_by_route/) | 16.0.1.0.0 | <a href='https://github.com/mathieudelva'><img src='https://github.com/mathieudelva.png' width='32' height='32' style='border-radius:50%;' alt='mathieudelva'/></a> | Purchase Split Route
113+
[purchase_stock_cost_update](purchase_stock_cost_update/) | 16.0.1.0.1 | <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
113114
[purchase_stock_packaging](purchase_stock_packaging/) | 16.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
114115
[purchase_stock_picking_actual_date_show_currency_rate](purchase_stock_picking_actual_date_show_currency_rate/) | 16.0.1.0.0 | | Purchase Stock Picking Actual Date Show Currency Rate
115116
[purchase_stock_picking_show_currency_rate](purchase_stock_picking_show_currency_rate/) | 16.0.1.0.0 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | Show currency rate in purchase stock picking.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
5+
==========================
6+
Update costs from purchase
7+
==========================
8+
9+
..
10+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11+
!! This file is generated by oca-gen-addon-readme !!
12+
!! changes will be overwritten. !!
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
!! source digest: sha256:8857022463cda546792e3e86ae5308778764bd224adb15ef09810d274d0edbb3
15+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16+
17+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
18+
:target: https://odoo-community.org/page/development-status
19+
:alt: Beta
20+
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
21+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
22+
:alt: License: LGPL-3
23+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
24+
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_stock_cost_update
25+
:alt: OCA/purchase-workflow
26+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27+
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_stock_cost_update
28+
:alt: Translate me on Weblate
29+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
31+
:alt: Try me on Runboat
32+
33+
|badge1| |badge2| |badge3| |badge4| |badge5|
34+
35+
This module allows to adjust the valuation of the incoming goods related
36+
to their purchase order from the purchase line itself.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Use Cases / Context
44+
===================
45+
46+
When a purchase order is confirmed, the value of the received goods is
47+
updated upon reception. It can happen anyway that the reception of the
48+
goods is confirmed before the final price is recorded in the
49+
corresponding purchase line.
50+
51+
For that, Odoo will fix the valuation when the invoice for that purchase
52+
is confirmed, but that moment could be delayed for an uncertain period
53+
of time while thos stored goods are being selled with wrong margins and
54+
the value being discounted for a wrong price unit.
55+
56+
We want to fix those disalignments as soon as possible from the purchase
57+
order while keeping the native mechanism to add later corrections from
58+
the invoice itself.
59+
60+
Configuration
61+
=============
62+
63+
In order to use this module, you need to have some storable products
64+
valued on average cost (AVCO).
65+
66+
To do so:
67+
68+
- Go to *Inventory > Configuration > Product Categories* and select one.
69+
- In the **Inventory valuation** section, select the **Costing method**
70+
as **Average Cost (AVCO)**.
71+
- Now all the products in that category will have that valuation rules.
72+
73+
Usage
74+
=====
75+
76+
In order to test the module:
77+
78+
- Go to *Purchase > Orders* and create a new quotation.
79+
- Add a product with AVCO valuation and set a price.
80+
- Validate the purchase order.
81+
- Receive the products.
82+
- The products are now valued at the price you set in the order line.
83+
- You can check it in *Inventory > Reporting > Valuation* (debug mode
84+
needed).
85+
- Now change the price in the order line.
86+
- You'll see that the line has changed its color to yellow and a new
87+
button *Fix valuation* shows up in the header.
88+
- When you click that button, every disaligned valuation will be fixed.
89+
If you go to the *Valuation* report you'll see the adjustment layer.
90+
- After this, when you invoice the purchase you won't be able to edit
91+
the price anymore.
92+
- You can anyway add an additional valuation when you post the new
93+
invoice prices.
94+
95+
Known issues / Roadmap
96+
======================
97+
98+
- Only AVCO is supported
99+
100+
Bug Tracker
101+
===========
102+
103+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
104+
In case of trouble, please check there if your issue has already been reported.
105+
If you spotted it first, help us to smash it by providing a detailed and welcomed
106+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_stock_cost_update%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
107+
108+
Do not contact contributors directly about support or help with technical issues.
109+
110+
Credits
111+
=======
112+
113+
Authors
114+
-------
115+
116+
* Moduon
117+
118+
Contributors
119+
------------
120+
121+
- David Vidal (`Moduon <https://www.moduon.team/>`__)
122+
123+
Maintainers
124+
-----------
125+
126+
This module is maintained by the OCA.
127+
128+
.. image:: https://odoo-community.org/logo.png
129+
:alt: Odoo Community Association
130+
:target: https://odoo-community.org
131+
132+
OCA, or the Odoo Community Association, is a nonprofit organization whose
133+
mission is to support the collaborative development of Odoo features and
134+
promote its widespread use.
135+
136+
.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
137+
:target: https://github.com/chienandalu
138+
:alt: chienandalu
139+
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
140+
:target: https://github.com/rafaelbn
141+
:alt: rafaelbn
142+
143+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
144+
145+
|maintainer-chienandalu| |maintainer-rafaelbn|
146+
147+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_stock_cost_update>`_ project on GitHub.
148+
149+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 Moduon Team S.L.
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0.html).
3+
{
4+
"name": "Update costs from purchase",
5+
"summary": "Allows to update valuation layers once the purchase is received",
6+
"version": "16.0.1.0.1",
7+
"category": "Purchase Management",
8+
"author": "Moduon, Odoo Community Association (OCA)",
9+
"maintainers": ["chienandalu", "rafaelbn"],
10+
"website": "https://github.com/OCA/purchase-workflow",
11+
"license": "LGPL-3",
12+
"depends": ["purchase_stock"],
13+
"data": [
14+
"views/purchase_order_form_views.xml",
15+
"views/stock_valuation_layer_views.xml",
16+
],
17+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * purchase_stock_cost_update
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0+e\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-10-28 14:47+0000\n"
10+
"PO-Revision-Date: 2025-10-28 15:50+0100\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: es\n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: 8bit\n"
17+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
18+
"X-Generator: Poedit 3.5\n"
19+
20+
#. module: purchase_stock_cost_update
21+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
22+
msgid "<i class=\"fa fa-info-circle\" role=\"img\"/> Details"
23+
msgstr "<i class=\"fa fa-info-circle\" role=\"img\"/> Detalles"
24+
25+
#. module: purchase_stock_cost_update
26+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
27+
msgid ""
28+
"<i class=\"fa fa-warning\"/> There are lines (marked in yellow) which\n"
29+
" prices have changed since they where received in stock."
30+
msgstr ""
31+
"<i class=\"fa fa-warning\"/> Hay líneas (resaltadas en amarillo) cuyos\n"
32+
" precios han cambiado desde que se recibieron en almacén."
33+
34+
#. module: purchase_stock_cost_update
35+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__cost_update_history
36+
msgid "Cost Update History"
37+
msgstr "Historial de actualizaciones de coste"
38+
39+
#. module: purchase_stock_cost_update
40+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
41+
msgid "Fix valuation"
42+
msgstr "Corregir valoración"
43+
44+
#. module: purchase_stock_cost_update
45+
#. odoo-python
46+
#: code:addons/purchase_stock_cost_update/models/purchase_order.py:0
47+
#, python-format
48+
msgid "Price difference layer created from %(line)s"
49+
msgstr "Capa de diferencia de valoración creada desde %(line)s"
50+
51+
#. module: purchase_stock_cost_update
52+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__purchase_line_id
53+
msgid "Purchase Line"
54+
msgstr "Línea de compra"
55+
56+
#. module: purchase_stock_cost_update
57+
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order
58+
msgid "Purchase Order"
59+
msgstr "Pedido de compra"
60+
61+
#. module: purchase_stock_cost_update
62+
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order_line
63+
msgid "Purchase Order Line"
64+
msgstr "Línea de pedido de compra"
65+
66+
#. module: purchase_stock_cost_update
67+
#: model:ir.model,name:purchase_stock_cost_update.model_stock_valuation_layer
68+
msgid "Stock Valuation Layer"
69+
msgstr "Capa de valoración de stock"
70+
71+
#. module: purchase_stock_cost_update
72+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
73+
msgid ""
74+
"This will make unreversible changes to the valuation layers related to the "
75+
"affected products"
76+
msgstr ""
77+
"Esto realizará cambios irreversibles en las capas de valoración "
78+
"relacionadas con los productos afectados"
79+
80+
#. module: purchase_stock_cost_update
81+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.stock_valuation_layer_form
82+
msgid "Update history"
83+
msgstr "Historial de actualizaciones"
84+
85+
#. module: purchase_stock_cost_update
86+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_difference
87+
msgid "Valuation Difference"
88+
msgstr "Diferencia de valoración"
89+
90+
#. module: purchase_stock_cost_update
91+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_difference_report
92+
msgid "Valuation Difference Report"
93+
msgstr "Informe de diferencias de valoración"
94+
95+
#. module: purchase_stock_cost_update
96+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_differs
97+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_differs
98+
msgid "Valuation Differs"
99+
msgstr "La valoración difiere"
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * purchase_stock_cost_update
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: purchase_stock_cost_update
17+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
18+
msgid "<i class=\"fa fa-info-circle\" role=\"img\"/> Details"
19+
msgstr ""
20+
21+
#. module: purchase_stock_cost_update
22+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
23+
msgid ""
24+
"<i class=\"fa fa-warning\"/> There are lines (marked in yellow) which\n"
25+
" prices have changed since they where received in stock."
26+
msgstr ""
27+
28+
#. module: purchase_stock_cost_update
29+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__cost_update_history
30+
msgid "Cost Update History"
31+
msgstr ""
32+
33+
#. module: purchase_stock_cost_update
34+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
35+
msgid "Fix valuation"
36+
msgstr ""
37+
38+
#. module: purchase_stock_cost_update
39+
#. odoo-python
40+
#: code:addons/purchase_stock_cost_update/models/purchase_order.py:0
41+
#, python-format
42+
msgid "Price difference layer created from %(line)s"
43+
msgstr ""
44+
45+
#. module: purchase_stock_cost_update
46+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_stock_valuation_layer__purchase_line_id
47+
msgid "Purchase Line"
48+
msgstr ""
49+
50+
#. module: purchase_stock_cost_update
51+
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order
52+
msgid "Purchase Order"
53+
msgstr ""
54+
55+
#. module: purchase_stock_cost_update
56+
#: model:ir.model,name:purchase_stock_cost_update.model_purchase_order_line
57+
msgid "Purchase Order Line"
58+
msgstr ""
59+
60+
#. module: purchase_stock_cost_update
61+
#: model:ir.model,name:purchase_stock_cost_update.model_stock_valuation_layer
62+
msgid "Stock Valuation Layer"
63+
msgstr ""
64+
65+
#. module: purchase_stock_cost_update
66+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.purchase_order_form
67+
msgid ""
68+
"This will make unreversible changes to the valuation layers related to the "
69+
"affected products"
70+
msgstr ""
71+
72+
#. module: purchase_stock_cost_update
73+
#: model_terms:ir.ui.view,arch_db:purchase_stock_cost_update.stock_valuation_layer_form
74+
msgid "Update history"
75+
msgstr ""
76+
77+
#. module: purchase_stock_cost_update
78+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_difference
79+
msgid "Valuation Difference"
80+
msgstr ""
81+
82+
#. module: purchase_stock_cost_update
83+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_difference_report
84+
msgid "Valuation Difference Report"
85+
msgstr ""
86+
87+
#. module: purchase_stock_cost_update
88+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order__valuation_differs
89+
#: model:ir.model.fields,field_description:purchase_stock_cost_update.field_purchase_order_line__valuation_differs
90+
msgid "Valuation Differs"
91+
msgstr ""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import purchase_order
2+
from . import stock_valuation_layer

0 commit comments

Comments
 (0)