From 6438cc0652c5d03e661e60c53b2ebc9f85be9a5e Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Thu, 11 Jul 2019 12:47:05 +0200 Subject: [PATCH] [12.0][MIG] stock_request_analytic --- stock_request_analytic/README.rst | 76 +-- stock_request_analytic/__manifest__.py | 2 +- .../i18n/stock_request_analytic.pot | 24 +- stock_request_analytic/models/__init__.py | 3 +- .../{procurement_rule.py => stock_rule.py} | 2 +- .../readme/CONTRIBUTORS.rst | 2 + stock_request_analytic/readme/DESCRIPTION.rst | 2 + stock_request_analytic/readme/ROADMAP.rst | 2 + stock_request_analytic/readme/USAGE.rst | 1 + .../static/description/index.html | 434 ++++++++++++++++++ .../tests/test_stock_request_analytic.py | 20 +- 11 files changed, 516 insertions(+), 52 deletions(-) rename stock_request_analytic/models/{procurement_rule.py => stock_rule.py} (95%) create mode 100644 stock_request_analytic/readme/CONTRIBUTORS.rst create mode 100644 stock_request_analytic/readme/DESCRIPTION.rst create mode 100644 stock_request_analytic/readme/ROADMAP.rst create mode 100644 stock_request_analytic/readme/USAGE.rst create mode 100644 stock_request_analytic/static/description/index.html diff --git a/stock_request_analytic/README.rst b/stock_request_analytic/README.rst index 2fadfc77b..900902bc4 100644 --- a/stock_request_analytic/README.rst +++ b/stock_request_analytic/README.rst @@ -1,64 +1,86 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 - ====================== Stock Request Analytic ====================== -This module allows for users to be able to display assign analytic accounts to -stock request. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-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--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_analytic + :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-12-0/stock-logistics-warehouse-12-0-stock_request_analytic + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows for users to be able to display and assign analytic +accounts to stock requests. + +**Table of contents** + +.. contents:: + :local: Usage ===== Assign the analytic account to the stock request. - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 - Known issues / Roadmap ====================== * Integrate this module with stock_request_purchase to pass the analytic account to the purchase order - Bug Tracker =========== -Probably the only solution to make this work in to put locations without -company. In this case the constrains defined makes no sense. - -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 smash it by providing detailed and welcomed feedback. +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 + Contributors ------------- +~~~~~~~~~~~~ -* Jordi Ballester . -* Enric Tobella +* Aaron Henriquez +* Lois Rilo -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_analytic/__manifest__.py b/stock_request_analytic/__manifest__.py index 771ec5586..105f88431 100644 --- a/stock_request_analytic/__manifest__.py +++ b/stock_request_analytic/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Request Analytic", "summary": "Internal request for stock", - "version": "11.0.2.0.1", + "version": "12.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/stock-logistics-warehouse", "author": "Eficent, " diff --git a/stock_request_analytic/i18n/stock_request_analytic.pot b/stock_request_analytic/i18n/stock_request_analytic.pot index 830d3a440..0d66ecc86 100644 --- a/stock_request_analytic/i18n/stock_request_analytic.pot +++ b/stock_request_analytic/i18n/stock_request_analytic.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -15,29 +15,24 @@ msgstr "" #. module: stock_request_analytic #: model:ir.model,name:stock_request_analytic.model_account_analytic_account -#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request_analytic_account_id +#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request__analytic_account_id msgid "Analytic Account" msgstr "" #. module: stock_request_analytic -#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request_order_analytic_account_ids -#: model:ir.ui.view,arch_db:stock_request_analytic.stock_request_order_form +#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request_order__analytic_account_ids +#: model_terms:ir.ui.view,arch_db:stock_request_analytic.stock_request_order_form msgid "Analytic Accounts" msgstr "" #. module: stock_request_analytic -#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request_order_analytic_count +#: model:ir.model.fields,field_description:stock_request_analytic.field_stock_request_order__analytic_count msgid "Analytic Count" msgstr "" -#. module: stock_request_analytic -#: model:ir.model,name:stock_request_analytic.model_procurement_rule -msgid "Procurement Rule" -msgstr "" - #. module: stock_request_analytic #: model:ir.model,name:stock_request_analytic.model_stock_request -#: model:ir.ui.view,arch_db:stock_request_analytic.view_account_analytic_account_form +#: model_terms:ir.ui.view,arch_db:stock_request_analytic.view_account_analytic_account_form msgid "Stock Request" msgstr "" @@ -47,10 +42,15 @@ msgid "Stock Request Order" msgstr "" #. module: stock_request_analytic -#: model:ir.model.fields,field_description:stock_request_analytic.field_account_analytic_account_stock_request_ids +#: model:ir.model.fields,field_description:stock_request_analytic.field_account_analytic_account__stock_request_ids msgid "Stock Requests" msgstr "" +#. module: stock_request_analytic +#: model:ir.model,name:stock_request_analytic.model_stock_rule +msgid "Stock Rule" +msgstr "" + #. module: stock_request_analytic #: code:addons/stock_request_analytic/models/stock_request.py:19 #, python-format diff --git a/stock_request_analytic/models/__init__.py b/stock_request_analytic/models/__init__.py index 968dd905e..4a24765c7 100644 --- a/stock_request_analytic/models/__init__.py +++ b/stock_request_analytic/models/__init__.py @@ -1,5 +1,4 @@ - from . import analytic -from . import procurement_rule +from . import stock_rule from . import stock_request from . import stock_request_order diff --git a/stock_request_analytic/models/procurement_rule.py b/stock_request_analytic/models/stock_rule.py similarity index 95% rename from stock_request_analytic/models/procurement_rule.py rename to stock_request_analytic/models/stock_rule.py index e09a0800e..52bfc0869 100644 --- a/stock_request_analytic/models/procurement_rule.py +++ b/stock_request_analytic/models/stock_rule.py @@ -5,7 +5,7 @@ from odoo import models class ProcurementRule(models.Model): - _inherit = 'procurement.rule' + _inherit = "stock.rule" def _get_stock_move_values(self, product_id, product_qty, product_uom, location_id, name, origin, values, group_id): diff --git a/stock_request_analytic/readme/CONTRIBUTORS.rst b/stock_request_analytic/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..b8893d719 --- /dev/null +++ b/stock_request_analytic/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Aaron Henriquez +* Lois Rilo diff --git a/stock_request_analytic/readme/DESCRIPTION.rst b/stock_request_analytic/readme/DESCRIPTION.rst new file mode 100644 index 000000000..259f4ba9c --- /dev/null +++ b/stock_request_analytic/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows for users to be able to display and assign analytic +accounts to stock requests. diff --git a/stock_request_analytic/readme/ROADMAP.rst b/stock_request_analytic/readme/ROADMAP.rst new file mode 100644 index 000000000..fe59d5a8d --- /dev/null +++ b/stock_request_analytic/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* Integrate this module with stock_request_purchase to pass the analytic + account to the purchase order diff --git a/stock_request_analytic/readme/USAGE.rst b/stock_request_analytic/readme/USAGE.rst new file mode 100644 index 000000000..e9c6ebb47 --- /dev/null +++ b/stock_request_analytic/readme/USAGE.rst @@ -0,0 +1 @@ +Assign the analytic account to the stock request. diff --git a/stock_request_analytic/static/description/index.html b/stock_request_analytic/static/description/index.html new file mode 100644 index 000000000..242a4aba5 --- /dev/null +++ b/stock_request_analytic/static/description/index.html @@ -0,0 +1,434 @@ + + + + + + +Stock Request Analytic + + + +
+

