diff --git a/mrp_warehouse_calendar/README.rst b/mrp_warehouse_calendar/README.rst index 1141fb85e..97a97dff0 100644 --- a/mrp_warehouse_calendar/README.rst +++ b/mrp_warehouse_calendar/README.rst @@ -23,7 +23,7 @@ MRP Warehouse Calendar :target: https://runbot.odoo-community.org/runbot/129/11.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| With this module the manufacturing orders created from procurements consider the calendar assigned to the warehouse of the picking type of the @@ -103,9 +103,9 @@ promote its widespread use. :target: https://github.com/jbeficent :alt: jbeficent -Current `maintainer `_: +Current `maintainer `__: -|maintainer-jbeficent| +|maintainer-jbeficent| This module is part of the `OCA/manufacture `_ project on GitHub. 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..7af2a986c --- /dev/null +++ b/mrp_warehouse_calendar/i18n/de.po @@ -0,0 +1,27 @@ +# 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 +msgid "Manufacturing Order" +msgstr "Fertigungsauftrag" + +#. module: mrp_warehouse_calendar +#: model:ir.model,name:mrp_warehouse_calendar.model_procurement_rule +msgid "Procurement Rule" +msgstr "Beschaffungsregel" 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/tests/test_mrp_warehouse_calendar.py b/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py index 9b858fb03..c57c1c5c2 100644 --- a/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py +++ b/mrp_warehouse_calendar/tests/test_mrp_warehouse_calendar.py @@ -64,10 +64,9 @@ class TestMrpWarehouseCalendar(TransactionCase): 'Test', values) mo = self.env['mrp.production'].search( [('product_id', '=', self.product.id)], limit=1) - date_plan_start = fields.Datetime.from_string( - mo.date_planned_start).date() + date_plan_start = fields.Date.to_date(mo.date_planned_start) # Friday 4th Jan 2097 - friday = fields.Datetime.from_string('2097-01-04 09:00:00').date() + friday = fields.Date.to_date('2097-01-04 09:00:00') self.assertEqual(date_plan_start, friday) @@ -81,7 +80,6 @@ class TestMrpWarehouseCalendar(TransactionCase): }) mo.date_planned_start = '2097-01-04 09:00:00' mo.onchange_date_planned() - date_plan_finished = fields.Datetime.from_string( - mo.date_planned_finished).date() - monday = fields.Datetime.from_string('2097-01-07 09:00:00').date() + date_plan_finished = fields.Date.to_date(mo.date_planned_finished) + monday = fields.Date.to_date('2097-01-07 09:00:00') self.assertEqual(date_plan_finished, monday)