[13.0][MIG] stock_warehouse_calendar

This commit is contained in:
Lois Rilo
2019-12-17 10:04:25 +01:00
parent d6f6dc8b23
commit 898a2d06a4
9 changed files with 61 additions and 50 deletions

View File

@@ -14,13 +14,13 @@ Stock Warehouse Calendar
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3 :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github .. |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_warehouse_calendar :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_warehouse_calendar
:alt: OCA/stock-logistics-warehouse :alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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_warehouse_calendar :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_warehouse_calendar
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |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 :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -72,7 +72,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_. 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. 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 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_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/stock-logistics-warehouse/issues/new?body=module:%20stock_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. Do not contact contributors directly about support or help with technical issues.
@@ -82,13 +82,13 @@ Credits
Authors Authors
~~~~~~~ ~~~~~~~
* Eficent * ForgeFlow
Contributors Contributors
~~~~~~~~~~~~ ~~~~~~~~~~~~
* Jordi Ballester <jordi.ballester@eficent.com> * Jordi Ballester <jordi.ballester@forgeflow.com>
* Lois Rilo <lois.rilo@eficent> * Lois Rilo <lois.rilo@forgeflow.com>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@@ -103,14 +103,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
.. |maintainer-jbeficent| image:: https://github.com/jbeficent.png?size=40px .. |maintainer-JordiBForgeFlow| image:: https://github.com/JordiBForgeFlow.png?size=40px
:target: https://github.com/jbeficent :target: https://github.com/JordiBForgeFlow
:alt: jbeficent :alt: JordiBForgeFlow
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-jbeficent| |maintainer-JordiBForgeFlow|
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_warehouse_calendar>`_ project on GitHub. This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_warehouse_calendar>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -1,17 +1,17 @@
# Copyright 2017 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). # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{ {
"name": "Stock Warehouse Calendar", "name": "Stock Warehouse Calendar",
"summary": "Adds a calendar to the Warehouse", "summary": "Adds a calendar to the Warehouse",
"version": "12.0.1.0.1", "version": "13.0.1.0.0",
"license": "LGPL-3", "license": "LGPL-3",
"website": "https://github.com/stock-logistics-warehouse", "website": "https://github.com/stock-logistics-warehouse",
"author": "Eficent, " "Odoo Community Association (OCA)", "author": "ForgeFlow, " "Odoo Community Association (OCA)",
"category": "Warehouse Management", "category": "Warehouse Management",
"depends": ["stock", "resource"], "depends": ["stock", "resource"],
"data": ["views/stock_warehouse_views.xml"], "data": ["views/stock_warehouse_views.xml"],
"installable": True, "installable": True,
"development_status": "Beta", "development_status": "Beta",
"maintainers": ["jbeficent"], "maintainers": ["JordiBForgeFlow"],
} }

View File

@@ -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). # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from datetime import datetime from datetime import datetime
@@ -17,8 +17,8 @@ class StockRule(models.Model):
location_id, location_id,
name, name,
origin, origin,
company_id,
values, values,
group_id,
): ):
res = super(StockRule, self)._get_stock_move_values( res = super(StockRule, self)._get_stock_move_values(
product_id, product_id,
@@ -27,8 +27,8 @@ class StockRule(models.Model):
location_id, location_id,
name, name,
origin, origin,
company_id,
values, values,
group_id,
) )
warehouse = self.propagate_warehouse_id or self.warehouse_id warehouse = self.propagate_warehouse_id or self.warehouse_id
if warehouse.calendar_id and self.delay: if warehouse.calendar_id and self.delay:

View File

@@ -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). # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from datetime import datetime, timedelta from datetime import datetime, timedelta

View File

@@ -1,2 +1,2 @@
* Jordi Ballester <jordi.ballester@eficent.com> * Jordi Ballester <jordi.ballester@forgeflow.com>
* Lois Rilo <lois.rilo@eficent> * Lois Rilo <lois.rilo@forgeflow.com>

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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>Stock Warehouse Calendar</title> <title>Stock Warehouse Calendar</title>
<style type="text/css"> <style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! 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/stock-logistics-warehouse/tree/12.0/stock_warehouse_calendar"><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_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/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/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/stock-logistics-warehouse/tree/13.0/stock_warehouse_calendar"><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_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/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 adds a Calendar to the Warehouse. This calendar can then used as <p>This module adds a Calendar to the Warehouse. This calendar can then used as
the basis of the proper computation of start/end dates based on lead times in the basis of the proper computation of start/end dates based on lead times in
this and other modules.</p> this and other modules.</p>
@@ -417,7 +417,7 @@ if the warehouse operates under a Mo-Fri working calendar.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>. <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. 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 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_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/stock-logistics-warehouse/issues/new?body=module:%20stock_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> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -425,14 +425,14 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2> <h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Eficent</li> <li>ForgeFlow</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2> <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;eficent.com">jordi.ballester&#64;eficent.com</a>&gt;</li> <li>Jordi Ballester &lt;<a class="reference external" href="mailto:jordi.ballester&#64;forgeflow.com">jordi.ballester&#64;forgeflow.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent">lois.rilo&#64;eficent</a>&gt;</li> <li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
@@ -443,8 +443,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 mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</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><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/stock-logistics-warehouse/tree/12.0/stock_warehouse_calendar">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_warehouse_calendar">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> <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>
</div> </div>

View File

@@ -1,2 +1 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import test_stock_warehouse_calendar from . import test_stock_warehouse_calendar

View File

@@ -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). # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from odoo import fields from odoo import fields
@@ -10,6 +10,8 @@ class TestStockWarehouseCalendar(TransactionCase):
super(TestStockWarehouseCalendar, self).setUp() super(TestStockWarehouseCalendar, self).setUp()
self.wh_obj = self.env["stock.warehouse"] self.wh_obj = self.env["stock.warehouse"]
self.move_obj = self.env["stock.move"] self.move_obj = self.env["stock.move"]
self.pg_obj = self.env["procurement.group"]
self.company = self.env.ref("base.main_company") self.company = self.env.ref("base.main_company")
self.warehouse = self.env.ref("stock.warehouse0") self.warehouse = self.env.ref("stock.warehouse0")
self.customer_loc = self.env.ref("stock.stock_location_customers") self.customer_loc = self.env.ref("stock.stock_location_customers")
@@ -50,15 +52,20 @@ class TestStockWarehouseCalendar(TransactionCase):
"company_id": self.company, "company_id": self.company,
"rule_id": self.transfer_rule, "rule_id": self.transfer_rule,
} }
self.env["procurement.group"].run( self.pg_obj.run(
[
self.pg_obj.Procurement(
self.product, self.product,
100, 100,
self.product.uom_id, self.product.uom_id,
self.warehouse.lot_stock_id, self.warehouse.lot_stock_id,
"Test", "Test",
"Test", "Test",
self.warehouse.company_id,
values, values,
) )
]
)
move = self.env["stock.move"].search( move = self.env["stock.move"].search(
[("product_id", "=", self.product.id)], limit=1 [("product_id", "=", self.product.id)], limit=1
) )
@@ -77,15 +84,20 @@ class TestStockWarehouseCalendar(TransactionCase):
"company_id": self.company, "company_id": self.company,
"rule_id": self.transfer_rule, "rule_id": self.transfer_rule,
} }
self.env["procurement.group"].run( self.pg_obj.run(
[
self.pg_obj.Procurement(
self.product, self.product,
100, 100,
self.product.uom_id, self.product.uom_id,
self.warehouse.lot_stock_id, self.warehouse.lot_stock_id,
"Test", "Test",
"Test", "Test",
self.warehouse.company_id,
values, values,
) )
]
)
move = self.env["stock.move"].search( move = self.env["stock.move"].search(
[("product_id", "=", self.product.id)], limit=1 [("product_id", "=", self.product.id)], limit=1
) )

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 Eficent <!-- Copyright 2018 2018-19 ForgeFlow S.L. (https://www.forgeflow.com)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -->
<odoo> <odoo>
<record id="view_warehouse" model="ir.ui.view"> <record id="view_warehouse" model="ir.ui.view">