diff --git a/oca_dependencies.txt b/oca_dependencies.txt index d8a2d4efc..b255605c1 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,3 @@ product-attribute +server-ux +web diff --git a/setup/stock_demand_estimate_matrix/odoo/addons/stock_demand_estimate_matrix b/setup/stock_demand_estimate_matrix/odoo/addons/stock_demand_estimate_matrix new file mode 120000 index 000000000..73de46a1c --- /dev/null +++ b/setup/stock_demand_estimate_matrix/odoo/addons/stock_demand_estimate_matrix @@ -0,0 +1 @@ +../../../../stock_demand_estimate_matrix \ No newline at end of file diff --git a/setup/stock_demand_estimate_matrix/setup.py b/setup/stock_demand_estimate_matrix/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/stock_demand_estimate_matrix/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_demand_estimate_matrix/README.rst b/stock_demand_estimate_matrix/README.rst index 6d3fc17e9..1d5524a53 100644 --- a/stock_demand_estimate_matrix/README.rst +++ b/stock_demand_estimate_matrix/README.rst @@ -14,13 +14,13 @@ Stock Demand Estimate Matrix :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/12.0/stock_demand_estimate_matrix + :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_demand_estimate_matrix :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_demand_estimate_matrix + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_demand_estimate_matrix :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 + :target: https://runbot.odoo-community.org/runbot/153/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,19 +41,19 @@ Installation This module relies on: * The OCA module '2D matrix for x2many fields', and can be downloaded from - Github: https://github.com/OCA/web/tree/12.0/web_widget_x2many_2d_matrix + Github: https://github.com/OCA/web/tree/13.0/web_widget_x2many_2d_matrix * The OCA module 'Date Range', and can be downloaded from - Github: https://github.com/OCA/server-ux/tree/12.0/date_range + Github: https://github.com/OCA/server-ux/tree/13.0/date_range Usage ===== -Go to 'Inventory / Configuration / Date Ranges' and define your estimating periods. +Go to *Inventory > Configuration > Date Ranges* and define your estimating periods. -Go to 'Inventory / Demand Planning / Create Demand Estimates' to create or +Go to *Inventory > Demand Planning > Create Demand Estimates* to create or update your demand estimates. -Go to 'Inventory / Demand Planning / Demand Estimates' to review the +Go to *Inventory > Demand Planning > Demand Estimates* to review the estimates created. Bug Tracker @@ -62,7 +62,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -79,6 +79,7 @@ Contributors * Jordi Ballester Alomar * Lois Rilo +* Pimolnat Suntian Maintainers ~~~~~~~~~~~ @@ -93,6 +94,6 @@ 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. +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_demand_estimate_matrix/models/date_range.py b/stock_demand_estimate_matrix/models/date_range.py index fa4911925..ed13b490d 100644 --- a/stock_demand_estimate_matrix/models/date_range.py +++ b/stock_demand_estimate_matrix/models/date_range.py @@ -11,7 +11,6 @@ class DateRange(models.Model): string="Days between dates", compute="_compute_days", readonly=True, ) - @api.multi @api.depends("date_start", "date_end") def _compute_days(self): for rec in self.filtered(lambda x: x.date_start and x.date_end): diff --git a/stock_demand_estimate_matrix/models/stock_demand_estimate.py b/stock_demand_estimate_matrix/models/stock_demand_estimate.py index a0d86f369..20d2ace9c 100644 --- a/stock_demand_estimate_matrix/models/stock_demand_estimate.py +++ b/stock_demand_estimate_matrix/models/stock_demand_estimate.py @@ -11,7 +11,6 @@ class StockDemandEstimate(models.Model): comodel_name="date.range", string="Estimating Period", ondelete="restrict" ) - @api.multi @api.depends( "date_range_id", "manual_duration", "manual_date_from", "manual_date_to", ) @@ -24,7 +23,6 @@ class StockDemandEstimate(models.Model): rec.duration = rec.date_range_id.days return res - @api.multi def name_get(self): date_range_records = self.filtered(lambda r: r.date_range_id) res = super(StockDemandEstimate, self - date_range_records).name_get() diff --git a/stock_demand_estimate_matrix/readme/CONTRIBUTORS.rst b/stock_demand_estimate_matrix/readme/CONTRIBUTORS.rst index 10be2497b..f20a4c7c0 100644 --- a/stock_demand_estimate_matrix/readme/CONTRIBUTORS.rst +++ b/stock_demand_estimate_matrix/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Jordi Ballester Alomar * Lois Rilo +* Pimolnat Suntian diff --git a/stock_demand_estimate_matrix/readme/INSTALL.rst b/stock_demand_estimate_matrix/readme/INSTALL.rst index 7d7d64dce..7f06842c9 100644 --- a/stock_demand_estimate_matrix/readme/INSTALL.rst +++ b/stock_demand_estimate_matrix/readme/INSTALL.rst @@ -1,6 +1,6 @@ This module relies on: * The OCA module '2D matrix for x2many fields', and can be downloaded from - Github: https://github.com/OCA/web/tree/12.0/web_widget_x2many_2d_matrix + Github: https://github.com/OCA/web/tree/13.0/web_widget_x2many_2d_matrix * The OCA module 'Date Range', and can be downloaded from - Github: https://github.com/OCA/server-ux/tree/12.0/date_range + Github: https://github.com/OCA/server-ux/tree/13.0/date_range diff --git a/stock_demand_estimate_matrix/readme/USAGE.rst b/stock_demand_estimate_matrix/readme/USAGE.rst index dacb48d45..f59ade246 100644 --- a/stock_demand_estimate_matrix/readme/USAGE.rst +++ b/stock_demand_estimate_matrix/readme/USAGE.rst @@ -1,7 +1,7 @@ -Go to 'Inventory / Configuration / Date Ranges' and define your estimating periods. +Go to *Inventory > Configuration > Date Ranges* and define your estimating periods. -Go to 'Inventory / Demand Planning / Create Demand Estimates' to create or +Go to *Inventory > Demand Planning > Create Demand Estimates* to create or update your demand estimates. -Go to 'Inventory / Demand Planning / Demand Estimates' to review the +Go to *Inventory > Demand Planning > Demand Estimates* to review the estimates created. diff --git a/stock_demand_estimate_matrix/static/description/index.html b/stock_demand_estimate_matrix/static/description/index.html index 0788dbc5c..4a6d96bcb 100644 --- a/stock_demand_estimate_matrix/static/description/index.html +++ b/stock_demand_estimate_matrix/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module allows to create demand estimates for a given product and location, on configurable time periods.

