Skip to content
Closed
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
90 changes: 90 additions & 0 deletions stock_valuation_layer_total_value/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
=================================
Stock Valuation Layer Total Value
=================================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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_valuation_layer_total_value
: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_valuation_layer_total_value
: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 shows the value of the original valuation layer after doing
a landed cost.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module you need to:

1.- Generate a stock valuation layer (ex: create a purchase of the
product) 2.- Generate another valuation layer that is linked to the
first one (This can be done using landed cost) 3.- Now you have on the
original valuation the original cost and the updated cost (the one
generated on the second valuation)

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_valuation_layer_total_value%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
-------

* Forgeflow

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

- Jordi Ballester <jordi.ballester@forgeflow.com>
- Juany Davila <juany.davila@forgeflow.com>
- Do Anh Duy <duyda@trobz.com>

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_valuation_layer_total_value>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions stock_valuation_layer_total_value/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
18 changes: 18 additions & 0 deletions stock_valuation_layer_total_value/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2022 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Valuation Layer Total Value",
"summary": "Show total value on tree and form view",
"version": "18.0.1.0.0",
"development_status": "Production/Stable",
"category": "stock",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Forgeflow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["stock_account"],
"data": [
"views/stock_valuation_layer.xml",
],
}
48 changes: 48 additions & 0 deletions stock_valuation_layer_total_value/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_valuation_layer_total_value
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-24 13:40+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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 4.17\n"

#. module: stock_valuation_layer_total_value
#: model_terms:ir.ui.view,arch_db:stock_valuation_layer_total_value.stock_valuation_layer_form
msgid "Child Layers"
msgstr "Livelli figli"

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,field_description:stock_valuation_layer_total_value.field_stock_valuation_layer__unit_price_with_extra_cost
msgid "New unit price (with additional costs)"
msgstr "Prezzo unitario nuovo (con costi addizionali)"

#. module: stock_valuation_layer_total_value
#: model:ir.model,name:stock_valuation_layer_total_value.model_stock_valuation_layer
msgid "Stock Valuation Layer"
msgstr "Livello valutazione magazzino"

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,help:stock_valuation_layer_total_value.field_stock_valuation_layer__total_value_with_additional_costs
msgid ""
"This is the sum of the total value's layer and total value of child layers"
msgstr "Questa è la somma del totale del valore del livello e dei suoi figli"

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,help:stock_valuation_layer_total_value.field_stock_valuation_layer__unit_price_with_extra_cost
msgid "This is the unit cost after the additional costs are added"
msgstr "Questo è il costo unitario dopo l'aggiunta dei costi addizionali"

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,field_description:stock_valuation_layer_total_value.field_stock_valuation_layer__total_value_with_additional_costs
msgid "Total value (with additional costs)"
msgstr "Valore totale (con costi addizionali)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_valuation_layer_total_value
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_valuation_layer_total_value
#: model_terms:ir.ui.view,arch_db:stock_valuation_layer_total_value.stock_valuation_layer_form
msgid "Child Layers"
msgstr ""

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,field_description:stock_valuation_layer_total_value.field_stock_valuation_layer__unit_price_with_extra_cost
msgid "New unit price (with additional costs)"
msgstr ""

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

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,help:stock_valuation_layer_total_value.field_stock_valuation_layer__total_value_with_additional_costs
msgid ""
"This is the sum of the total value's layer and total value of child layers"
msgstr ""

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,help:stock_valuation_layer_total_value.field_stock_valuation_layer__unit_price_with_extra_cost
msgid "This is the unit cost after the additional costs are added"
msgstr ""

#. module: stock_valuation_layer_total_value
#: model:ir.model.fields,field_description:stock_valuation_layer_total_value.field_stock_valuation_layer__total_value_with_additional_costs
msgid "Total value (with additional costs)"
msgstr ""
2 changes: 2 additions & 0 deletions stock_valuation_layer_total_value/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import stock_valuation_layer
31 changes: 31 additions & 0 deletions stock_valuation_layer_total_value/models/stock_valuation_layer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2022 ForgeFlow
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models


class StockValuationLayer(models.Model):
_inherit = "stock.valuation.layer"

total_value_with_additional_costs = fields.Float(
string="Total value (with additional costs)",
compute="_compute_original_layer_values",
help="This is the sum of the total value's layer and total value of child layers", # noqa: E501
store=True,
)
unit_price_with_extra_cost = fields.Float(
string="New unit price (with additional costs)",
compute="_compute_original_layer_values",
help="This is the unit cost after the additional costs are added",
store=True,
)

@api.depends("stock_valuation_layer_ids")
def _compute_original_layer_values(self):
for rec in self:
children = rec.stock_valuation_layer_ids
children_value = sum(children.mapped("value")) if children else 0.0
total_value = rec.value + children_value
rec.total_value_with_additional_costs = total_value
rec.unit_price_with_extra_cost = (
total_value / rec.quantity if rec.quantity else rec.unit_cost
)
3 changes: 3 additions & 0 deletions stock_valuation_layer_total_value/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions stock_valuation_layer_total_value/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Jordi Ballester \<<jordi.ballester@forgeflow.com>\>
- Juany Davila \<<juany.davila@forgeflow.com>\>
- Do Anh Duy \<<duyda@trobz.com>\>
2 changes: 2 additions & 0 deletions stock_valuation_layer_total_value/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module shows the value of the original valuation layer after doing
a landed cost.
7 changes: 7 additions & 0 deletions stock_valuation_layer_total_value/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To use this module you need to:

1.- Generate a stock valuation layer (ex: create a purchase of the
product) 2.- Generate another valuation layer that is linked to the
first one (This can be done using landed cost) 3.- Now you have on the
original valuation the original cost and the updated cost (the one
generated on the second valuation)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading