Skip to content

Commit

Permalink
Merge PR #1865 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 11, 2023
2 parents 4e8a9ae + 3952f30 commit 6e292cd
Show file tree
Hide file tree
Showing 19 changed files with 788 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_inventory_count_to_zero/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
89 changes: 89 additions & 0 deletions stock_inventory_count_to_zero/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
=============================
Stock Inventory Count To Zero
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:61e9cce3b93c7b9f4394e7b8e1405f5f915a8df608be6b005d66f3f5abd2909f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/15.0/stock_inventory_count_to_zero
: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-15-0/stock-logistics-warehouse-15-0-stock_inventory_count_to_zero
: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=15.0
:alt: Try me on Runboat

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

This module extends the functionality of stock module to allow request a inventory and
set inventory quantities to zero.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module you need to:

#. Go to a *Inventory > Operations > Inventory adjustment*.
#. Select some records and click on button "Request a count".
#. Set the "Set to zero" in count field.
#. Apply inventory when you want.

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_inventory_count_to_zero%0Aversion:%2015.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>`_

* Sergio Teruel

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/15.0/stock_inventory_count_to_zero>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions stock_inventory_count_to_zero/__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).
from . import models
from . import wizards
14 changes: 14 additions & 0 deletions stock_inventory_count_to_zero/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Inventory Count To Zero",
"summary": "Request an inventory count filling the quantities to zero as default",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Inventory/Inventory",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["stock"],
}
44 changes: 44 additions & 0 deletions stock_inventory_count_to_zero/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_count_to_zero
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-26 21:52+0000\n"
"PO-Revision-Date: 2023-07-26 23:55+0200\n"
"Last-Translator: Sergio Teruel <[email protected]>\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.0.1\n"

#. module: stock_inventory_count_to_zero
#: model:ir.model.fields,field_description:stock_inventory_count_to_zero.field_stock_request_count__set_count
msgid "Count"
msgstr "Cuenta"

#. module: stock_inventory_count_to_zero
#: code:addons/stock_inventory_count_to_zero/models/stock_quant.py:0
#, python-format
msgid "Quantities Already Set"
msgstr "Cantidades ya establecidas"

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

#. module: stock_inventory_count_to_zero
#: model:ir.model.fields.selection,name:stock_inventory_count_to_zero.selection__stock_request_count__set_count__zero
msgid "Set to zero"
msgstr "Establecer a cero"

#. module: stock_inventory_count_to_zero
#: model:ir.model,name:stock_inventory_count_to_zero.model_stock_request_count
msgid "Stock Request an Inventory Count"
msgstr "Solicitar un recuento"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_inventory_count_to_zero
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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_inventory_count_to_zero
#: model:ir.model.fields,field_description:stock_inventory_count_to_zero.field_stock_request_count__set_count
msgid "Count"
msgstr ""

#. module: stock_inventory_count_to_zero
#: code:addons/stock_inventory_count_to_zero/models/stock_quant.py:0
#, python-format
msgid "Quantities Already Set"
msgstr ""

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

#. module: stock_inventory_count_to_zero
#: model:ir.model.fields.selection,name:stock_inventory_count_to_zero.selection__stock_request_count__set_count__zero
msgid "Set to zero"
msgstr ""

#. module: stock_inventory_count_to_zero
#: model:ir.model,name:stock_inventory_count_to_zero.model_stock_request_count
msgid "Stock Request an Inventory Count"
msgstr ""
42 changes: 42 additions & 0 deletions stock_inventory_count_to_zero/i18n/stock_request_count_to_zero.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_request_count_to_zero
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-26 21:52+0000\n"
"PO-Revision-Date: 2023-07-26 21:52+0000\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_request_count_to_zero
#: model:ir.model.fields,field_description:stock_request_count_to_zero.field_stock_request_count__set_count
msgid "Count"
msgstr ""

#. module: stock_request_count_to_zero
#: code:addons/stock_request_count_to_zero/models/stock_quant.py:0
#, python-format
msgid "Quantities Already Set"
msgstr ""

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

#. module: stock_request_count_to_zero
#: model:ir.model.fields.selection,name:stock_request_count_to_zero.selection__stock_request_count__set_count__zero
msgid "Set to zero"
msgstr ""

#. module: stock_request_count_to_zero
#: model:ir.model,name:stock_request_count_to_zero.model_stock_request_count
msgid "Stock Request an Inventory Count"
msgstr ""
2 changes: 2 additions & 0 deletions stock_inventory_count_to_zero/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_quant
30 changes: 30 additions & 0 deletions stock_inventory_count_to_zero/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, models


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

def action_set_inventory_quantity_recount_to_zero(self):
quants_already_set = self.filtered(lambda quant: quant.inventory_quantity_set)
if quants_already_set:
ctx = dict(self.env.context or {}, default_quant_ids=self.ids)
view = self.env.ref("stock.inventory_warning_set_view", False)
return {
"name": _("Quantities Already Set"),
"type": "ir.actions.act_window",
"view_mode": "form",
"views": [(view.id, "form")],
"view_id": view.id,
"res_model": "stock.inventory.warning",
"target": "new",
"context": ctx,
}
self.update(
{
"inventory_quantity": 0.0,
"user_id": self.env.user.id,
"inventory_quantity_set": True,
}
)
3 changes: 3 additions & 0 deletions stock_inventory_count_to_zero/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`_

* Sergio Teruel
2 changes: 2 additions & 0 deletions stock_inventory_count_to_zero/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the functionality of stock module to allow request a inventory and
set inventory quantities to zero.
6 changes: 6 additions & 0 deletions stock_inventory_count_to_zero/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module you need to:

#. Go to a *Inventory > Operations > Inventory adjustment*.
#. Select some records and click on button "Request a count".
#. Set the "Set to zero" in count field.
#. Apply inventory when you want.
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 6e292cd

Please sign in to comment.