From 08c1313fb69270e602b7ed84f623cf19dde3cd14 Mon Sep 17 00:00:00 2001 From: Saran L Date: Sun, 5 Aug 2018 17:15:59 +0200 Subject: [PATCH] [MIG] mrp_warehouse_calendar: Migration to 12.0 --- mrp_warehouse_calendar/README.rst | 12 +++---- mrp_warehouse_calendar/__manifest__.py | 2 +- mrp_warehouse_calendar/i18n/de.po | 32 +++++++++++++++++++ .../i18n/mrp_warehouse_calendar.pot | 8 ++--- mrp_warehouse_calendar/models/__init__.py | 2 +- .../models/mrp_production.py | 6 ++-- .../{procurement_rule.py => stock_rule.py} | 8 ++--- .../static/description/index.html | 8 ++--- .../tests/test_mrp_warehouse_calendar.py | 10 +++--- 9 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 mrp_warehouse_calendar/i18n/de.po rename mrp_warehouse_calendar/models/{procurement_rule.py => stock_rule.py} (78%) diff --git a/mrp_warehouse_calendar/README.rst b/mrp_warehouse_calendar/README.rst index 1141fb85e..889c286ac 100644 --- a/mrp_warehouse_calendar/README.rst +++ b/mrp_warehouse_calendar/README.rst @@ -14,13 +14,13 @@ MRP Warehouse Calendar :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github - :target: https://github.com/OCA/manufacture/tree/11.0/mrp_warehouse_calendar + :target: https://github.com/OCA/manufacture/tree/12.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-11-0/manufacture-11-0-mrp_warehouse_calendar + :target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-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/11.0 + :target: https://runbot.odoo-community.org/runbot/129/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -69,7 +69,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. @@ -103,10 +103,10 @@ promote its widespread use. :target: https://github.com/jbeficent :alt: jbeficent -Current `maintainer `_: +Current `maintainer `__: |maintainer-jbeficent| -This module is part of the `OCA/manufacture `_ project on GitHub. +This module is part of the `OCA/manufacture `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_warehouse_calendar/__manifest__.py b/mrp_warehouse_calendar/__manifest__.py index c86d2a4ea..264b6cffb 100644 --- a/mrp_warehouse_calendar/__manifest__.py +++ b/mrp_warehouse_calendar/__manifest__.py @@ -4,7 +4,7 @@ { "name": "MRP Warehouse Calendar", "summary": "Considers the warehouse calendars in manufacturing", - "version": "11.0.1.0.0", + "version": "12.0.1.0.0", "license": "AGPL-3", "website": "https://github.com/stock-logistics-warehouse", "author": "Eficent, " diff --git a/mrp_warehouse_calendar/i18n/de.po b/mrp_warehouse_calendar/i18n/de.po new file mode 100644 index 000000000..28f28331e --- /dev/null +++ b/mrp_warehouse_calendar/i18n/de.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_warehouse_calendar +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2018-12-09 10:43+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.3\n" + +#. module: mrp_warehouse_calendar +#: model:ir.model,name:mrp_warehouse_calendar.model_mrp_production +#, fuzzy +#| msgid "Manufacturing Order" +msgid "Production Order" +msgstr "Fertigungsauftrag" + +#. module: mrp_warehouse_calendar +#: model:ir.model,name:mrp_warehouse_calendar.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#~ msgid "Procurement Rule" +#~ msgstr "Beschaffungsregel" diff --git a/mrp_warehouse_calendar/i18n/mrp_warehouse_calendar.pot b/mrp_warehouse_calendar/i18n/mrp_warehouse_calendar.pot index 705e4c202..2acc45ba3 100644 --- a/mrp_warehouse_calendar/i18n/mrp_warehouse_calendar.pot +++ b/mrp_warehouse_calendar/i18n/mrp_warehouse_calendar.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -15,11 +15,11 @@ msgstr "" #. module: mrp_warehouse_calendar #: model:ir.model,name:mrp_warehouse_calendar.model_mrp_production -msgid "Manufacturing Order" +msgid "Production Order" msgstr "" #. module: mrp_warehouse_calendar -#: model:ir.model,name:mrp_warehouse_calendar.model_procurement_rule -msgid "Procurement Rule" +#: model:ir.model,name:mrp_warehouse_calendar.model_stock_rule +msgid "Stock Rule" msgstr "" diff --git a/mrp_warehouse_calendar/models/__init__.py b/mrp_warehouse_calendar/models/__init__.py index 1847eff88..6379cdc3a 100644 --- a/mrp_warehouse_calendar/models/__init__.py +++ b/mrp_warehouse_calendar/models/__init__.py @@ -1,2 +1,2 @@ from . import mrp_production -from . import procurement_rule +from . import stock_rule diff --git a/mrp_warehouse_calendar/models/mrp_production.py b/mrp_warehouse_calendar/models/mrp_production.py index c82b47e71..46764ee40 100644 --- a/mrp_warehouse_calendar/models/mrp_production.py +++ b/mrp_warehouse_calendar/models/mrp_production.py @@ -1,7 +1,7 @@ # Copyright 2018 Eficent Business and IT Consulting Services, S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import api, fields, models +from odoo import api, models class MrpProduction(models.Model): @@ -9,7 +9,7 @@ class MrpProduction(models.Model): @api.onchange('date_planned_start', 'product_id') def onchange_date_planned(self): - dt_planned = fields.Datetime.from_string(self.date_planned_start) + dt_planned = self.date_planned_start warehouse = self.picking_type_id.warehouse_id if warehouse.calendar_id and self.product_id.produce_delay: date_expected_finished = warehouse.calendar_id.plan_days( @@ -19,7 +19,7 @@ class MrpProduction(models.Model): @api.multi def copy(self, default=None): mo = super(MrpProduction, self).copy(default=default) - dt_planned = fields.Datetime.from_string(mo.date_planned_start) + dt_planned = mo.date_planned_start warehouse = mo.picking_type_id.warehouse_id if warehouse.calendar_id and mo.product_id.produce_delay: date_expected = warehouse.calendar_id.plan_days( diff --git a/mrp_warehouse_calendar/models/procurement_rule.py b/mrp_warehouse_calendar/models/stock_rule.py similarity index 78% rename from mrp_warehouse_calendar/models/procurement_rule.py rename to mrp_warehouse_calendar/models/stock_rule.py index 4911785c0..84a93d8dd 100644 --- a/mrp_warehouse_calendar/models/procurement_rule.py +++ b/mrp_warehouse_calendar/models/stock_rule.py @@ -4,15 +4,15 @@ from odoo import fields, models -class ProcurementRule(models.Model): - _inherit = 'procurement.rule' +class StockRule(models.Model): + _inherit = 'stock.rule' def _get_date_planned(self, product_id, values): - date_planned = super(ProcurementRule, self)._get_date_planned( + date_planned = super(StockRule, self)._get_date_planned( product_id, values) picking_type = self.picking_type_id or \ values['warehouse_id'].manu_type_id - dt_planned = fields.Datetime.from_string(values['date_planned']) + dt_planned = fields.Datetime.to_datetime(values['date_planned']) warehouse = picking_type.warehouse_id if warehouse.calendar_id and product_id.produce_delay: lead_days = values['company_id'].manufacturing_lead + \ diff --git a/mrp_warehouse_calendar/static/description/index.html b/mrp_warehouse_calendar/static/description/index.html index 69e57c852..b3fd8b1cc 100644 --- a/mrp_warehouse_calendar/static/description/index.html +++ b/mrp_warehouse_calendar/static/description/index.html @@ -3,7 +3,7 @@ - + MRP Warehouse Calendar