mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[13.0][MIG] mrp_warehouse_calendar
This commit is contained in:
@@ -7,20 +7,20 @@ MRP Warehouse Calendar
|
||||
!! 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%2Fmanufacture-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/manufacture/tree/12.0/mrp_warehouse_calendar
|
||||
:target: https://github.com/OCA/manufacture/tree/13.0/mrp_warehouse_calendar
|
||||
:alt: OCA/manufacture
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_warehouse_calendar
|
||||
:target: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_warehouse_calendar
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/129/12.0
|
||||
:target: https://runbot.odoo-community.org/runbot/129/13.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
@@ -69,7 +69,7 @@ Bug Tracker
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_warehouse_calendar%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_warehouse_calendar%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,12 +79,13 @@ Credits
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Eficent
|
||||
* ForgeFlow
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Jordi Ballester (EFICENT) <jordi.ballester@eficent.com>.
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
@@ -99,14 +100,14 @@ 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.
|
||||
|
||||
.. |maintainer-jbeficent| image:: https://github.com/jbeficent.png?size=40px
|
||||
:target: https://github.com/jbeficent
|
||||
:alt: jbeficent
|
||||
.. |maintainer-JordiBForgeFlow| image:: https://github.com/JordiBForgeFlow.png?size=40px
|
||||
:target: https://github.com/JordiBForgeFlow
|
||||
:alt: JordiBForgeFlow
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-jbeficent|
|
||||
|maintainer-JordiBForgeFlow|
|
||||
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/12.0/mrp_warehouse_calendar>`_ project on GitHub.
|
||||
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/13.0/mrp_warehouse_calendar>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Copyright 2018 Eficent Business and IT Consulting Services, S.L.
|
||||
# Copyright 2018-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "MRP Warehouse Calendar",
|
||||
"summary": "Considers the warehouse calendars in manufacturing",
|
||||
"version": "12.0.1.0.1",
|
||||
"version": "13.0.1.0.0",
|
||||
"license": "LGPL-3",
|
||||
"website": "https://github.com/stock-logistics-warehouse",
|
||||
"author": "Eficent, " "Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/manufacture",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"category": "Manufacturing",
|
||||
"depends": ["mrp", "stock_warehouse_calendar"],
|
||||
"installable": True,
|
||||
"development_status": "Beta",
|
||||
"maintainers": ["jbeficent"],
|
||||
"development_status": "Production/Stable",
|
||||
"maintainers": ["JordiBForgeFlow"],
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2018 Eficent Business and IT Consulting Services, S.L.
|
||||
# Copyright 2018-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import api, models
|
||||
@@ -17,9 +17,9 @@ class MrpProduction(models.Model):
|
||||
)
|
||||
self.date_planned_finished = date_expected_finished
|
||||
|
||||
@api.multi
|
||||
@api.returns("self", lambda value: value.id)
|
||||
def copy(self, default=None):
|
||||
mo = super(MrpProduction, self).copy(default=default)
|
||||
mo = super().copy(default=default)
|
||||
dt_planned = mo.date_planned_start
|
||||
warehouse = mo.picking_type_id.warehouse_id
|
||||
if warehouse.calendar_id and mo.product_id.produce_delay:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2018-19 Eficent Business and IT Consulting Services, S.L.
|
||||
# Copyright 2018-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
@@ -7,8 +7,8 @@ from odoo import fields, models
|
||||
class StockRule(models.Model):
|
||||
_inherit = "stock.rule"
|
||||
|
||||
def _get_date_planned(self, product_id, values):
|
||||
date_planned = super(StockRule, self)._get_date_planned(product_id, values)
|
||||
def _get_date_planned(self, product_id, company_id, values):
|
||||
date_planned = super()._get_date_planned(product_id, company_id, values)
|
||||
picking_type = self.picking_type_id or values["warehouse_id"].manu_type_id
|
||||
# We force the date planned to be at the beginning of the day.
|
||||
# So no work intervals are found in planned date.
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
* Jordi Ballester (EFICENT) <jordi.ballester@eficent.com>.
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.15.2: http://docutils.sourceforge.net/" />
|
||||
<title>MRP Warehouse Calendar</title>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/12.0/mrp_warehouse_calendar"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_warehouse_calendar"><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/129/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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/manufacture/tree/13.0/mrp_warehouse_calendar"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_warehouse_calendar"><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/129/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>With this module the manufacturing orders created from procurements consider
|
||||
the calendar assigned to the warehouse of the picking type of the
|
||||
manufacturing order to determine, based on the product’s manufacturing
|
||||
@@ -414,7 +414,7 @@ calendar.</p>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_warehouse_calendar%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/manufacture/issues/new?body=module:%20mrp_warehouse_calendar%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">
|
||||
@@ -422,13 +422,14 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Eficent</li>
|
||||
<li>ForgeFlow</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Jordi Ballester (EFICENT) <<a class="reference external" href="mailto:jordi.ballester@eficent.com">jordi.ballester@eficent.com</a>>.</li>
|
||||
<li>Jordi Ballester <<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>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
@@ -439,8 +440,8 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/jbeficent"><img alt="jbeficent" src="https://github.com/jbeficent.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/12.0/mrp_warehouse_calendar">OCA/manufacture</a> project on GitHub.</p>
|
||||
<p><a class="reference external" href="https://github.com/JordiBForgeFlow"><img alt="JordiBForgeFlow" src="https://github.com/JordiBForgeFlow.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/13.0/mrp_warehouse_calendar">OCA/manufacture</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>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Copyright 2018 Eficent Business and IT Consulting Services, S.L.
|
||||
# Copyright 2018-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
@@ -8,6 +9,8 @@ class TestMrpWarehouseCalendar(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestMrpWarehouseCalendar, self).setUp()
|
||||
self.move_obj = self.env["stock.move"]
|
||||
self.pg_obj = self.env["procurement.group"]
|
||||
|
||||
self.company = self.env.ref("base.main_company")
|
||||
self.warehouse = self.env.ref("stock.warehouse0")
|
||||
self.customer_loc = self.env.ref("stock.stock_location_customers")
|
||||
@@ -53,14 +56,19 @@ class TestMrpWarehouseCalendar(TransactionCase):
|
||||
"company_id": self.company,
|
||||
"rule_id": self.manufacture_route,
|
||||
}
|
||||
self.env["procurement.group"].run(
|
||||
self.product,
|
||||
100,
|
||||
self.product.uom_id,
|
||||
self.warehouse.lot_stock_id,
|
||||
"Test",
|
||||
"Test",
|
||||
values,
|
||||
self.pg_obj.run(
|
||||
[
|
||||
self.pg_obj.Procurement(
|
||||
self.product,
|
||||
100,
|
||||
self.product.uom_id,
|
||||
self.warehouse.lot_stock_id,
|
||||
"Test",
|
||||
"Test",
|
||||
self.warehouse.company_id,
|
||||
values,
|
||||
)
|
||||
]
|
||||
)
|
||||
mo = self.env["mrp.production"].search(
|
||||
[("product_id", "=", self.product.id)], limit=1
|
||||
@@ -80,14 +88,19 @@ class TestMrpWarehouseCalendar(TransactionCase):
|
||||
"company_id": self.company,
|
||||
"rule_id": self.manufacture_route,
|
||||
}
|
||||
self.env["procurement.group"].run(
|
||||
self.product,
|
||||
100,
|
||||
self.product.uom_id,
|
||||
self.warehouse.lot_stock_id,
|
||||
"Test 2",
|
||||
"Test 2",
|
||||
values,
|
||||
self.pg_obj.run(
|
||||
[
|
||||
self.pg_obj.Procurement(
|
||||
self.product,
|
||||
100,
|
||||
self.product.uom_id,
|
||||
self.warehouse.lot_stock_id,
|
||||
"Test 2",
|
||||
"Test 2",
|
||||
self.warehouse.company_id,
|
||||
values,
|
||||
)
|
||||
]
|
||||
)
|
||||
mo = self.env["mrp.production"].search(
|
||||
[("product_id", "=", self.product.id)], limit=1
|
||||
|
||||
Reference in New Issue
Block a user