The module does not provide in itself any specific usage of the estimates.

@@ -390,17 +390,17 @@ location, on configurable time periods.

This module relies on:

Usage

-

Go to ‘Inventory / Configuration / Date Ranges’ and define your estimating periods.

-

Go to ‘Inventory / Demand Planning / Create Demand Estimates’ to create or +

Go to Inventory > Configuration > Date Ranges and define your estimating periods.

+

Go to Inventory > Demand Planning > Create Demand Estimates to create or update your demand estimates.

-

Go to ‘Inventory / Demand Planning / Demand Estimates’ to review the +

Go to Inventory > Demand Planning > Demand Estimates to review the estimates created.

@@ -408,7 +408,7 @@ estimates created.

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.

+feedback.

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

@@ -424,6 +424,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
@@ -433,7 +434,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

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.

+

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_demand_estimate_matrix/tests/test_stock_demand_estimate.py b/stock_demand_estimate_matrix/tests/test_stock_demand_estimate.py index 93324a6d3..4da8134dc 100644 --- a/stock_demand_estimate_matrix/tests/test_stock_demand_estimate.py +++ b/stock_demand_estimate_matrix/tests/test_stock_demand_estimate.py @@ -28,14 +28,13 @@ class TestStockDemandEstimate(SavepointCase): {"name": "Month", "allow_overlap": False} ) - generator = cls.env["date.range.generator"] - generator = generator.create( + generator = cls.env["date.range.generator"].create( { "date_start": "1943-01-01", "name_prefix": "1943-", "type_id": cls.drt_monthly.id, "duration_count": 1, - "unit_of_time": MONTHLY, + "unit_of_time": str(MONTHLY), "count": 12, } ) @@ -176,7 +175,7 @@ class TestStockDemandEstimate(SavepointCase): { "product_id": self.product_1.id, "location_id": self.location.id, - "date_range_id": range.id, + "date_range_id": date_range.id, "product_uom_qty": 100.0, } ) diff --git a/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard.py b/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard.py index ec72f83aa..d0fc2b1ff 100644 --- a/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard.py +++ b/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard.py @@ -5,8 +5,6 @@ from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError from odoo.osv import expression -from odoo.addons import decimal_precision as dp - class StockDemandEstimateSheet(models.TransientModel): _name = "stock.demand.estimate.sheet" @@ -126,7 +124,6 @@ class StockDemandEstimateSheet(models.TransientModel): "product_uom": line.product_id.uom_id.id, } - @api.multi def button_validate(self): res = [] for line in self.line_ids: @@ -154,16 +151,15 @@ class StockDemandEstimateSheetLine(models.TransientModel): _description = "Stock Demand Estimate Sheet Line" estimate_id = fields.Many2one(comodel_name="stock.demand.estimate") - date_range_id = fields.Many2one(comodel_name="date.range", string="Period",) + date_range_id = fields.Many2one(comodel_name="date.range", string="Period") location_id = fields.Many2one( - comodel_name="stock.location", string="Stock Location", - ) - product_id = fields.Many2one(comodel_name="product.product", string="Product",) - value_x = fields.Char(string="Period Name",) - value_y = fields.Char(string="Product Name",) - product_uom_qty = fields.Float( - string="Quantity", digits=dp.get_precision("Product UoM"), + comodel_name="stock.location", string="Stock Location" ) + product_id = fields.Many2one(comodel_name="product.product", string="Product") + value_x = fields.Char(string="Period Name") + value_y = fields.Char(string="Product Name") + product_uom = fields.Many2one(comodel_name="uom.uom", string="Unit of measure") + product_uom_qty = fields.Float(string="Quantity", digits="Product UoM") class DemandEstimateWizard(models.TransientModel): @@ -200,7 +196,6 @@ class DemandEstimateWizard(models.TransientModel): _("The start date cannot be later than the end date.") ) - @api.multi def _prepare_demand_estimate_sheet(self): self.ensure_one() return { @@ -210,7 +205,6 @@ class DemandEstimateWizard(models.TransientModel): "location_id": self.location_id.id, } - @api.multi def create_sheet(self): self.ensure_one() if not self.product_ids: diff --git a/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard_view.xml b/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard_view.xml index 79ea09a13..5f25e1d2f 100644 --- a/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard_view.xml +++ b/stock_demand_estimate_matrix/wizards/stock_demand_estimate_wizard_view.xml @@ -88,10 +88,9 @@