Stock Request Analytic

+ + +

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

This module allows for users to be able to display and assign analytic +accounts to stock requests.

+

Table of contents

+ +
+

Usage

+

Assign the analytic account to the stock request.

+
+
+

Known issues / Roadmap

+
    +
  • Integrate this module with stock_request_purchase to pass the analytic +account to the purchase order
  • +
+
+
+

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
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/stock_request_analytic/tests/test_stock_request_analytic.py b/stock_request_analytic/tests/test_stock_request_analytic.py index c3b28cda1..0f5c6bc42 100644 --- a/stock_request_analytic/tests/test_stock_request_analytic.py +++ b/stock_request_analytic/tests/test_stock_request_analytic.py @@ -11,13 +11,15 @@ class TestStockRequestAnalytic(test_stock_request.TestStockRequest): super(TestStockRequestAnalytic, self).setUp() self.analytic_model = self.env['account.analytic.account'] self.analytic = self.analytic_model.create({'name': 'Pizza'}) - self.analytic2 = self.analytic_model.create( - {'name': 'Pizza', - 'company_id': self.company_2.id}) - self.demand_loc = self.env['stock.location'].create( - {'name': 'demand_loc', - 'location_id': self.warehouse.lot_stock_id.id, - 'usage': 'internal'}) + self.analytic2 = self.analytic_model.create({ + 'name': 'Pizza', + 'company_id': self.company_2.id, + }) + self.demand_loc = self.env['stock.location'].create({ + 'name': 'demand_loc', + 'location_id': self.warehouse.lot_stock_id.id, + 'usage': 'internal', + }) self.demand_route = self.env['stock.location.route'].create({ 'name': 'Transfer', 'product_categ_selectable': False, @@ -26,12 +28,12 @@ class TestStockRequestAnalytic(test_stock_request.TestStockRequest): 'sequence': 10, }) self.pizza = self._create_product('PZ', 'Pizza', False) - self.demand_rule = self.env['procurement.rule'].create({ + self.demand_rule = self.env['stock.rule'].create({ 'name': 'Transfer', 'route_id': self.demand_route.id, 'location_src_id': self.warehouse.lot_stock_id.id, 'location_id': self.demand_loc.id, - 'action': 'move', + 'action': 'pull', 'picking_type_id': self.warehouse.int_type_id.id, 'procure_method': 'make_to_stock', 'warehouse_id': self.warehouse.id,