diff --git a/stock_account_product_run_fifo_hook/README.rst b/stock_account_product_run_fifo_hook/README.rst new file mode 100644 index 000000000000..e185738b2fb0 --- /dev/null +++ b/stock_account_product_run_fifo_hook/README.rst @@ -0,0 +1,88 @@ +=================================== +Stock Account Product Run FIFO Hook +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:16ff2bf6dff55b6e2490baba84bf78dccb176514585090dd54df0f46c5f7ddcb + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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%2Fstock--logistics--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_account_product_run_fifo_hook + :alt: OCA/stock-logistics-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_account_product_run_fifo_hook + :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-workflow&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds hook points in product_product._run_fifo in order to +add more flexibility in the information that is stored in the fifo +candidates. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. Add dependency of this module +2. Inherit from 'product.product' +3. Change the \_run_fifo_prepare_candidate_update function in order to + return an updated logic. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ForgeFlow + +Contributors +------------ + +- Forgeflow (https://www.forgeflow.com) + + - Jordi Ballester Alomar + +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-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_account_product_run_fifo_hook/__init__.py b/stock_account_product_run_fifo_hook/__init__.py new file mode 100644 index 000000000000..aaaf068deabb --- /dev/null +++ b/stock_account_product_run_fifo_hook/__init__.py @@ -0,0 +1,3 @@ +from . import model + +from .hooks import post_load_hook diff --git a/stock_account_product_run_fifo_hook/__manifest__.py b/stock_account_product_run_fifo_hook/__manifest__.py new file mode 100644 index 000000000000..d2e460e5b54d --- /dev/null +++ b/stock_account_product_run_fifo_hook/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2020 ForgeFlow, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "Stock Account Product Run FIFO Hook", + "summary": "Add more flexibility in the run fifo method.", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "version": "18.0.1.0.1", + "category": "Warehouse Management", + "website": "https://github.com/OCA/stock-logistics-workflow", + "license": "LGPL-3", + "depends": ["stock_account"], + "installable": True, + "post_load": "post_load_hook", +} diff --git a/stock_account_product_run_fifo_hook/hooks.py b/stock_account_product_run_fifo_hook/hooks.py new file mode 100644 index 000000000000..0e125573cfc4 --- /dev/null +++ b/stock_account_product_run_fifo_hook/hooks.py @@ -0,0 +1,385 @@ +# Copyright 2020 ForgeFlow, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from collections import defaultdict +from datetime import datetime + +from odoo import _ +from odoo.tools import float_compare, float_is_zero + +from odoo.addons.stock_account.models.product import ProductProduct +from odoo.addons.stock_account.models.stock_move import StockMove + + +# flake8: noqa: C901 +def post_load_hook(): + def _run_fifo_new(self, quantity, company, lot=False): + if not hasattr(self, "_run_fifo_prepare_candidate_update"): + return self._run_fifo_original(quantity, company, lot) + + # Find back incoming stock valuation layers + # (called candidates here) to value `quantity`. + qty_to_take_on_candidates = quantity + candidates = self._get_fifo_candidates(company, lot=lot) + new_standard_price = 0 + tmp_value = 0 # to accumulate the value taken on the candidates + taken_data = {} + for candidate in candidates: + qty_taken_on_candidate = self._get_qty_taken_on_candidate( + qty_to_take_on_candidates, candidate + ) + taken_data[candidate.id] = {"quantity": qty_taken_on_candidate} + candidate_unit_cost = candidate.remaining_value / candidate.remaining_qty + new_standard_price = candidate_unit_cost + value_taken_on_candidate = qty_taken_on_candidate * candidate_unit_cost + value_taken_on_candidate = candidate.currency_id.round( + value_taken_on_candidate + ) + taken_data[candidate.id].update( + { + "value": value_taken_on_candidate, + } + ) + new_remaining_value = candidate.remaining_value - value_taken_on_candidate + + candidate_vals = { + "remaining_qty": candidate.remaining_qty - qty_taken_on_candidate, + "remaining_value": new_remaining_value, + } + # Start Hook Prepare Candidate + candidate_vals = self._run_fifo_prepare_candidate_update( + candidate, + qty_taken_on_candidate, + value_taken_on_candidate, + candidate_vals, + ) + # End Hook Prepare Candidate + candidate.write(candidate_vals) + + qty_to_take_on_candidates -= qty_taken_on_candidate + tmp_value += value_taken_on_candidate + + if float_is_zero( + qty_to_take_on_candidates, precision_rounding=self.uom_id.rounding + ): + if float_is_zero( + candidate.remaining_qty, precision_rounding=self.uom_id.rounding + ): + next_candidates = candidates.filtered( + lambda svl: svl.remaining_qty > 0 + ) + new_standard_price = ( + next_candidates + and next_candidates[0].unit_cost + or new_standard_price + ) + break + + # Fifo out will change the AVCO value of the product. So in case of out, + # we recompute it base on the remaining value and quantities. + # START HOOK update standard price + if self.cost_method == "fifo" or ( + hasattr(self, "_price_updateable") + and self._price_updateable(new_standard_price) + ): + # END HOOK update standard price + quantity_svl = sum(candidates.mapped("remaining_qty")) + value_svl = sum(candidates.mapped("remaining_value")) + product = ( + self.sudo().with_company(company.id).with_context(disable_auto_svl=True) + ) + if ( + float_compare( + quantity_svl, 0.0, precision_rounding=self.uom_id.rounding + ) + > 0 + ): + product.standard_price = value_svl / quantity_svl + elif candidates and not float_is_zero( + qty_to_take_on_candidates, precision_rounding=self.uom_id.rounding + ): + product.standard_price = new_standard_price + # END HOOK update standard price + # If there's still quantity to value but we're out of candidates, + # we fall in the + # negative stock use case. We chose to value the out move at the price + # of the + # last out and a correction entry will be made once `_fifo_vacuum` + # is called. + vals = {} + if float_is_zero( + qty_to_take_on_candidates, precision_rounding=self.uom_id.rounding + ): + vals = { + "value": -tmp_value, + "unit_cost": tmp_value / quantity, + "taken_data": taken_data, + } + else: + assert qty_to_take_on_candidates > 0 + last_fifo_price = new_standard_price or self.standard_price + negative_stock_value = last_fifo_price * -qty_to_take_on_candidates + tmp_value += abs(negative_stock_value) + vals = { + "remaining_qty": -qty_to_take_on_candidates, + "value": -tmp_value, + "unit_cost": last_fifo_price, + } + return vals + + if not hasattr(ProductProduct, "_run_fifo_original"): + ProductProduct._run_fifo_original = ProductProduct._run_fifo + ProductProduct._run_fifo = _run_fifo_new + + def _run_fifo_vacuum_new(self, company=None): + if not hasattr(self, "_run_fifo_prepare_candidate_update"): + return self._run_fifo_vacuum_original(company=company) + if company is None: + company = self.env.company + ValuationLayer = self.env["stock.valuation.layer"].sudo() + svls_to_vacuum_by_product = defaultdict(lambda: ValuationLayer) + res = ValuationLayer._read_group( + [ + ("product_id", "in", self.ids), + ("remaining_qty", "<", 0), + ("stock_move_id", "!=", False), + ("company_id", "=", company.id), + ], + ["product_id"], + ["id:recordset", "create_date:min"], + order="create_date:min", + ) + min_create_date = datetime.max + if not res: + return + for group in res: + svls_to_vacuum_by_product[group[0].id] = group[1].sorted( + key=lambda r: (r.create_date, r.id) + ) + min_create_date = min(min_create_date, group[2]) + all_candidates_by_product = defaultdict(lambda: ValuationLayer) + lot_to_update = [] + domain = [ + ("product_id", "in", self.ids), + ("remaining_qty", ">", 0), + ("company_id", "=", company.id), + ("create_date", ">=", min_create_date), + ] + if self.env.context.get("use_past_svl", False): + domain = domain[:3] + res = ValuationLayer._read_group( + domain, + ["product_id"], + ["id:recordset"], + ) + for group in res: + all_candidates_by_product[group[0].id] = group[1] + + new_svl_vals_real_time = [] + new_svl_vals_manual = [] + real_time_svls_to_vacuum = ValuationLayer + + for product in self: + all_candidates = all_candidates_by_product[product.id] + current_real_time_svls = ValuationLayer + for svl_to_vacuum in svls_to_vacuum_by_product[product.id]: + # We don't use search to avoid executing + # _flush_search and to decrease interaction with DB + candidates = all_candidates.filtered( + lambda r, svl_to_vacuum=svl_to_vacuum: r.create_date + > svl_to_vacuum.create_date + or r.create_date == svl_to_vacuum.create_date + and r.id > svl_to_vacuum.id + ) + if product.lot_valuated: + candidates = candidates.filtered( + lambda r, svl_to_vacuum=svl_to_vacuum: r.lot_id + == svl_to_vacuum.lot_id + ) + if self.env.context.get("use_past_svl", False): + candidates = all_candidates + if not candidates: + break + qty_to_take_on_candidates = abs(svl_to_vacuum.remaining_qty) + qty_taken_on_candidates = 0 + tmp_value = 0 + taken_data = {} + for candidate in candidates: + qty_taken_on_candidate = min( + candidate.remaining_qty, qty_to_take_on_candidates + ) + qty_taken_on_candidates += qty_taken_on_candidate + + taken_data[candidate.id] = {"quantity": qty_taken_on_candidate} + + candidate_unit_cost = ( + candidate.remaining_value / candidate.remaining_qty + ) + value_taken_on_candidate = ( + qty_taken_on_candidate * candidate_unit_cost + ) + value_taken_on_candidate = candidate.currency_id.round( + value_taken_on_candidate + ) + + taken_data[candidate.id].update( + { + "value": value_taken_on_candidate, + } + ) + + new_remaining_value = ( + candidate.remaining_value - value_taken_on_candidate + ) + + candidate_vals = { + "remaining_qty": candidate.remaining_qty + - qty_taken_on_candidate, + "remaining_value": new_remaining_value, + } + # Start Hook + candidate_vals = self._run_fifo_vacuum_prepare_candidate_update( + svl_to_vacuum, + candidate, + qty_taken_on_candidate, + value_taken_on_candidate, + candidate_vals, + ) + # End Hook + candidate.write(candidate_vals) + if not (candidate.remaining_qty > 0): + all_candidates -= candidate + + qty_to_take_on_candidates -= qty_taken_on_candidate + tmp_value += value_taken_on_candidate + if float_is_zero( + qty_to_take_on_candidates, + precision_rounding=product.uom_id.rounding, + ): + break + + # Get the estimated value we will correct. + remaining_value_before_vacuum = ( + svl_to_vacuum.unit_cost * qty_taken_on_candidates + ) + new_remaining_qty = ( + svl_to_vacuum.remaining_qty + qty_taken_on_candidates + ) + corrected_value = remaining_value_before_vacuum - tmp_value + svl_to_vacuum.with_context(taken_data=taken_data).write( + { + "remaining_qty": new_remaining_qty, + } + ) + + # Don't create a layer or an accounting entry + # if the corrected value is zero. + if svl_to_vacuum.currency_id.is_zero(corrected_value): + continue + + corrected_value = svl_to_vacuum.currency_id.round(corrected_value) + + move = svl_to_vacuum.stock_move_id + new_svl_vals = ( + new_svl_vals_real_time + if product.valuation == "real_time" + else new_svl_vals_manual + ) + new_svl_vals.append( + { + "product_id": product.id, + "value": corrected_value, + "unit_cost": 0, + "quantity": 0, + "remaining_qty": 0, + "stock_move_id": move.id, + "company_id": move.company_id.id, + "description": "Revaluation of %s (negative inventory)" + % (move.picking_id.name or move.name), + "stock_valuation_layer_id": svl_to_vacuum.id, + "lot_id": svl_to_vacuum.lot_id.id, + } + ) + lot_to_update.append(svl_to_vacuum.lot_id) + if product.valuation == "real_time": + current_real_time_svls |= svl_to_vacuum + real_time_svls_to_vacuum |= current_real_time_svls + ValuationLayer.create(new_svl_vals_manual) + vacuum_svls = ValuationLayer.create(new_svl_vals_real_time) + + # If some negative stock were fixed, we need to recompute the standard price. + for product in self: + product = product.with_company(company.id) + if not svls_to_vacuum_by_product[product.id]: + continue + if product.cost_method not in ["average", "fifo"] or float_is_zero( + product.quantity_svl, precision_rounding=product.uom_id.rounding + ): + continue + if product.lot_valuated: + for lot in lot_to_update: + if float_is_zero( + lot.quantity_svl, precision_rounding=product.uom_id.rounding + ): + continue + lot.sudo().with_context(disable_auto_svl=True).write( + {"standard_price": lot.value_svl / lot.quantity_svl} + ) + product.sudo().with_context(disable_auto_svl=True).write( + {"standard_price": product.value_svl / product.quantity_svl} + ) + + vacuum_svls._validate_accounting_entries() + self._create_fifo_vacuum_anglo_saxon_expense_entries( + zip(vacuum_svls, real_time_svls_to_vacuum, strict=False) + ) + + if not hasattr(ProductProduct, "_run_fifo_vacuum_original"): + ProductProduct._run_fifo_vacuum_original = ProductProduct._run_fifo_vacuum + ProductProduct._run_fifo_vacuum = _run_fifo_vacuum_new + + def _get_out_svl_vals_new(self, forced_quantity): + svl_vals_list = [] + for move in self: + move = move.with_company(move.company_id) + lines = move._get_out_move_lines() + quantities = defaultdict(float) + if forced_quantity: + quantities[forced_quantity[0]] += forced_quantity[1] + else: + for line in lines: + quantities[line.lot_id] += line.product_uom_id._compute_quantity( + line.quantity, move.product_id.uom_id + ) + if float_is_zero( + sum(quantities.values()), + precision_rounding=move.product_id.uom_id.rounding, + ): + continue + + if move.product_id.lot_valuated: + vals = [] + for lot_id, qty in quantities.items(): + out_vals = move.product_id.with_context( + move_requestor=move.id + )._prepare_out_svl_vals(qty, move.company_id, lot=lot_id) + vals.append(out_vals) + else: + vals = [ + move.product_id.with_context( + move_requestor=move.id + )._prepare_out_svl_vals(sum(quantities.values()), move.company_id) + ] + for val in vals: + val.update(move._prepare_common_svl_vals()) + if forced_quantity: + val["description"] = _( + "Correction of %s (modification of past move)", + move.picking_id.name or move.name, + ) + val["description"] += val.pop("rounding_adjustment", "") + svl_vals_list += vals + return svl_vals_list + + if not hasattr(StockMove, "_get_out_svl_vals_original"): + StockMove._get_out_svl_vals_original = StockMove._get_out_svl_vals + StockMove._get_out_svl_vals = _get_out_svl_vals_new diff --git a/stock_account_product_run_fifo_hook/i18n/es.po b/stock_account_product_run_fifo_hook/i18n/es.po new file mode 100644 index 000000000000..298f99263197 --- /dev/null +++ b/stock_account_product_run_fifo_hook/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_account_product_run_fifo_hook +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-30 13:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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_account_product_run_fifo_hook +#. odoo-python +#: code:addons/stock_account_product_run_fifo_hook/hooks.py:0 +#, python-format +msgid "Correction of %s (modification of past move)" +msgstr "Corrección de %s (modificación del movimiento anterior)" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_product_product +msgid "Product Variant" +msgstr "Variante del Producto" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "" diff --git a/stock_account_product_run_fifo_hook/i18n/it.po b/stock_account_product_run_fifo_hook/i18n/it.po new file mode 100644 index 000000000000..54890966c19a --- /dev/null +++ b/stock_account_product_run_fifo_hook/i18n/it.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_account_product_run_fifo_hook +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-11-19 12:06+0000\n" +"Last-Translator: mymage \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_account_product_run_fifo_hook +#. odoo-python +#: code:addons/stock_account_product_run_fifo_hook/hooks.py:0 +#, python-format +msgid "Correction of %s (modification of past move)" +msgstr "Correzione di %s (modificha dei vecchi movimenti)" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_product_product +msgid "Product Variant" +msgstr "Variante prodotto" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "Livello valutazione magazzino" diff --git a/stock_account_product_run_fifo_hook/i18n/stock_account_product_run_fifo_hook.pot b/stock_account_product_run_fifo_hook/i18n/stock_account_product_run_fifo_hook.pot new file mode 100644 index 000000000000..17845159575c --- /dev/null +++ b/stock_account_product_run_fifo_hook/i18n/stock_account_product_run_fifo_hook.pot @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_account_product_run_fifo_hook +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_account_product_run_fifo_hook +#. odoo-python +#: code:addons/stock_account_product_run_fifo_hook/hooks.py:0 +#, python-format +msgid "Correction of %s (modification of past move)" +msgstr "" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: stock_account_product_run_fifo_hook +#: model:ir.model,name:stock_account_product_run_fifo_hook.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "" diff --git a/stock_account_product_run_fifo_hook/model/__init__.py b/stock_account_product_run_fifo_hook/model/__init__.py new file mode 100644 index 000000000000..3e46e947420a --- /dev/null +++ b/stock_account_product_run_fifo_hook/model/__init__.py @@ -0,0 +1,2 @@ +from . import product +from . import stock_valuation_layer diff --git a/stock_account_product_run_fifo_hook/model/product.py b/stock_account_product_run_fifo_hook/model/product.py new file mode 100644 index 000000000000..28a0cacb1695 --- /dev/null +++ b/stock_account_product_run_fifo_hook/model/product.py @@ -0,0 +1,29 @@ +# Copyright 2020 ForgeFlow, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from odoo import models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + def _run_fifo_prepare_candidate_update( + self, + candidate, + qty_taken_on_candidate, + value_taken_on_candidate, + candidate_vals, + ): + return candidate_vals + + def _run_fifo_vacuum_prepare_candidate_update( + self, + svl_to_vacuum, + candidate, + qty_taken_on_candidate, + value_taken_on_candidate, + candidate_vals, + ): + return candidate_vals + + def _price_updateable(self, new_standard_price=False): + return new_standard_price and self.cost_method == "fifo" diff --git a/stock_account_product_run_fifo_hook/model/stock_valuation_layer.py b/stock_account_product_run_fifo_hook/model/stock_valuation_layer.py new file mode 100644 index 000000000000..9b55fe5f194f --- /dev/null +++ b/stock_account_product_run_fifo_hook/model/stock_valuation_layer.py @@ -0,0 +1,20 @@ +# Copyright 2024 ForgeFlow, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from odoo import api, models + + +class StockValuationLayer(models.Model): + _inherit = "stock.valuation.layer" + + @api.model_create_multi + def create(self, values): + if any("taken_data" in val.keys() for val in values): + taken_data = [ + "taken_data" in val.keys() and val.pop("taken_data") or {} + for val in values + ] + return super( + StockValuationLayer, self.with_context(taken_data=taken_data) + ).create(values) + else: + return super().create(values) diff --git a/stock_account_product_run_fifo_hook/pyproject.toml b/stock_account_product_run_fifo_hook/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/stock_account_product_run_fifo_hook/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_account_product_run_fifo_hook/readme/CONTRIBUTORS.md b/stock_account_product_run_fifo_hook/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..f557671598e4 --- /dev/null +++ b/stock_account_product_run_fifo_hook/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Forgeflow () + + > - Jordi Ballester Alomar \<\> diff --git a/stock_account_product_run_fifo_hook/readme/DESCRIPTION.md b/stock_account_product_run_fifo_hook/readme/DESCRIPTION.md new file mode 100644 index 000000000000..02f488392cc0 --- /dev/null +++ b/stock_account_product_run_fifo_hook/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adds hook points in product_product.\_run_fifo in order to +add more flexibility in the information that is stored in the fifo +candidates. diff --git a/stock_account_product_run_fifo_hook/readme/USAGE.md b/stock_account_product_run_fifo_hook/readme/USAGE.md new file mode 100644 index 000000000000..826f889ae657 --- /dev/null +++ b/stock_account_product_run_fifo_hook/readme/USAGE.md @@ -0,0 +1,4 @@ +1. Add dependency of this module +2. Inherit from 'product.product' +3. Change the \_run_fifo_prepare_candidate_update function in order to + return an updated logic. diff --git a/stock_account_product_run_fifo_hook/static/description/icon.png b/stock_account_product_run_fifo_hook/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_account_product_run_fifo_hook/static/description/icon.png differ diff --git a/stock_account_product_run_fifo_hook/static/description/index.html b/stock_account_product_run_fifo_hook/static/description/index.html new file mode 100644 index 000000000000..83a22f254ba9 --- /dev/null +++ b/stock_account_product_run_fifo_hook/static/description/index.html @@ -0,0 +1,441 @@ + + + + + +Stock Account Product Run FIFO Hook + + + +
+

Stock Account Product Run FIFO Hook

+ + +

Beta License: LGPL-3 OCA/stock-logistics-workflow Translate me on Weblate Try me on Runboat

+

This module adds hook points in product_product._run_fifo in order to +add more flexibility in the information that is stored in the fifo +candidates.

+

Table of contents

+ +
+

Usage

+
    +
  1. Add dependency of this module
  2. +
  3. Inherit from ‘product.product’
  4. +
  5. Change the _run_fifo_prepare_candidate_update function in order to +return an updated logic.
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +