diff --git a/stock_demand_estimate/README.rst b/stock_demand_estimate/README.rst index 89c34993e..d2c993597 100644 --- a/stock_demand_estimate/README.rst +++ b/stock_demand_estimate/README.rst @@ -7,20 +7,20 @@ Stock Demand Estimate !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Production/Stable .. |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_demand_estimate + :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_demand_estimate :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 + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_demand_estimate :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,7 +41,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. @@ -72,6 +72,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/__manifest__.py b/stock_demand_estimate/__manifest__.py index bff07b742..7b9b2b963 100644 --- a/stock_demand_estimate/__manifest__.py +++ b/stock_demand_estimate/__manifest__.py @@ -1,10 +1,11 @@ -# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { "name": "Stock Demand Estimate", "summary": "Allows to create demand estimates.", - "version": "12.0.2.0.1", + "version": "13.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", + "development_status": "Production/Stable", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse Management", "depends": ["stock"], diff --git a/stock_demand_estimate/models/stock_demand_estimate.py b/stock_demand_estimate/models/stock_demand_estimate.py index 679d18287..5f0af2d58 100644 --- a/stock_demand_estimate/models/stock_demand_estimate.py +++ b/stock_demand_estimate/models/stock_demand_estimate.py @@ -1,4 +1,4 @@ -# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com) +# Copyright 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) # Copyright 2016 Aleph Objects, Inc. (https://www.alephobjects.com/) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). @@ -7,8 +7,6 @@ from datetime import date, timedelta from odoo import _, api, fields, models from odoo.exceptions import UserError -from odoo.addons import decimal_precision as dp - class StockDemandEstimate(models.Model): _name = "stock.demand.estimate" @@ -33,9 +31,7 @@ class StockDemandEstimate(models.Model): location_id = fields.Many2one( comodel_name="stock.location", string="Location", required=True ) - product_uom_qty = fields.Float( - string="Quantity", digits=dp.get_precision("Product Unit of Measure") - ) + product_uom_qty = fields.Float(string="Quantity", digits="Product Unit of Measure") product_qty = fields.Float( "Real Quantity", compute="_compute_product_quantity", @@ -50,12 +46,9 @@ class StockDemandEstimate(models.Model): comodel_name="res.company", string="Company", required=True, - default=lambda self: self.env["res.company"]._company_default_get( - "stock.demand.estimate" - ), + default=lambda self: self.env.company, ) - @api.multi @api.depends("manual_duration", "manual_date_from", "manual_date_to") def _compute_dates(self): today = date.today() @@ -71,7 +64,6 @@ class StockDemandEstimate(models.Model): rec.date_to = rec.date_from + timedelta(days=1) rec.duration = 2 - @api.multi @api.depends("product_qty", "duration") def _compute_daily_qty(self): for rec in self: @@ -80,7 +72,6 @@ class StockDemandEstimate(models.Model): else: rec.daily_qty = 0.0 - @api.multi @api.depends("product_id", "product_uom", "product_uom_qty") def _compute_product_quantity(self): for rec in self: @@ -101,15 +92,11 @@ class StockDemandEstimate(models.Model): ) ) - @api.multi def name_get(self): res = [] for rec in self: name = "{} - {}: {} - {}".format( - rec.date_from, - rec.date_to, - rec.product_id.name, - rec.location_id.name, + rec.date_from, rec.date_to, rec.product_id.name, rec.location_id.name ) res.append((rec.id, name)) return res diff --git a/stock_demand_estimate/static/description/index.html b/stock_demand_estimate/static/description/index.html index f56509fba..fcda51c49 100644 --- a/stock_demand_estimate/static/description/index.html +++ b/stock_demand_estimate/static/description/index.html @@ -3,7 +3,7 @@ - + Stock Demand Estimate