Skip to content

Commit

Permalink
Merge pull request #1618 from OCA/18.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/stock-logistics-warehouse (18.0)
  • Loading branch information
bt-admin authored Feb 4, 2025
2 parents b11d811 + 051d1a6 commit ff8a1aa
Show file tree
Hide file tree
Showing 22 changed files with 875 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ addon | version | maintainers | summary
[stock_location_empty](stock_location_empty/) | 18.0.1.0.0 | | Adds a filter for empty stock location
[stock_location_zone](stock_location_zone/) | 18.0.1.0.0 | | Classify locations with zones.
[stock_packaging_calculator](stock_packaging_calculator/) | 18.0.1.0.0 | | Compute product quantity to pick by packaging
[stock_quant_cost_info](stock_quant_cost_info/) | 18.0.1.0.0 | | Shows the cost of the quants
[stock_warehouse_calendar](stock_warehouse_calendar/) | 18.0.1.0.1 | [![JordiBForgeFlow](https://github.com/JordiBForgeFlow.png?size=30px)](https://github.com/JordiBForgeFlow) | Adds a calendar to the Warehouse

[//]: # (end addons)
Expand Down
3 changes: 2 additions & 1 deletion setup/_metapackage/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[project]
name = "odoo-addons-oca-stock-logistics-warehouse"
version = "18.0.20250131.0"
version = "18.0.20250203.0"
dependencies = [
"odoo-addon-account_move_line_stock_info==18.0.*",
"odoo-addon-stock_archive_constraint==18.0.*",
"odoo-addon-stock_demand_estimate==18.0.*",
"odoo-addon-stock_location_empty==18.0.*",
"odoo-addon-stock_location_zone==18.0.*",
"odoo-addon-stock_packaging_calculator==18.0.*",
"odoo-addon-stock_quant_cost_info==18.0.*",
"odoo-addon-stock_warehouse_calendar==18.0.*",
]
classifiers=[
Expand Down
103 changes: 103 additions & 0 deletions stock_quant_cost_info/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
=====================
Stock Quant Cost Info
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7d6771825627dfd3519f09e63113a83708b7aa772a6989608c672f060b696124
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_quant_cost_info
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_quant_cost_info
: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/stock-logistics-warehouse&target_branch=18.0
:alt: Try me on Runboat

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

This module enhances the Physical Inventory functionality by introducing
a new column, Adjustment Cost, within the Quant Details list and its
corresponding PDF report. The Adjustment Cost is dynamically calculated
based on the following formula: (Real Quantity - Theoretical Quantity)
multiplied by the Product Cost.

**Table of contents**

.. contents::
:local:

Installation
============

A pre_init_hook process is initiated in order to set the *Adjustment
cost* to zero in all existing *stock quant* before installation.

Usage
=====

To use this module, you need to:

1. Go to *Inventory > Products > Products* create or select one and add
a cost.
2. Go to *Inventory > Operations Physical Inventory* you will see a new
column named *Adjustment Cost*.
3. The cost will be recomputed when we change the *Counted Quantity*.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20stock_quant_cost_info%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
-------

* Tecnativa

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

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

- Ernesto Tejeda
- Pedro M. Baeza
- Sergio Teruel
- Carlos Roca
- Juan Carlos Oñate

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.

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_quant_cost_info>`_ 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 stock_quant_cost_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import pre_init_hook
17 changes: 17 additions & 0 deletions stock_quant_cost_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Quant Cost Info",
"summary": "Shows the cost of the quants",
"version": "18.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",
"depends": ["stock"],
"data": ["views/stock_inventory_views.xml", "views/report_stockinventory.xml"],
"pre_init_hook": "pre_init_hook",
"license": "AGPL-3",
"installable": True,
"application": False,
}
18 changes: 18 additions & 0 deletions stock_quant_cost_info/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).


def pre_init_hook(env):
env.cr.execute(
"""
ALTER TABLE stock_quant
ADD COLUMN adjustment_cost numeric
DEFAULT 0;
"""
)
env.cr.execute(
"""
ALTER TABLE stock_quant
ALTER COLUMN adjustment_cost DROP DEFAULT;
"""
)
54 changes: 54 additions & 0 deletions stock_quant_cost_info/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_inventory_cost_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-16 09:20+0000\n"
"PO-Revision-Date: 2023-01-16 10:21+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: \n"
"X-Generator: Poedit 3.2.2\n"

#. module: stock_quant_cost_info
#: model:ir.model.fields,help:stock_quant_cost_info.field_stock_quant__adjustment_cost
msgid "(Real Quantity - Theoretical Quantity) multiplied by the Product Cost"
msgstr ""

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__adjustment_cost
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.report_inventory_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Adjustment Cost"
msgstr ""

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__currency_id
msgid "Currency"
msgstr "Moneda"

#. module: stock_quant_cost_info
#: model:ir.model,name:stock_quant_cost_info.model_stock_quant
msgid "Quants"
msgstr "Quants"

#. module: stock_quant_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Total"
msgstr "Total"

#~ msgid "<strong>Adjustment cost</strong>"
#~ msgstr "<strong>Coste de ajuste</strong>"

#~ msgid "Adjustment cost"
#~ msgstr "Coste de ajuste"

#~ msgid "Inventory Line"
#~ msgstr "Línea de inventario"
50 changes: 50 additions & 0 deletions stock_quant_cost_info/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_quant_cost_info
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-02-03 22:06+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: stock_quant_cost_info
#: model:ir.model.fields,help:stock_quant_cost_info.field_stock_quant__adjustment_cost
msgid "(Real Quantity - Theoretical Quantity) multiplied by the Product Cost"
msgstr "(Quantità reale - quantità teorica) moltiplicata per il costo prodotto"

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__adjustment_cost
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.report_inventory_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Adjustment Cost"
msgstr "Correttivo costo"

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__currency_id
msgid "Currency"
msgstr "Valuta"

#. module: stock_quant_cost_info
#: model:ir.model,name:stock_quant_cost_info.model_stock_quant
msgid "Quants"
msgstr "Quanti"

#. module: stock_quant_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Total"
msgstr "Totale"

#~ msgid "<strong>Adjustment cost</strong>"
#~ msgstr "<strong>Correttivo costo</strong>"

#~ msgid "Adjustment cost"
#~ msgstr "Correttivo costo"
41 changes: 41 additions & 0 deletions stock_quant_cost_info/i18n/stock_quant_cost_info.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_quant_cost_info
#
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: stock_quant_cost_info
#: model:ir.model.fields,help:stock_quant_cost_info.field_stock_quant__adjustment_cost
msgid "(Real Quantity - Theoretical Quantity) multiplied by the Product Cost"
msgstr ""

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__adjustment_cost
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.report_inventory_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Adjustment Cost"
msgstr ""

#. module: stock_quant_cost_info
#: model:ir.model.fields,field_description:stock_quant_cost_info.field_stock_quant__currency_id
msgid "Currency"
msgstr ""

#. module: stock_quant_cost_info
#: model:ir.model,name:stock_quant_cost_info.model_stock_quant
msgid "Quants"
msgstr ""

#. module: stock_quant_cost_info
#: model_terms:ir.ui.view,arch_db:stock_quant_cost_info.view_stock_quant_tree_inventory_editable
msgid "Total"
msgstr ""
3 changes: 3 additions & 0 deletions stock_quant_cost_info/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import stock_quant
26 changes: 26 additions & 0 deletions stock_quant_cost_info/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class StockQuant(models.Model):
_inherit = "stock.quant"

currency_id = fields.Many2one(
comodel_name="res.currency", string="Currency", related="company_id.currency_id"
)
adjustment_cost = fields.Monetary(
help="(Real Quantity - Theoretical Quantity) multiplied by the Product Cost",
compute="_compute_adjustment_cost",
store=True,
)

@api.depends("inventory_diff_quantity", "product_id.standard_price")
def _compute_adjustment_cost(self):
for record in self:
record.adjustment_cost = False
if record.inventory_diff_quantity:
record.adjustment_cost = (
record.inventory_diff_quantity * record.product_id.standard_price
)
3 changes: 3 additions & 0 deletions stock_quant_cost_info/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions stock_quant_cost_info/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [Tecnativa](https://www.tecnativa.com):
- Ernesto Tejeda
- Pedro M. Baeza
- Sergio Teruel
- Carlos Roca
- Juan Carlos Oñate
1 change: 1 addition & 0 deletions stock_quant_cost_info/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module enhances the Physical Inventory functionality by introducing a new column, Adjustment Cost, within the Quant Details list and its corresponding PDF report. The Adjustment Cost is dynamically calculated based on the following formula: (Real Quantity - Theoretical Quantity) multiplied by the Product Cost.
2 changes: 2 additions & 0 deletions stock_quant_cost_info/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A pre_init_hook process is initiated in order to set the *Adjustment
cost* to zero in all existing *stock quant* before installation.
5 changes: 5 additions & 0 deletions stock_quant_cost_info/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

1. Go to *Inventory \> Products \> Products* create or select one and add a cost.
2. Go to *Inventory \> Operations Physical Inventory* you will see a new column named *Adjustment Cost*.
3. The cost will be recomputed when we change the *Counted Quantity*.
Binary file added stock_quant_cost_info/static/description/icon.png
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 ff8a1aa

Please sign in to comment.