diff --git a/stock_quantity_history_location/README.rst b/stock_quantity_history_location/README.rst new file mode 100644 index 0000000..f84d153 --- /dev/null +++ b/stock_quantity_history_location/README.rst @@ -0,0 +1,79 @@ +=============================== +Stock Quantity History Location +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/11.0/stock_quantity_history_location + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-11-0/stock-logistics-reporting-11-0-stock_quantity_history_location + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/151/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to run an Inventory report or Inventory Valuation +report by location, for a past date or for current date. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to: *Inventory / Reporting / Inventory or Inventory Valuation* +* Filter by location +* **Optionally: Mark if you want to include child location** +* Choose a moment in time: + * Current Inventory + * At a Specific Date + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Eficent + +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-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_quantity_history_location/__init__.py b/stock_quantity_history_location/__init__.py new file mode 100644 index 0000000..5cb1c49 --- /dev/null +++ b/stock_quantity_history_location/__init__.py @@ -0,0 +1 @@ +from . import wizards diff --git a/stock_quantity_history_location/__manifest__.py b/stock_quantity_history_location/__manifest__.py new file mode 100644 index 0000000..2a653a1 --- /dev/null +++ b/stock_quantity_history_location/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Aleph Objects, Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Stock Quantity History Location', + 'summary': "Provides stock quantity by location on past date", + 'version': '11.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Eficent,' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/stock-logistics-reporting', + 'depends': [ + 'stock', + ], + 'data': [ + 'wizards/stock_quantity_history.xml', + ], + +} diff --git a/stock_quantity_history_location/i18n/stock_quantity_history_location.pot b/stock_quantity_history_location/i18n/stock_quantity_history_location.pot new file mode 100644 index 0000000..707fbf7 --- /dev/null +++ b/stock_quantity_history_location/i18n/stock_quantity_history_location.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quantity_history_location +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.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_quantity_history_location +#: model:ir.model.fields,field_description:stock_quantity_history_location.field_stock_quantity_history_include_child_locations +msgid "Include child locations" +msgstr "" + +#. module: stock_quantity_history_location +#: model:ir.model.fields,field_description:stock_quantity_history_location.field_stock_quantity_history_location_id +msgid "Location" +msgstr "" + +#. module: stock_quantity_history_location +#: model:ir.model,name:stock_quantity_history_location.model_stock_quantity_history +msgid "Stock Quantity History" +msgstr "" + diff --git a/stock_quantity_history_location/readme/CONSTRIBUTORS.rst b/stock_quantity_history_location/readme/CONSTRIBUTORS.rst new file mode 100644 index 0000000..6860aff --- /dev/null +++ b/stock_quantity_history_location/readme/CONSTRIBUTORS.rst @@ -0,0 +1 @@ +* Jordi Ballester Alomar diff --git a/stock_quantity_history_location/readme/DESCRIPTION.rst b/stock_quantity_history_location/readme/DESCRIPTION.rst new file mode 100644 index 0000000..9b1d7c4 --- /dev/null +++ b/stock_quantity_history_location/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows to run an Inventory report or Inventory Valuation +report by location, for a past date or for current date. diff --git a/stock_quantity_history_location/readme/USAGE.rst b/stock_quantity_history_location/readme/USAGE.rst new file mode 100644 index 0000000..9037ce5 --- /dev/null +++ b/stock_quantity_history_location/readme/USAGE.rst @@ -0,0 +1,6 @@ +* Go to: *Inventory / Reporting / Inventory or Inventory Valuation* +* Filter by location +* **Optionally: Mark if you want to include child location** +* Choose a moment in time: + * Current Inventory + * At a Specific Date diff --git a/stock_quantity_history_location/static/description/icon.png b/stock_quantity_history_location/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/stock_quantity_history_location/static/description/icon.png differ diff --git a/stock_quantity_history_location/static/description/index.html b/stock_quantity_history_location/static/description/index.html new file mode 100644 index 0000000..4d329a9 --- /dev/null +++ b/stock_quantity_history_location/static/description/index.html @@ -0,0 +1,431 @@ + + + + + + +Stock Quantity History Location + + + +
+

