mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_demand_estimate_matrix: Migration to 13.0
This commit is contained in:
@@ -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 <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 smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_demand_estimate_matrix%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_demand_estimate_matrix%0Aversion:%2013.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.
|
||||
|
||||
@@ -79,6 +79,7 @@ Contributors
|
||||
|
||||
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
|
||||
|
||||
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 <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate_matrix>`_ project on GitHub.
|
||||
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_demand_estimate_matrix>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate_matrix"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_demand_estimate_matrix"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_demand_estimate_matrix"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_demand_estimate_matrix"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows to create demand estimates for a given product and
|
||||
location, on configurable time periods.</p>
|
||||
<p>The module does not provide in itself any specific usage of the estimates.</p>
|
||||
@@ -390,17 +390,17 @@ location, on configurable time periods.</p>
|
||||
<p>This module relies on:</p>
|
||||
<ul class="simple">
|
||||
<li>The OCA module ‘2D matrix for x2many fields’, and can be downloaded from
|
||||
Github: <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_x2many_2d_matrix">https://github.com/OCA/web/tree/12.0/web_widget_x2many_2d_matrix</a></li>
|
||||
Github: <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_widget_x2many_2d_matrix">https://github.com/OCA/web/tree/13.0/web_widget_x2many_2d_matrix</a></li>
|
||||
<li>The OCA module ‘Date Range’, and can be downloaded from
|
||||
Github: <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/date_range">https://github.com/OCA/server-ux/tree/12.0/date_range</a></li>
|
||||
Github: <a class="reference external" href="https://github.com/OCA/server-ux/tree/13.0/date_range">https://github.com/OCA/server-ux/tree/13.0/date_range</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<p>Go to ‘Inventory / Configuration / Date Ranges’ and define your estimating periods.</p>
|
||||
<p>Go to ‘Inventory / Demand Planning / Create Demand Estimates’ to create or
|
||||
<p>Go to <em>Inventory > Configuration > Date Ranges</em> and define your estimating periods.</p>
|
||||
<p>Go to <em>Inventory > Demand Planning > Create Demand Estimates</em> to create or
|
||||
update your demand estimates.</p>
|
||||
<p>Go to ‘Inventory / Demand Planning / Demand Estimates’ to review the
|
||||
<p>Go to <em>Inventory > Demand Planning > Demand Estimates</em> to review the
|
||||
estimates created.</p>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
@@ -408,7 +408,7 @@ estimates created.</p>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_demand_estimate_matrix%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_demand_estimate_matrix%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
@@ -424,6 +424,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<ul class="simple">
|
||||
<li>Jordi Ballester Alomar <<a class="reference external" href="mailto:jordi.ballester@forgeflow.com">jordi.ballester@forgeflow.com</a>></li>
|
||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@forgeflow.com">lois.rilo@forgeflow.com</a>></li>
|
||||
<li>Pimolnat Suntian <<a class="reference external" href="mailto:pimolnats@ecosoft.co.th">pimolnats@ecosoft.co.th</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
@@ -433,7 +434,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_demand_estimate_matrix">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_demand_estimate_matrix">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -88,10 +88,9 @@
|
||||
<act_window
|
||||
name="Create Stock Demand Estimates"
|
||||
res_model="stock.demand.estimate.wizard"
|
||||
src_model="stock.demand.estimate.sheet"
|
||||
binding_model="stock.demand.estimate.sheet"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="stock_demand_estimate_wizard_action"
|
||||
/>
|
||||
<menuitem
|
||||
|
||||
Reference in New Issue
Block a user