Stock Quantity History Location

+ + +

Beta License: AGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runbot

+

This module allows to run an Inventory report or Inventory Valuation +report by location, for a past date or for current date.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to: Inventory / Reporting / Inventory or Inventory Valuation
  • +
  • Filter by location
  • +
  • Optionally: Mark if you want to include child location
  • +
  • +
    Choose a moment in time:
    +
      +
    • Current Inventory
    • +
    • At a Specific Date
    • +
    +
    +
    +
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Eficent
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/stock_quantity_history_location/tests/__init__.py b/stock_quantity_history_location/tests/__init__.py new file mode 100644 index 0000000..6be307f --- /dev/null +++ b/stock_quantity_history_location/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_quantity_history_location diff --git a/stock_quantity_history_location/tests/test_stock_quantity_history_location.py b/stock_quantity_history_location/tests/test_stock_quantity_history_location.py new file mode 100644 index 0000000..59cedea --- /dev/null +++ b/stock_quantity_history_location/tests/test_stock_quantity_history_location.py @@ -0,0 +1,22 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import SavepointCase + + +class TestStockQuantityHistoryLocation(SavepointCase): + + @classmethod + def setUpClass(cls): + super(TestStockQuantityHistoryLocation, cls).setUpClass() + cls.stock_loc = cls.env.ref('stock.stock_location_stock') + + def test_wizard(self): + self.wizard = self.env['stock.quantity.history'].create({ + "location_id": self.stock_loc.id, + "include_child_locations": True, + "compute_at_date": 0, + "company_owned": True + }) + wizard = self.wizard.open_table() + self.assertEquals(wizard['context']['location'], self.stock_loc.id) diff --git a/stock_quantity_history_location/wizards/__init__.py b/stock_quantity_history_location/wizards/__init__.py new file mode 100644 index 0000000..51f2abb --- /dev/null +++ b/stock_quantity_history_location/wizards/__init__.py @@ -0,0 +1 @@ +from . import stock_quantity_history diff --git a/stock_quantity_history_location/wizards/stock_quantity_history.py b/stock_quantity_history_location/wizards/stock_quantity_history.py new file mode 100644 index 0000000..689ee4f --- /dev/null +++ b/stock_quantity_history_location/wizards/stock_quantity_history.py @@ -0,0 +1,32 @@ +# Copyright 2019 Eficent Business and IT Consulting Services, S.L. +# Copyright 2019 Aleph Objects, Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import ast +from odoo import fields, models + + +class StockQuantityHistory(models.TransientModel): + _inherit = 'stock.quantity.history' + + location_id = fields.Many2one( + 'stock.location', domain=[('usage', 'in', ['internal', 'transit'])], + ) + include_child_locations = fields.Boolean('Include child locations', + default=True, + ) + + def open_table(self): + action = super(StockQuantityHistory, self).open_table() + ctx = action['context'] + if isinstance(ctx, str): + ctx = ast.literal_eval(ctx) + action['domain'] = [('type', '=', 'product')] + if self.location_id: + ctx['location'] = self.location_id.id + ctx['compute_child'] = self.include_child_locations + if ctx.get('company_owned', False): + ctx.pop('company_owned') + action['name'] = '%s (%s)' % (action['name'], + self.location_id.complete_name) + action['context'] = ctx + return action diff --git a/stock_quantity_history_location/wizards/stock_quantity_history.xml b/stock_quantity_history_location/wizards/stock_quantity_history.xml new file mode 100644 index 0000000..864d474 --- /dev/null +++ b/stock_quantity_history_location/wizards/stock_quantity_history.xml @@ -0,0 +1,16 @@ + + + + Inventory Report + stock.quantity.history + + + + + + + + + +