From bb65a6d848aeaaa81c7a0cb5b49294a2a3d73cc3 Mon Sep 17 00:00:00 2001 From: John Walsh Date: Wed, 23 Sep 2015 12:27:50 -0700 Subject: [PATCH 01/20] [ADD] mrp_mto_with_stock - initial commit --- mrp_mto_with_stock/__init__.py | 18 ++++++ mrp_mto_with_stock/__openerp__.py | 47 +++++++++++++++ mrp_mto_with_stock/models/__init__.py | 19 ++++++ mrp_mto_with_stock/models/mrp.py | 86 +++++++++++++++++++++++++++ mrp_mto_with_stock/models/stock.py | 17 ++++++ 5 files changed, 187 insertions(+) create mode 100644 mrp_mto_with_stock/__init__.py create mode 100644 mrp_mto_with_stock/__openerp__.py create mode 100644 mrp_mto_with_stock/models/__init__.py create mode 100644 mrp_mto_with_stock/models/mrp.py create mode 100644 mrp_mto_with_stock/models/stock.py diff --git a/mrp_mto_with_stock/__init__.py b/mrp_mto_with_stock/__init__.py new file mode 100644 index 000000000..d0c2e2f37 --- /dev/null +++ b/mrp_mto_with_stock/__init__.py @@ -0,0 +1,18 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## +import models diff --git a/mrp_mto_with_stock/__openerp__.py b/mrp_mto_with_stock/__openerp__.py new file mode 100644 index 000000000..5e408e726 --- /dev/null +++ b/mrp_mto_with_stock/__openerp__.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## +{ + 'name': "mrp_mto_with_stock", + + 'summary': """ + Fix Manufacturing orders to pull from stock until qty is zero, + and then create a procurement for them""", + + 'description': """ + Long description of module's purpose + """, + + 'author': "John Walsh", + 'website': "http://github.com/michaeljohn32", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml + # for the full list + 'category': 'Hidden/Dependency', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['mrp', 'stock_mts_mto_rule'], + + # always loaded + 'data': [ + ], + # only loaded in demonstration mode + 'demo': [ + ], +} diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py new file mode 100644 index 000000000..e9ebf62ff --- /dev/null +++ b/mrp_mto_with_stock/models/__init__.py @@ -0,0 +1,19 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## +import stock +import mrp diff --git a/mrp_mto_with_stock/models/mrp.py b/mrp_mto_with_stock/models/mrp.py new file mode 100644 index 000000000..cec522e6c --- /dev/null +++ b/mrp_mto_with_stock/models/mrp.py @@ -0,0 +1,86 @@ +# -*- encoding: utf-8 -*- +from openerp import fields, models, api +import pdb +import logging +_logger = logging.getLogger(__name__) + +class mrp_production(models.Model): + _inherit = 'mrp.production' + +# @api.model +# def _make_consume_line_from_data(self, production, product, uom_id, qty, uos_id, uos_qty): +# '''Confirms stock move or put it in waiting if it's linked to another move. +# @returns list of ids''' +# pdb.set_trace() +# # change the qty to make two moves (if needed) +# res = super(mrp_production, self)._make_consume_line_from_data(production, product, uom_id, uos_id, uos_qty) +# return res + @api.one + def action_confirm(self): + '''Confirms stock move or put it in waiting if it's linked to another move. + @returns list of ids''' +# pdb.set_trace() + # change the qty to make two moves (if needed) + res = super(mrp_production, self).action_confirm() + # try to assign moves (and generate procurements!) + self.action_assign() + return res + + @api.one + def action_assign(self): + '''Reserves available products to the production order + but also creates procurements for more items if we + cannot reserve enough (MTO with stock) + @returns list of ids''' + # reserve all that is available + res = super(mrp_production, self).action_assign() + mtos_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + for move in self.move_lines: + if move.state == 'confirmed' and mtos_route.id in move.product_id.route_ids.ids: + #This move is waiting availability + + #create a domain + #TODO: check other possible states confirmed/exception? + domain = [('product_id','=', move.product_id.id),('state','=','running'),('move_dest_id','=',move.id)] + if move.group_id: + domain.append(('group_id','=',move.group_id.id)) + procurement = self.env['procurement.order'].search(domain) + if not procurement: + # we need to create a procurement + qty_to_procure = move.remaining_qty - move.reserved_availability + proc_dict = self._prepare_mto_procurement(move, qty_to_procure) + procurement = self.env['procurement.order'].create(proc_dict) + return res + + def _prepare_mto_procurement(self, move, qty): + '''Prepares a procurement for a MTO move + using similar logic to /stock/stock.py/class stock_move/_prepare_procurement_from_move() + + ''' + origin = ((move.group_id and (move.group_id.name) + ":") or "") + ((move.name and move.name + ":") or "") + ('MTO -> Production') + group_id = move.group_id and move.group_id.id or False + + route_ids = [self.env.ref('stock.route_warehouse0_mto')] + return{ + 'name': move.name + ':' + str(move.id), + 'origin': origin, + 'company_id': move.company_id and move.company_id.id or False, + 'date_planned': move.date, + 'product_id': move.product_id.id, + 'product_qty': qty, + 'product_uom': move.product_uom.id, + 'product_uos_qty': qty, #FIXME: (move.product_uos and move.product_uos_qty) or move.product_uom_qty, + 'product_uos': move.product_uom.id, #FIXME:(move.product_uos and move.product_uos.id) or move.product_uom.id, + 'location_id': move.location_id.id, + 'move_dest_id': move.id, + 'group_id': group_id, + 'route_ids':[(4, x.id) for x in route_ids], + 'warehouse_id': move.warehouse_id.id or (move.picking_type_id and move.picking_type_id.warehouse_id.id or False), + 'priority': move.priority, + } + + + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/mrp_mto_with_stock/models/stock.py b/mrp_mto_with_stock/models/stock.py new file mode 100644 index 000000000..f67c7b522 --- /dev/null +++ b/mrp_mto_with_stock/models/stock.py @@ -0,0 +1,17 @@ +# -*- encoding: utf-8 -*- +from openerp import fields, models, api +import pdb + +class stock_move(models.Model): + _inherit = 'stock.move' + + @api.multi + def action_confirm(self): + '''Confirms stock move or put it in waiting if it's linked to another move. + @returns list of ids''' + res = super(stock_move, self).action_confirm() + return res + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + From f0549dfdbb4a5520786771f09363974985ca4696 Mon Sep 17 00:00:00 2001 From: lreficent Date: Wed, 26 Apr 2017 18:38:39 +0200 Subject: [PATCH 02/20] [9.0][IMP] mrp_mto_with_stock: adapt to OCA and minor fixes. --- mrp_mto_with_stock/README.rst | 70 ++++++++++++++++++++ mrp_mto_with_stock/__init__.py | 24 ++----- mrp_mto_with_stock/__openerp__.py | 61 +++++------------- mrp_mto_with_stock/models/__init__.py | 25 ++----- mrp_mto_with_stock/models/mrp.py | 93 ++++++++++++--------------- mrp_mto_with_stock/models/stock.py | 17 ----- 6 files changed, 138 insertions(+), 152 deletions(-) create mode 100644 mrp_mto_with_stock/README.rst delete mode 100644 mrp_mto_with_stock/models/stock.py diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst new file mode 100644 index 000000000..a065cad4a --- /dev/null +++ b/mrp_mto_with_stock/README.rst @@ -0,0 +1,70 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================== +MRP MTO with Stock +================== + +This module extends the functionality of Manufacturing to support the creation +of procurements when there is no stock available. This allow you to pull from +stock until the quantity on hand is zero, and then create a procurement +for fulfill the MO requirements. + +Configuration +============= + +To configure this module, you need to: + +#. Go to the products you want to follow this behaviour. +#. In the view form got to the tab *Inventory* and check the box for the + route *Make To Order + Make To Stock*. + +Usage +===== + +To use this module, you need to: + +#. Go to *Manufacturing* and create a Manufacturing Order. +#. Click on *Confirm Production*. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/129/9.0 + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* John Walsh +* Lois Rilo + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/mrp_mto_with_stock/__init__.py b/mrp_mto_with_stock/__init__.py index d0c2e2f37..a7129c69a 100644 --- a/mrp_mto_with_stock/__init__.py +++ b/mrp_mto_with_stock/__init__.py @@ -1,18 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## -import models +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2015 John Walsh +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/mrp_mto_with_stock/__openerp__.py b/mrp_mto_with_stock/__openerp__.py index 5e408e726..3235afb03 100644 --- a/mrp_mto_with_stock/__openerp__.py +++ b/mrp_mto_with_stock/__openerp__.py @@ -1,47 +1,18 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2015 John Walsh +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + { - 'name': "mrp_mto_with_stock", - - 'summary': """ - Fix Manufacturing orders to pull from stock until qty is zero, - and then create a procurement for them""", - - 'description': """ - Long description of module's purpose - """, - - 'author': "John Walsh", - 'website': "http://github.com/michaeljohn32", - - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml - # for the full list - 'category': 'Hidden/Dependency', - 'version': '0.1', - - # any module necessary for this one to work correctly - 'depends': ['mrp', 'stock_mts_mto_rule'], - - # always loaded - 'data': [ - ], - # only loaded in demonstration mode - 'demo': [ - ], + "name": "MRP MTO with Stock", + "summary": "Fix Manufacturing orders to pull from stock until qty is " + "zero, and then create a procurement for them.", + "author": "John Walsh, Eficent, Odoo Community Association (OCA)", + "website": "https://odoo-community.org/", + "category": "Manufacturing", + "version": "9.0.1.0.0", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["mrp", "stock_mts_mto_rule"], } diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py index e9ebf62ff..f5102a7f2 100644 --- a/mrp_mto_with_stock/models/__init__.py +++ b/mrp_mto_with_stock/models/__init__.py @@ -1,19 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## -import stock -import mrp +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2015 John Walsh +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import mrp diff --git a/mrp_mto_with_stock/models/mrp.py b/mrp_mto_with_stock/models/mrp.py index cec522e6c..a2d5565b7 100644 --- a/mrp_mto_with_stock/models/mrp.py +++ b/mrp_mto_with_stock/models/mrp.py @@ -1,67 +1,62 @@ -# -*- encoding: utf-8 -*- -from openerp import fields, models, api -import pdb +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2015 John Walsh +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, models import logging _logger = logging.getLogger(__name__) -class mrp_production(models.Model): + +class MrpProduction(models.Model): _inherit = 'mrp.production' -# @api.model -# def _make_consume_line_from_data(self, production, product, uom_id, qty, uos_id, uos_qty): -# '''Confirms stock move or put it in waiting if it's linked to another move. -# @returns list of ids''' -# pdb.set_trace() -# # change the qty to make two moves (if needed) -# res = super(mrp_production, self)._make_consume_line_from_data(production, product, uom_id, uos_id, uos_qty) -# return res @api.one def action_confirm(self): - '''Confirms stock move or put it in waiting if it's linked to another move. - @returns list of ids''' -# pdb.set_trace() + """Confirms stock move or put it in waiting if it's linked to another move. + @returns list of ids""" # change the qty to make two moves (if needed) - res = super(mrp_production, self).action_confirm() + res = super(MrpProduction, self).action_confirm() # try to assign moves (and generate procurements!) self.action_assign() return res @api.one def action_assign(self): - '''Reserves available products to the production order - but also creates procurements for more items if we - cannot reserve enough (MTO with stock) - @returns list of ids''' - # reserve all that is available - res = super(mrp_production, self).action_assign() + """Reserves available products to the production order but also reates + procurements for more items if we cannot reserve enough (MTO with + stock). + @returns list of ids""" + # reserve all that is available (standard behaviour): + res = super(MrpProduction, self).action_assign() + # try to create procurements: mtos_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') for move in self.move_lines: - if move.state == 'confirmed' and mtos_route.id in move.product_id.route_ids.ids: - #This move is waiting availability - - #create a domain - #TODO: check other possible states confirmed/exception? - domain = [('product_id','=', move.product_id.id),('state','=','running'),('move_dest_id','=',move.id)] + if (move.state == 'confirmed' and mtos_route.id in + move.product_id.route_ids.ids): + domain = [('product_id', '=', move.product_id.id), + ('state', '=', 'running'), + ('move_dest_id', '=', move.id)] if move.group_id: - domain.append(('group_id','=',move.group_id.id)) + domain.append(('group_id', '=', move.group_id.id)) procurement = self.env['procurement.order'].search(domain) if not procurement: - # we need to create a procurement - qty_to_procure = move.remaining_qty - move.reserved_availability - proc_dict = self._prepare_mto_procurement(move, qty_to_procure) - procurement = self.env['procurement.order'].create(proc_dict) + qty_to_procure = (move.remaining_qty - + move.reserved_availability) + proc_dict = self._prepare_mto_procurement( + move, qty_to_procure) + self.env['procurement.order'].create(proc_dict) return res - - def _prepare_mto_procurement(self, move, qty): - '''Prepares a procurement for a MTO move - using similar logic to /stock/stock.py/class stock_move/_prepare_procurement_from_move() - - ''' - origin = ((move.group_id and (move.group_id.name) + ":") or "") + ((move.name and move.name + ":") or "") + ('MTO -> Production') - group_id = move.group_id and move.group_id.id or False - route_ids = [self.env.ref('stock.route_warehouse0_mto')] - return{ + def _prepare_mto_procurement(self, move, qty): + """Prepares a procurement for a MTO product.""" + origin = ((move.group_id and move.group_id.name + ":") or "") + \ + ((move.name and move.name + ":") or "") + 'MTO -> Production' + group_id = move.group_id and move.group_id.id or False + route_ids = self.env.ref('stock.route_warehouse0_mto') + warehouse_id = (move.warehouse_id.id or (move.picking_type_id and + move.picking_type_id.warehouse_id.id or False)) + return { 'name': move.name + ':' + str(move.id), 'origin': origin, 'company_id': move.company_id and move.company_id.id or False, @@ -69,18 +64,10 @@ class mrp_production(models.Model): 'product_id': move.product_id.id, 'product_qty': qty, 'product_uom': move.product_uom.id, - 'product_uos_qty': qty, #FIXME: (move.product_uos and move.product_uos_qty) or move.product_uom_qty, - 'product_uos': move.product_uom.id, #FIXME:(move.product_uos and move.product_uos.id) or move.product_uom.id, 'location_id': move.location_id.id, 'move_dest_id': move.id, 'group_id': group_id, - 'route_ids':[(4, x.id) for x in route_ids], - 'warehouse_id': move.warehouse_id.id or (move.picking_type_id and move.picking_type_id.warehouse_id.id or False), + 'route_ids': [(6, 0, route_ids.ids)], + 'warehouse_id': warehouse_id, 'priority': move.priority, } - - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/mrp_mto_with_stock/models/stock.py b/mrp_mto_with_stock/models/stock.py deleted file mode 100644 index f67c7b522..000000000 --- a/mrp_mto_with_stock/models/stock.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- encoding: utf-8 -*- -from openerp import fields, models, api -import pdb - -class stock_move(models.Model): - _inherit = 'stock.move' - - @api.multi - def action_confirm(self): - '''Confirms stock move or put it in waiting if it's linked to another move. - @returns list of ids''' - res = super(stock_move, self).action_confirm() - return res - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - From 14ff10904627a290cf3aa67de6a11bbfc1a84ef1 Mon Sep 17 00:00:00 2001 From: lreficent Date: Wed, 3 May 2017 19:00:33 +0200 Subject: [PATCH 03/20] [9.0][REW] mrp_mto_with_stock: Rework to remove dependency and enhance flexibility --- mrp_mto_with_stock/README.rst | 5 +++-- mrp_mto_with_stock/__openerp__.py | 3 ++- mrp_mto_with_stock/models/__init__.py | 1 + mrp_mto_with_stock/models/mrp.py | 5 ++--- mrp_mto_with_stock/models/product_template.py | 15 ++++++++++++++ .../views/product_template_view.xml | 20 +++++++++++++++++++ 6 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 mrp_mto_with_stock/models/product_template.py create mode 100644 mrp_mto_with_stock/views/product_template_view.xml diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index a065cad4a..fdce71d4b 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -17,8 +17,9 @@ Configuration To configure this module, you need to: #. Go to the products you want to follow this behaviour. -#. In the view form got to the tab *Inventory* and check the box for the - route *Make To Order + Make To Stock*. +#. In the view form go to the tab *Inventory* and set the *Manufacturing + MTO/MTS Locations*. Any other location not specified here will have the + standard behavior. Usage ===== diff --git a/mrp_mto_with_stock/__openerp__.py b/mrp_mto_with_stock/__openerp__.py index 3235afb03..928dbc421 100644 --- a/mrp_mto_with_stock/__openerp__.py +++ b/mrp_mto_with_stock/__openerp__.py @@ -14,5 +14,6 @@ "license": "AGPL-3", "application": False, "installable": True, - "depends": ["mrp", "stock_mts_mto_rule"], + "depends": ["mrp"], + "data": ['views/product_template_view.xml'], } diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py index f5102a7f2..709cb97b3 100644 --- a/mrp_mto_with_stock/models/__init__.py +++ b/mrp_mto_with_stock/models/__init__.py @@ -4,3 +4,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import mrp +from . import product_template diff --git a/mrp_mto_with_stock/models/mrp.py b/mrp_mto_with_stock/models/mrp.py index a2d5565b7..87d1c082f 100644 --- a/mrp_mto_with_stock/models/mrp.py +++ b/mrp_mto_with_stock/models/mrp.py @@ -30,10 +30,9 @@ class MrpProduction(models.Model): # reserve all that is available (standard behaviour): res = super(MrpProduction, self).action_assign() # try to create procurements: - mtos_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') for move in self.move_lines: - if (move.state == 'confirmed' and mtos_route.id in - move.product_id.route_ids.ids): + if (move.state == 'confirmed' and move.location_id in + move.product_id.mrp_mts_mto_location_ids): domain = [('product_id', '=', move.product_id.id), ('state', '=', 'running'), ('move_dest_id', '=', move.id)] diff --git a/mrp_mto_with_stock/models/product_template.py b/mrp_mto_with_stock/models/product_template.py new file mode 100644 index 000000000..11099600d --- /dev/null +++ b/mrp_mto_with_stock/models/product_template.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + mrp_mts_mto_location_ids = fields.Many2many( + comodel_name='stock.location', + string='Manufacturing MTO/MTS Locations', + help='These manufacturing locations will create procurements when ' + 'there is no stock availale in the source location.') diff --git a/mrp_mto_with_stock/views/product_template_view.xml b/mrp_mto_with_stock/views/product_template_view.xml new file mode 100644 index 000000000..cbe221f8f --- /dev/null +++ b/mrp_mto_with_stock/views/product_template_view.xml @@ -0,0 +1,20 @@ + + + + + + + product.template.form - mrp_mto_with_stock + extension + product.template + + + + + + + + + From 59b2979424d7c21197da18da5307e11a8370e7ca Mon Sep 17 00:00:00 2001 From: Jordi Ballester Date: Sun, 23 Jul 2017 07:11:58 +0200 Subject: [PATCH 04/20] [IMP] should not auto-confirm the MO. Added test cases --- mrp_mto_with_stock/README.rst | 2 +- mrp_mto_with_stock/models/__init__.py | 2 +- .../models/{mrp.py => mrp_production.py} | 13 +- mrp_mto_with_stock/tests/__init__.py | 5 + .../tests/test_mrp_mto_with_stock.py | 139 ++++++++++++++++++ 5 files changed, 147 insertions(+), 14 deletions(-) rename mrp_mto_with_stock/models/{mrp.py => mrp_production.py} (85%) create mode 100644 mrp_mto_with_stock/tests/__init__.py create mode 100644 mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index fdce71d4b..4b92df24e 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -9,7 +9,7 @@ MRP MTO with Stock This module extends the functionality of Manufacturing to support the creation of procurements when there is no stock available. This allow you to pull from stock until the quantity on hand is zero, and then create a procurement -for fulfill the MO requirements. +to fulfill the MO requirements. Configuration ============= diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py index 709cb97b3..c4a684fa2 100644 --- a/mrp_mto_with_stock/models/__init__.py +++ b/mrp_mto_with_stock/models/__init__.py @@ -3,5 +3,5 @@ # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import mrp +from . import mrp_production from . import product_template diff --git a/mrp_mto_with_stock/models/mrp.py b/mrp_mto_with_stock/models/mrp_production.py similarity index 85% rename from mrp_mto_with_stock/models/mrp.py rename to mrp_mto_with_stock/models/mrp_production.py index 87d1c082f..281fc9ea8 100644 --- a/mrp_mto_with_stock/models/mrp.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -11,19 +11,9 @@ _logger = logging.getLogger(__name__) class MrpProduction(models.Model): _inherit = 'mrp.production' - @api.one - def action_confirm(self): - """Confirms stock move or put it in waiting if it's linked to another move. - @returns list of ids""" - # change the qty to make two moves (if needed) - res = super(MrpProduction, self).action_confirm() - # try to assign moves (and generate procurements!) - self.action_assign() - return res - @api.one def action_assign(self): - """Reserves available products to the production order but also reates + """Reserves available products to the production order but also creates procurements for more items if we cannot reserve enough (MTO with stock). @returns list of ids""" @@ -34,7 +24,6 @@ class MrpProduction(models.Model): if (move.state == 'confirmed' and move.location_id in move.product_id.mrp_mts_mto_location_ids): domain = [('product_id', '=', move.product_id.id), - ('state', '=', 'running'), ('move_dest_id', '=', move.id)] if move.group_id: domain.append(('group_id', '=', move.group_id.id)) diff --git a/mrp_mto_with_stock/tests/__init__.py b/mrp_mto_with_stock/tests/__init__.py new file mode 100644 index 000000000..f8065ee2e --- /dev/null +++ b/mrp_mto_with_stock/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_mrp_mto_with_stock diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py new file mode 100644 index 000000000..464195aa9 --- /dev/null +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp.tests.common import TransactionCase +from openerp import fields + + +class TestMrpMtoWithStock(TransactionCase): + def setUp(self, *args, **kwargs): + super(TestMrpMtoWithStock, self).setUp(*args, **kwargs) + self.production_model = self.env['mrp.production'] + self.bom_model = self.env['mrp.bom'] + self.stock_location_stock = self.env.ref('stock.stock_location_stock') + self.manufacture_route = self.env.ref( + 'mrp.route_warehouse0_manufacture') + self.uom_unit = self.env.ref('product.product_uom_unit') + + self.product_fp = self.env['product.product'].create({ + 'name': 'FP', + 'type': 'product', + 'uom_id': self.uom_unit.id, + 'route_ids': [(4, self.manufacture_route.id)] + }) + self.product_c1 = self.env['product.product'].create({ + 'name': 'C1', + 'type': 'product', + 'uom_id': self.uom_unit.id, + 'route_ids': [(4, self.manufacture_route.id)] + }) + self.product_c2 = self.env['product.product'].create({ + 'name': 'C2', + 'type': 'product', + 'uom_id': self.uom_unit.id, + }) + self._update_product_qty(self.product_c2, + self.stock_location_stock, 10) + + self.bom_fp = self.env['mrp.bom'].create({ + 'product_id': self.product_fp.id, + 'product_tmpl_id': self.product_fp.product_tmpl_id.id, + 'bom_line_ids': ([ + (0, 0, { + 'product_id': self.product_c1.id, + 'product_qty': 1, + 'product_uom': self.uom_unit.id + }), + (0, 0, { + 'product_id': self.product_c2.id, + 'product_qty': 1, + 'product_uom': self.uom_unit.id + }), + ]) + }) + + self.bom_c1 = self.env['mrp.bom'].create({ + 'product_id': self.product_c1.id, + 'product_tmpl_id': self.product_c1.product_tmpl_id.id, + 'bom_line_ids': ([(0, 0, { + 'product_id': self.product_c2.id, + 'product_qty': 1, + 'product_uom': self.uom_unit.id + })]) + }) + self.product_c1.mrp_mts_mto_location_ids = [ + (6, 0, [self.stock_location_stock.id])] + + def _update_product_qty(self, product, location, quantity): + """Update Product quantity.""" + product_qty = self.env['stock.change.product.qty'].create({ + 'location_id': location.id, + 'product_id': product.id, + 'new_quantity': quantity, + }) + product_qty.change_product_qty() + return product_qty + + def create_procurement(self, name, product): + values = { + 'name': name, + 'date_planned': fields.Datetime.now(), + 'product_id': product.id, + 'product_qty': 4.0, + 'product_uom': product.uom_id.id, + 'warehouse_id': self.env.ref('stock.warehouse0').id, + 'location_id': self.stock_location_stock.id, + 'route_ids': [ + (4, self.env.ref('mrp.route_warehouse0_manufacture').id, 0)], + } + return self.env['procurement.order'].create(values) + + def test_manufacture(self): + + procurement_fp = self.create_procurement('TEST/01', self.product_fp) + production_fp = procurement_fp.production_id + self.assertEqual(production_fp.state, 'confirmed') + + production_fp.action_assign() + self.assertEqual(production_fp.state, 'confirmed') + + procurement_c1 = self.env['procurement.order'].search( + [('product_id', '=', self.product_c1.id), + ('move_dest_id', 'in', production_fp.move_lines.ids)], limit=1) + self.assertEquals(len(procurement_c1), 1) + + procurement_c2 = self.env['procurement.order'].search( + [('product_id', '=', self.product_c2.id), + ('move_dest_id', 'in', production_fp.move_lines.ids)], limit=1) + self.assertEquals(len(procurement_c2), 0) + + procurement_c1.run() + production_c1 = procurement_c1.production_id + self.assertEqual(production_c1.state, 'confirmed') + + production_c1.action_assign() + self.assertEqual(production_c1.state, 'ready') + + procurement_c2 = self.env['procurement.order'].search( + [('product_id', '=', self.product_c2.id), + ('move_dest_id', 'in', production_c1.move_lines.ids)], limit=1) + self.assertEquals(len(procurement_c2), 0) + + wizard = self.env['mrp.product.produce'].create({ + 'product_id': self.product_c1.id, + 'product_qty': 1, + }) + self.env['mrp.production'].action_produce( + production_c1.id, 1, 'consume_produce', wizard) + production_c1.refresh() + self.assertEqual(production_fp.state, 'confirmed') + + wizard = self.env['mrp.product.produce'].create({ + 'product_id': self.product_c1.id, + 'product_qty': 3, + }) + self.env['mrp.production'].action_produce( + production_c1.id, 3, 'consume_produce', wizard) + production_c1.refresh() + self.assertEqual(production_fp.state, 'ready') From f4e545f095ae3b81f61b7d75f561483910dfe78b Mon Sep 17 00:00:00 2001 From: lreficent Date: Mon, 24 Jul 2017 13:28:36 +0200 Subject: [PATCH 05/20] add contributor email --- mrp_mto_with_stock/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index 4b92df24e..6d17ccada 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -52,7 +52,7 @@ Images Contributors ------------ -* John Walsh +* John Walsh * Lois Rilo Maintainer From ea7b0b9df4f8caa991143c110f862e5669788209 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Thu, 27 Jul 2017 10:46:26 +0200 Subject: [PATCH 06/20] Migrate and improve mrp_to_mto_with_stock to version 10 --- mrp_mto_with_stock/README.rst | 24 +- .../{__openerp__.py => __manifest__.py} | 8 +- mrp_mto_with_stock/demo/product.xml | 128 ++++++++++ mrp_mto_with_stock/models/__init__.py | 1 + mrp_mto_with_stock/models/mrp_production.py | 94 ++++++-- mrp_mto_with_stock/models/product_template.py | 2 +- mrp_mto_with_stock/models/stock_warehouse.py | 16 ++ .../tests/test_mrp_mto_with_stock.py | 219 ++++++++++-------- mrp_mto_with_stock/views/stock_warehouse.xml | 17 ++ 9 files changed, 381 insertions(+), 128 deletions(-) rename mrp_mto_with_stock/{__openerp__.py => __manifest__.py} (78%) create mode 100644 mrp_mto_with_stock/demo/product.xml create mode 100644 mrp_mto_with_stock/models/stock_warehouse.py create mode 100644 mrp_mto_with_stock/views/stock_warehouse.xml diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index 6d17ccada..fa154d0f2 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -7,9 +7,16 @@ MRP MTO with Stock ================== This module extends the functionality of Manufacturing to support the creation -of procurements when there is no stock available. This allow you to pull from -stock until the quantity on hand is zero, and then create a procurement -to fulfill the MO requirements. +of procurements only for a part of the raw material. +It has 2 modes. The default one allow you to pull +from stock until the quantity on hand is zero, and then create a procurement +to fulfill the MO requirements. In this mode, the created procurements must +be the ones fulfilling the MO that has generated it. +The other mode is based on the forecast quantity. It will allow to pull from +stock until the forecast quantity is zero and then create a procurement for +the missing products. In this mode, there is no link between the procurement +created and MO that has generated it. The procurement may be used to fulfill +another MO. Configuration ============= @@ -21,17 +28,23 @@ To configure this module, you need to: MTO/MTS Locations*. Any other location not specified here will have the standard behavior. +If you want to use the second mode, based on forecast quantity +#. Go to the warehouse you want to follow this behaviour. +#. In the view form go to the tab *Warehouse Configuration* and set the + *MRP MTO with forecast stock*. You still need to configure the products + like described in last step. + Usage ===== To use this module, you need to: #. Go to *Manufacturing* and create a Manufacturing Order. -#. Click on *Confirm Production*. +#. Click on *Check availability*. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/129/9.0 + :target: https://runbot.odoo-community.org/runbot/129/10.0 Bug Tracker =========== @@ -54,6 +67,7 @@ Contributors * John Walsh * Lois Rilo +* Florian da Costa Maintainer ---------- diff --git a/mrp_mto_with_stock/__openerp__.py b/mrp_mto_with_stock/__manifest__.py similarity index 78% rename from mrp_mto_with_stock/__openerp__.py rename to mrp_mto_with_stock/__manifest__.py index 928dbc421..ef669a7fb 100644 --- a/mrp_mto_with_stock/__openerp__.py +++ b/mrp_mto_with_stock/__manifest__.py @@ -10,10 +10,14 @@ "author": "John Walsh, Eficent, Odoo Community Association (OCA)", "website": "https://odoo-community.org/", "category": "Manufacturing", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "license": "AGPL-3", "application": False, "installable": True, "depends": ["mrp"], - "data": ['views/product_template_view.xml'], + "data": [ + 'views/product_template_view.xml', + 'views/stock_warehouse.xml', + ], + "demo": ['demo/product.xml'], } diff --git a/mrp_mto_with_stock/demo/product.xml b/mrp_mto_with_stock/demo/product.xml new file mode 100644 index 000000000..4a4d61a8c --- /dev/null +++ b/mrp_mto_with_stock/demo/product.xml @@ -0,0 +1,128 @@ + + + + + + + TOP + + 600.00 + 400.00 + product + + + TODO + MANUF + + + + + Subproduct 1 + + 300.00 + 100.00 + product + + + TODO + MANUF 1-1 + + + + + + Subproduct 2 + + 100.00 + 30.00 + product + + + TODO + MANUF 1-2 + + + + + + Subproduct 1-1 + + 10.00 + 3.00 + product + + + TODO + MANUF 1-1-1 + + + + + Subproduct 2-1 + + 10.00 + 3.00 + product + + + TODO + MANUF 1-2-1 + + + + + + + 10 + + + + + 5 + + 1 + + + + + + 2 + + 1 + + + + + + + 10 + + + + + 2 + + 1 + + + + + + + 10 + + + + + 4 + + 1 + + + + + diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py index c4a684fa2..c617a225f 100644 --- a/mrp_mto_with_stock/models/__init__.py +++ b/mrp_mto_with_stock/models/__init__.py @@ -5,3 +5,4 @@ from . import mrp_production from . import product_template +from . import stock_warehouse diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index 281fc9ea8..dc6a585f5 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -3,7 +3,7 @@ # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import api, models +from odoo import api, models import logging _logger = logging.getLogger(__name__) @@ -11,32 +11,69 @@ _logger = logging.getLogger(__name__) class MrpProduction(models.Model): _inherit = 'mrp.production' - @api.one + @api.multi + def _adjust_procure_method(self): + # Si location => By pass method... + super(MrpProduction, self)._adjust_procure_method() + + @api.multi def action_assign(self): """Reserves available products to the production order but also creates procurements for more items if we cannot reserve enough (MTO with stock). - @returns list of ids""" + @returns True""" # reserve all that is available (standard behaviour): res = super(MrpProduction, self).action_assign() # try to create procurements: - for move in self.move_lines: - if (move.state == 'confirmed' and move.location_id in - move.product_id.mrp_mts_mto_location_ids): - domain = [('product_id', '=', move.product_id.id), - ('move_dest_id', '=', move.id)] - if move.group_id: - domain.append(('group_id', '=', move.group_id.id)) - procurement = self.env['procurement.order'].search(domain) - if not procurement: - qty_to_procure = (move.remaining_qty - - move.reserved_availability) - proc_dict = self._prepare_mto_procurement( - move, qty_to_procure) - self.env['procurement.order'].create(proc_dict) + move_obj = self.env['stock.move'] + for production in self: + warehouse = production.location_src_id.get_warehouse() + mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty + for move in self.move_raw_ids: + if (move.state == 'confirmed' and move.location_id in + move.product_id.mrp_mts_mto_location_ids and not + mto_with_no_move_dest_id): + domain = [('product_id', '=', move.product_id.id), + ('move_dest_id', '=', move.id)] + if move.group_id: + domain.append(('group_id', '=', move.group_id.id)) + procurement = self.env['procurement.order'].search(domain) + if not procurement: + # We have to split the move because we can't have + # a part of the move that have ancestors and not the + # other else it won't ever be reserved. + qty_to_procure = (move.remaining_qty - + move.reserved_availability) + if qty_to_procure < move.product_uom_qty: + move.do_unreserve() + new_move_id = move.split( + qty_to_procure, + restrict_lot_id=move.restrict_lot_id, + restrict_partner_id=move.restrict_partner_id) + new_move = move_obj.browse( + new_move_id) + move.action_assign() + else: + new_move = move + + proc_dict = self._prepare_mto_procurement( + new_move, qty_to_procure, + mto_with_no_move_dest_id) + self.env['procurement.order'].create(proc_dict) + + if (move.state == 'confirmed' and move.location_id in + move.product_id.mrp_mts_mto_location_ids and + move.procure_method == 'make_to_stock' and + mto_with_no_move_dest_id): + qty_to_procure = production.get_mto_qty_to_procure(move) + if qty_to_procure > 0.0: + proc_dict = self._prepare_mto_procurement( + move, qty_to_procure, mto_with_no_move_dest_id) + proc_dict.pop('move_dest_id', None) + self.env['procurement.order'].create(proc_dict) return res - def _prepare_mto_procurement(self, move, qty): + def _prepare_mto_procurement(self, move, qty, mto_with_no_move_dest_id): """Prepares a procurement for a MTO product.""" origin = ((move.group_id and move.group_id.name + ":") or "") + \ ((move.name and move.name + ":") or "") + 'MTO -> Production' @@ -44,7 +81,7 @@ class MrpProduction(models.Model): route_ids = self.env.ref('stock.route_warehouse0_mto') warehouse_id = (move.warehouse_id.id or (move.picking_type_id and move.picking_type_id.warehouse_id.id or False)) - return { + vals = { 'name': move.name + ':' + str(move.id), 'origin': origin, 'company_id': move.company_id and move.company_id.id or False, @@ -53,9 +90,26 @@ class MrpProduction(models.Model): 'product_qty': qty, 'product_uom': move.product_uom.id, 'location_id': move.location_id.id, - 'move_dest_id': move.id, 'group_id': group_id, 'route_ids': [(6, 0, route_ids.ids)], 'warehouse_id': warehouse_id, 'priority': move.priority, } + if not mto_with_no_move_dest_id: + vals['move_dest_id'] = move.id + return vals + + @api.multi + def get_mto_qty_to_procure(self, move): + self.ensure_one() + stock_location_id = move.location_id.id + move_location = move.with_context(location=stock_location_id) + virtual_available = move_location.product_id.virtual_available + qty_available = move.product_id.uom_id._compute_quantity( + virtual_available, move.product_uom) + if qty_available >= 0: + return 0.0 + else: + if abs(qty_available) < move.product_uom_qty: + return abs(qty_available) + return move.product_uom_qty diff --git a/mrp_mto_with_stock/models/product_template.py b/mrp_mto_with_stock/models/product_template.py index 11099600d..a6e1142bf 100644 --- a/mrp_mto_with_stock/models/product_template.py +++ b/mrp_mto_with_stock/models/product_template.py @@ -2,7 +2,7 @@ # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import fields, models +from odoo import fields, models class ProductTemplate(models.Model): diff --git a/mrp_mto_with_stock/models/stock_warehouse.py b/mrp_mto_with_stock/models/stock_warehouse.py new file mode 100644 index 000000000..75d3f30f0 --- /dev/null +++ b/mrp_mto_with_stock/models/stock_warehouse.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockWarehouse(models.Model): + _inherit = 'stock.warehouse' + + mrp_mto_mts_forecast_qty = fields.Boolean( + string="MRP MTO with forecast stock", + help="When you use Mrp_mto_with_stock, the procurement creation is " + "based on reservable stock by default. Check this option if " + "you prefer base it on the forecast stock. In this case, the " + "created procurements won't be linked to the raw material moves") diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py index 464195aa9..c9d844cde 100644 --- a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -2,11 +2,11 @@ # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp.tests.common import TransactionCase -from openerp import fields +from odoo.tests.common import TransactionCase class TestMrpMtoWithStock(TransactionCase): + def setUp(self, *args, **kwargs): super(TestMrpMtoWithStock, self).setUp(*args, **kwargs) self.production_model = self.env['mrp.production'] @@ -15,55 +15,27 @@ class TestMrpMtoWithStock(TransactionCase): self.manufacture_route = self.env.ref( 'mrp.route_warehouse0_manufacture') self.uom_unit = self.env.ref('product.product_uom_unit') + self.warehouse = self.env.ref('stock.warehouse0') - self.product_fp = self.env['product.product'].create({ - 'name': 'FP', - 'type': 'product', - 'uom_id': self.uom_unit.id, - 'route_ids': [(4, self.manufacture_route.id)] - }) - self.product_c1 = self.env['product.product'].create({ - 'name': 'C1', - 'type': 'product', - 'uom_id': self.uom_unit.id, - 'route_ids': [(4, self.manufacture_route.id)] - }) - self.product_c2 = self.env['product.product'].create({ - 'name': 'C2', - 'type': 'product', - 'uom_id': self.uom_unit.id, - }) - self._update_product_qty(self.product_c2, - self.stock_location_stock, 10) + self.top_product = self.env.ref( + 'mrp_mto_with_stock.product_product_manufacture_1') + self.subproduct1 = self.env.ref( + 'mrp_mto_with_stock.product_product_manufacture_1_1') + self.subproduct2 = self.env.ref( + 'mrp_mto_with_stock.product_product_manufacture_1_2') + self.subproduct_1_1 = self.env.ref( + 'mrp_mto_with_stock.product_product_manufacture_1_1_1') - self.bom_fp = self.env['mrp.bom'].create({ - 'product_id': self.product_fp.id, - 'product_tmpl_id': self.product_fp.product_tmpl_id.id, - 'bom_line_ids': ([ - (0, 0, { - 'product_id': self.product_c1.id, - 'product_qty': 1, - 'product_uom': self.uom_unit.id - }), - (0, 0, { - 'product_id': self.product_c2.id, - 'product_qty': 1, - 'product_uom': self.uom_unit.id - }), - ]) - }) + self.main_bom = self.env.ref( + 'mrp_mto_with_stock.mrp_bom_manuf_1') - self.bom_c1 = self.env['mrp.bom'].create({ - 'product_id': self.product_c1.id, - 'product_tmpl_id': self.product_c1.product_tmpl_id.id, - 'bom_line_ids': ([(0, 0, { - 'product_id': self.product_c2.id, - 'product_qty': 1, - 'product_uom': self.uom_unit.id - })]) - }) - self.product_c1.mrp_mts_mto_location_ids = [ - (6, 0, [self.stock_location_stock.id])] + def _get_production_vals(self): + return { + 'product_id': self.top_product.id, + 'product_qty': 1, + 'product_uom_id': self.uom_unit.id, + 'bom_id': self.main_bom.id, + } def _update_product_qty(self, product, location, quantity): """Update Product quantity.""" @@ -75,65 +47,112 @@ class TestMrpMtoWithStock(TransactionCase): product_qty.change_product_qty() return product_qty - def create_procurement(self, name, product): - values = { - 'name': name, - 'date_planned': fields.Datetime.now(), - 'product_id': product.id, - 'product_qty': 4.0, - 'product_uom': product.uom_id.id, - 'warehouse_id': self.env.ref('stock.warehouse0').id, - 'location_id': self.stock_location_stock.id, - 'route_ids': [ - (4, self.env.ref('mrp.route_warehouse0_manufacture').id, 0)], - } - return self.env['procurement.order'].create(values) + def test_manufacture_with_forecast_stock(self): + """ + Test Manufacture mto with stock based on forecast quantity + and no link between sub assemblies MO's and Main MO raw material + """ - def test_manufacture(self): + self.warehouse.mrp_mto_mts_forecast_qty = True - procurement_fp = self.create_procurement('TEST/01', self.product_fp) - production_fp = procurement_fp.production_id - self.assertEqual(production_fp.state, 'confirmed') + self._update_product_qty(self.subproduct1, self.stock_location_stock, + 2) + self._update_product_qty(self.subproduct2, self.stock_location_stock, + 4) - production_fp.action_assign() - self.assertEqual(production_fp.state, 'confirmed') + self.production = self.production_model.create( + self._get_production_vals()) - procurement_c1 = self.env['procurement.order'].search( - [('product_id', '=', self.product_c1.id), - ('move_dest_id', 'in', production_fp.move_lines.ids)], limit=1) - self.assertEquals(len(procurement_c1), 1) + # Create MO and check it create sub assemblie MO. + self.production.action_assign() - procurement_c2 = self.env['procurement.order'].search( - [('product_id', '=', self.product_c2.id), - ('move_dest_id', 'in', production_fp.move_lines.ids)], limit=1) - self.assertEquals(len(procurement_c2), 0) + self.assertEqual(self.production.availability, 'partially_available') - procurement_c1.run() - production_c1 = procurement_c1.production_id - self.assertEqual(production_c1.state, 'confirmed') + self.assertEquals(self.subproduct1.virtual_available, 0) - production_c1.action_assign() - self.assertEqual(production_c1.state, 'ready') + procurement_subproduct1 = self.env['procurement.order'].search( + [('product_id', '=', self.subproduct1.id), + ('group_id', '=', self.production.procurement_group_id.id)]) - procurement_c2 = self.env['procurement.order'].search( - [('product_id', '=', self.product_c2.id), - ('move_dest_id', 'in', production_c1.move_lines.ids)], limit=1) - self.assertEquals(len(procurement_c2), 0) + self.assertEquals(len(procurement_subproduct1), 1) + self.assertEquals(procurement_subproduct1.product_qty, 3) - wizard = self.env['mrp.product.produce'].create({ - 'product_id': self.product_c1.id, - 'product_qty': 1, - }) - self.env['mrp.production'].action_produce( - production_c1.id, 1, 'consume_produce', wizard) - production_c1.refresh() - self.assertEqual(production_fp.state, 'confirmed') + production_sub1 = procurement_subproduct1.production_id + self.assertEqual(production_sub1.state, 'confirmed') + self.assertEqual(production_sub1.product_qty, 3) - wizard = self.env['mrp.product.produce'].create({ - 'product_id': self.product_c1.id, - 'product_qty': 3, - }) - self.env['mrp.production'].action_produce( - production_c1.id, 3, 'consume_produce', wizard) - production_c1.refresh() - self.assertEqual(production_fp.state, 'ready') + self._update_product_qty(self.subproduct1, self.stock_location_stock, + 7) + + # Create second MO and check it does not create procurement + self.production2 = self.production_model.create( + self._get_production_vals()) + self.production2.action_assign() + procurement_subproduct1_2 = self.env['procurement.order'].search( + [('product_id', '=', self.subproduct1.id), + ('group_id', '=', self.production2.procurement_group_id.id)]) + self.assertEquals(len(procurement_subproduct1_2), 0) + self.assertEquals(self.production2.availability, 'assigned') + self.production2.do_unreserve() + + self.assertEquals(self.subproduct1.virtual_available, 0) + + self.production.action_assign() + # We check if first MO is able to assign it self even if it has + # previously generate procurements, it would not be the case in the + # other mode (without mrp_mto_mts_reservable_stock on warehouse) + self.assertEquals(self.production.availability, 'assigned') + + self.assertEquals(self.subproduct1.virtual_available, 0) + + def test_manufacture_with_reservable_stock(self): + """ + Test Manufacture mto with stock based on reservable stock + and there is a link between sub assemblies MO's and Main MO raw + materi al + """ + + self._update_product_qty(self.subproduct1, self.stock_location_stock, + 2) + self._update_product_qty(self.subproduct2, self.stock_location_stock, + 4) + + self.production = self.production_model.create( + self._get_production_vals()) + + self._update_product_qty(self.subproduct_1_1, + self.stock_location_stock, 50) + + # Create MO and check it create sub assemblie MO. + self.production.action_assign() + self.assertEqual(self.production.state, 'confirmed') + + procurement_sub1 = self.env['procurement.order'].search( + [('product_id', '=', self.subproduct1.id), + ('move_dest_id', 'in', self.production.move_raw_ids.ids)]) + self.assertEquals(len(procurement_sub1), 1) + + procurement_sub2 = self.env['procurement.order'].search( + [('product_id', '=', self.subproduct2.id), + ('move_dest_id', 'in', self.production.move_raw_ids.ids)]) + self.assertEquals(len(procurement_sub2), 0) + + production_sub1 = procurement_sub1.production_id + self.assertEqual(production_sub1.product_qty, 3) + production_sub1.action_assign() + self.assertEqual(production_sub1.availability, 'assigned') + + wizard_obj = self.env['mrp.product.produce'] + default_fields = ['lot_id', 'product_id', 'product_uom_id', + 'product_tracking', 'consume_line_ids', + 'production_id', 'product_qty', 'serial'] + wizard_vals = wizard_obj.with_context(active_id=production_sub1.id).\ + default_get(default_fields) + + wizard = wizard_obj.create(wizard_vals) + wizard.do_produce() + self.assertTrue(production_sub1.check_to_done) + self.assertEquals(self.subproduct1.qty_available, 2) + production_sub1.button_mark_done() + self.assertEquals(self.subproduct1.qty_available, 5) + self.assertEqual(self.production.availability, 'assigned') diff --git a/mrp_mto_with_stock/views/stock_warehouse.xml b/mrp_mto_with_stock/views/stock_warehouse.xml new file mode 100644 index 000000000..68a4266ce --- /dev/null +++ b/mrp_mto_with_stock/views/stock_warehouse.xml @@ -0,0 +1,17 @@ + + + + + + + stock.warehouse + + + + + + + + + From 74d75a8b0deab6d29924e37233f3451d4a763c44 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 2 Dec 2017 07:32:13 +0100 Subject: [PATCH 07/20] OCA Transbot updated translations from Transifex --- mrp_mto_with_stock/i18n/ca.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/de.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/es.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/es_MX.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/fi.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/fr.po | 107 +++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/fr_CH.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/hr.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/hr_HR.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/it.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/nl_NL.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/pt_BR.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/ro.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/sl.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/tr_TR.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/vi_VN.po | 106 ++++++++++++++++++++++++++++++ mrp_mto_with_stock/i18n/zh_CN.po | 106 ++++++++++++++++++++++++++++++ 17 files changed, 1803 insertions(+) create mode 100644 mrp_mto_with_stock/i18n/ca.po create mode 100644 mrp_mto_with_stock/i18n/de.po create mode 100644 mrp_mto_with_stock/i18n/es.po create mode 100644 mrp_mto_with_stock/i18n/es_MX.po create mode 100644 mrp_mto_with_stock/i18n/fi.po create mode 100644 mrp_mto_with_stock/i18n/fr.po create mode 100644 mrp_mto_with_stock/i18n/fr_CH.po create mode 100644 mrp_mto_with_stock/i18n/hr.po create mode 100644 mrp_mto_with_stock/i18n/hr_HR.po create mode 100644 mrp_mto_with_stock/i18n/it.po create mode 100644 mrp_mto_with_stock/i18n/nl_NL.po create mode 100644 mrp_mto_with_stock/i18n/pt_BR.po create mode 100644 mrp_mto_with_stock/i18n/ro.po create mode 100644 mrp_mto_with_stock/i18n/sl.po create mode 100644 mrp_mto_with_stock/i18n/tr_TR.po create mode 100644 mrp_mto_with_stock/i18n/vi_VN.po create mode 100644 mrp_mto_with_stock/i18n/zh_CN.po diff --git a/mrp_mto_with_stock/i18n/ca.po b/mrp_mto_with_stock/i18n/ca.po new file mode 100644 index 000000000..dbb97319c --- /dev/null +++ b/mrp_mto_with_stock/i18n/ca.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Plantilla del producte" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po new file mode 100644 index 000000000..47e7213a3 --- /dev/null +++ b/mrp_mto_with_stock/i18n/de.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Fertigungsautrag" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Produktvorlage" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/es.po b/mrp_mto_with_stock/i18n/es.po new file mode 100644 index 000000000..5d71bc8e8 --- /dev/null +++ b/mrp_mto_with_stock/i18n/es.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Órden de producción" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Plantilla de producto" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/es_MX.po b/mrp_mto_with_stock/i18n/es_MX.po new file mode 100644 index 000000000..181d998c1 --- /dev/null +++ b/mrp_mto_with_stock/i18n/es_MX.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/es_MX/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_MX\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Plantilla del producto" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/fi.po b/mrp_mto_with_stock/i18n/fi.po new file mode 100644 index 000000000..900ceadb0 --- /dev/null +++ b/mrp_mto_with_stock/i18n/fi.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Tuotteen malli" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/fr.po b/mrp_mto_with_stock/i18n/fr.po new file mode 100644 index 000000000..759091161 --- /dev/null +++ b/mrp_mto_with_stock/i18n/fr.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# Quentin THEURET , 2017 +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordre de fabrication" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/fr_CH.po b/mrp_mto_with_stock/i18n/fr_CH.po new file mode 100644 index 000000000..3499af4b4 --- /dev/null +++ b/mrp_mto_with_stock/i18n/fr_CH.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/teams/23907/fr_CH/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr_CH\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Template de produit" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/hr.po b/mrp_mto_with_stock/i18n/hr.po new file mode 100644 index 000000000..ed3a5c964 --- /dev/null +++ b/mrp_mto_with_stock/i18n/hr.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Predložak proizvoda" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/hr_HR.po b/mrp_mto_with_stock/i18n/hr_HR.po new file mode 100644 index 000000000..9f915c076 --- /dev/null +++ b/mrp_mto_with_stock/i18n/hr_HR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Proizvodni nalog" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/it.po b/mrp_mto_with_stock/i18n/it.po new file mode 100644 index 000000000..25424a05a --- /dev/null +++ b/mrp_mto_with_stock/i18n/it.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Template prodotto" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/nl_NL.po b/mrp_mto_with_stock/i18n/nl_NL.po new file mode 100644 index 000000000..7a0bc6977 --- /dev/null +++ b/mrp_mto_with_stock/i18n/nl_NL.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Productieorder" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/pt_BR.po b/mrp_mto_with_stock/i18n/pt_BR.po new file mode 100644 index 000000000..986464daf --- /dev/null +++ b/mrp_mto_with_stock/i18n/pt_BR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordem de fabricação" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Produto Modelo" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/ro.po b/mrp_mto_with_stock/i18n/ro.po new file mode 100644 index 000000000..fbe05a73a --- /dev/null +++ b/mrp_mto_with_stock/i18n/ro.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Produs șablon" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/sl.po b/mrp_mto_with_stock/i18n/sl.po new file mode 100644 index 000000000..db6d101f7 --- /dev/null +++ b/mrp_mto_with_stock/i18n/sl.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Predloga proizvoda" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/tr_TR.po b/mrp_mto_with_stock/i18n/tr_TR.po new file mode 100644 index 000000000..98bf044b9 --- /dev/null +++ b/mrp_mto_with_stock/i18n/tr_TR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr_TR\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Ürün şablonu" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/vi_VN.po b/mrp_mto_with_stock/i18n/vi_VN.po new file mode 100644 index 000000000..ca132106b --- /dev/null +++ b/mrp_mto_with_stock/i18n/vi_VN.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/teams/23907/vi_VN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: vi_VN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "Mẫu sản phẩm" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" diff --git a/mrp_mto_with_stock/i18n/zh_CN.po b/mrp_mto_with_stock/i18n/zh_CN.po new file mode 100644 index 000000000..83adac2f3 --- /dev/null +++ b/mrp_mto_with_stock/i18n/zh_CN.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-28 03:44+0000\n" +"PO-Revision-Date: 2017-11-28 03:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "制造订单" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" From ce00f9f80010beade1e5f350e7c3e41135368418 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 27 Jan 2018 08:25:31 +0100 Subject: [PATCH 08/20] OCA Transbot updated translations from Transifex --- mrp_mto_with_stock/i18n/lt.po | 106 ++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 mrp_mto_with_stock/i18n/lt.po diff --git a/mrp_mto_with_stock/i18n/lt.po b/mrp_mto_with_stock/i18n/lt.po new file mode 100644 index 000000000..f062ca7f9 --- /dev/null +++ b/mrp_mto_with_stock/i18n/lt.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +# Translators: +# Viktoras Norkus , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 08:02+0000\n" +"PO-Revision-Date: 2018-01-16 08:02+0000\n" +"Last-Translator: Viktoras Norkus , 2018\n" +"Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: lt\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "Gamybos užsakymas" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "Padaryti" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "" +"These manufacturing locations will create procurements when there is no " +"stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "" +"When you use Mrp_mto_with_stock, the procurement creation is based on " +"reservable stock by default. Check this option if you prefer base it on the " +"forecast stock. In this case, the created procurements won't be linked to " +"the raw material moves" +msgstr "" From 6f61f3c6c0269a6f716d74ae895c007529a4d979 Mon Sep 17 00:00:00 2001 From: Bhavesh Odedra Date: Fri, 16 Feb 2018 22:40:25 +0530 Subject: [PATCH 09/20] [11.0][MIG] mrp_mto_with_stock --- mrp_mto_with_stock/README.rst | 4 +- mrp_mto_with_stock/__init__.py | 3 - mrp_mto_with_stock/__manifest__.py | 5 +- mrp_mto_with_stock/demo/product.xml | 217 +++++++++--------- mrp_mto_with_stock/models/__init__.py | 3 - mrp_mto_with_stock/models/mrp_production.py | 117 +++++----- mrp_mto_with_stock/models/product_template.py | 1 - mrp_mto_with_stock/models/stock_warehouse.py | 1 - .../static/description/icon.png | Bin 0 -> 9455 bytes mrp_mto_with_stock/tests/__init__.py | 2 - .../tests/test_mrp_mto_with_stock.py | 70 +++--- .../views/product_template_view.xml | 2 +- mrp_mto_with_stock/views/stock_warehouse.xml | 2 +- 13 files changed, 203 insertions(+), 224 deletions(-) create mode 100644 mrp_mto_with_stock/static/description/icon.png diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index fa154d0f2..b8606761e 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -29,6 +29,7 @@ To configure this module, you need to: standard behavior. If you want to use the second mode, based on forecast quantity + #. Go to the warehouse you want to follow this behaviour. #. In the view form go to the tab *Warehouse Configuration* and set the *MRP MTO with forecast stock*. You still need to configure the products @@ -44,7 +45,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/129/10.0 + :target: https://runbot.odoo-community.org/runbot/129/11.0 Bug Tracker =========== @@ -68,6 +69,7 @@ Contributors * John Walsh * Lois Rilo * Florian da Costa +* Bhavesh Odedra Maintainer ---------- diff --git a/mrp_mto_with_stock/__init__.py b/mrp_mto_with_stock/__init__.py index a7129c69a..69f7babdf 100644 --- a/mrp_mto_with_stock/__init__.py +++ b/mrp_mto_with_stock/__init__.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. -# Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/mrp_mto_with_stock/__manifest__.py b/mrp_mto_with_stock/__manifest__.py index ef669a7fb..fb12f2dff 100644 --- a/mrp_mto_with_stock/__manifest__.py +++ b/mrp_mto_with_stock/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -10,11 +9,11 @@ "author": "John Walsh, Eficent, Odoo Community Association (OCA)", "website": "https://odoo-community.org/", "category": "Manufacturing", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "license": "AGPL-3", "application": False, "installable": True, - "depends": ["mrp"], + "depends": ["stock", "sale", "purchase", "mrp"], "data": [ 'views/product_template_view.xml', 'views/stock_warehouse.xml', diff --git a/mrp_mto_with_stock/demo/product.xml b/mrp_mto_with_stock/demo/product.xml index 4a4d61a8c..fefb255f2 100644 --- a/mrp_mto_with_stock/demo/product.xml +++ b/mrp_mto_with_stock/demo/product.xml @@ -1,128 +1,123 @@ - + - + + + TOP + + 600.00 + 400.00 + product + + + TODO + MANUF + + - - TOP - - 600.00 - 400.00 - product - - - TODO - MANUF - - + + Subproduct 1 + + 300.00 + 100.00 + product + + + TODO + MANUF 1-1 + + + - - Subproduct 1 - - 300.00 - 100.00 - product - - - TODO - MANUF 1-1 - - - + + Subproduct 2 + + 100.00 + 30.00 + product + + + TODO + MANUF 1-2 + + + - - Subproduct 2 - - 100.00 - 30.00 - product - - - TODO - MANUF 1-2 - - - + + Subproduct 1-1 + + 10.00 + 3.00 + product + + + TODO + MANUF 1-1-1 + - - Subproduct 1-1 - - 10.00 - 3.00 - product - - - TODO - MANUF 1-1-1 - + + Subproduct 2-1 + + 10.00 + 3.00 + product + + + TODO + MANUF 1-2-1 + + + + + 10 + - - Subproduct 2-1 - - 10.00 - 3.00 - product - - - TODO - MANUF 1-2-1 - + + + 5 + + 1 + + + + + 2 + + 1 + + - - - - 10 - + + + + 10 + - - - 5 - - 1 - - + + + 2 + + 1 + + - - - 2 - - 1 - - + + + + 10 + - - - - 10 - - - - - 2 - - 1 - - - - - - - 10 - - - - - 4 - - 1 - - - - - + + + 4 + + 1 + + + diff --git a/mrp_mto_with_stock/models/__init__.py b/mrp_mto_with_stock/models/__init__.py index c617a225f..6a98762c4 100644 --- a/mrp_mto_with_stock/models/__init__.py +++ b/mrp_mto_with_stock/models/__init__.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. -# Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import mrp_production diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index dc6a585f5..313ba4bba 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models +from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) @@ -11,10 +11,9 @@ _logger = logging.getLogger(__name__) class MrpProduction(models.Model): _inherit = 'mrp.production' - @api.multi - def _adjust_procure_method(self): - # Si location => By pass method... - super(MrpProduction, self)._adjust_procure_method() + def _get_procurement_group_data(self, move): + return {'partner_id': move.partner_id.id, + 'name': '{0}:{1}'.format(self.name, move.product_id.name)} @api.multi def action_assign(self): @@ -26,78 +25,76 @@ class MrpProduction(models.Model): res = super(MrpProduction, self).action_assign() # try to create procurements: move_obj = self.env['stock.move'] + procurement_obj = self.env['procurement.group'] for production in self: warehouse = production.location_src_id.get_warehouse() mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty for move in self.move_raw_ids: - if (move.state == 'confirmed' and move.location_id in - move.product_id.mrp_mts_mto_location_ids and not - mto_with_no_move_dest_id): - domain = [('product_id', '=', move.product_id.id), - ('move_dest_id', '=', move.id)] - if move.group_id: - domain.append(('group_id', '=', move.group_id.id)) - procurement = self.env['procurement.order'].search(domain) + group = new_move = procurement = False + qty_to_procure = 0.0 + if move.state in ('partially_available', 'confirmed') \ + and move.location_id in \ + move.product_id.mrp_mts_mto_location_ids \ + and not mto_with_no_move_dest_id: + # Search procurement group which has created from here + group_name = '{0}:{1}'.format( + production.name, move.product_id.name) + procurement = procurement_obj.search( + [('name', '=', group_name)]) if not procurement: # We have to split the move because we can't have # a part of the move that have ancestors and not the # other else it won't ever be reserved. - qty_to_procure = (move.remaining_qty - - move.reserved_availability) + qty_to_procure = ( + move.product_uom_qty - move.reserved_availability) if qty_to_procure < move.product_uom_qty: - move.do_unreserve() - new_move_id = move.split( + move._do_unreserve() + new_move_id = move._split( qty_to_procure, - restrict_lot_id=move.restrict_lot_id, restrict_partner_id=move.restrict_partner_id) - new_move = move_obj.browse( - new_move_id) - move.action_assign() + new_move = move_obj.browse(new_move_id) + move._action_assign() else: new_move = move - - proc_dict = self._prepare_mto_procurement( - new_move, qty_to_procure, - mto_with_no_move_dest_id) - self.env['procurement.order'].create(proc_dict) - - if (move.state == 'confirmed' and move.location_id in - move.product_id.mrp_mts_mto_location_ids and - move.procure_method == 'make_to_stock' and - mto_with_no_move_dest_id): + pg_data = production._get_procurement_group_data( + new_move) + group = procurement_obj.create(pg_data) + if move.state in ('partially_available', 'confirmed') \ + and move.procure_method == 'make_to_stock' \ + and mto_with_no_move_dest_id and \ + move.location_id in \ + move.product_id.mrp_mts_mto_location_ids: qty_to_procure = production.get_mto_qty_to_procure(move) if qty_to_procure > 0.0: - proc_dict = self._prepare_mto_procurement( - move, qty_to_procure, mto_with_no_move_dest_id) - proc_dict.pop('move_dest_id', None) - self.env['procurement.order'].create(proc_dict) + pg_data = production._get_procurement_group_data(move) + group = procurement_obj.create(pg_data) + new_move = move + if group: + production.run_procurement(new_move, group, qty_to_procure) return res - def _prepare_mto_procurement(self, move, qty, mto_with_no_move_dest_id): - """Prepares a procurement for a MTO product.""" - origin = ((move.group_id and move.group_id.name + ":") or "") + \ - ((move.name and move.name + ":") or "") + 'MTO -> Production' - group_id = move.group_id and move.group_id.id or False - route_ids = self.env.ref('stock.route_warehouse0_mto') - warehouse_id = (move.warehouse_id.id or (move.picking_type_id and - move.picking_type_id.warehouse_id.id or False)) - vals = { - 'name': move.name + ':' + str(move.id), - 'origin': origin, - 'company_id': move.company_id and move.company_id.id or False, - 'date_planned': move.date, - 'product_id': move.product_id.id, - 'product_qty': qty, - 'product_uom': move.product_uom.id, - 'location_id': move.location_id.id, - 'group_id': group_id, - 'route_ids': [(6, 0, route_ids.ids)], - 'warehouse_id': warehouse_id, - 'priority': move.priority, - } - if not mto_with_no_move_dest_id: - vals['move_dest_id'] = move.id - return vals + @api.multi + def run_procurement(self, move, group, qty): + self.ensure_one() + errors = [] + values = move._prepare_procurement_values() + origin = ((group and group.name + ":") or "") + 'MTO -> Production' + values['route_ids'] = move.product_id.route_ids + try: + self.env['procurement.group'].run( + move.product_id, + qty, + move.product_uom, + move.location_id, + origin, + origin, + values + ) + except UserError as error: + errors.append(error.name) + if errors: + raise UserError('\n'.join(errors)) + return True @api.multi def get_mto_qty_to_procure(self, move): diff --git a/mrp_mto_with_stock/models/product_template.py b/mrp_mto_with_stock/models/product_template.py index a6e1142bf..6e8624dea 100644 --- a/mrp_mto_with_stock/models/product_template.py +++ b/mrp_mto_with_stock/models/product_template.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/mrp_mto_with_stock/models/stock_warehouse.py b/mrp_mto_with_stock/models/stock_warehouse.py index 75d3f30f0..2e2fe213c 100644 --- a/mrp_mto_with_stock/models/stock_warehouse.py +++ b/mrp_mto_with_stock/models/stock_warehouse.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/mrp_mto_with_stock/static/description/icon.png b/mrp_mto_with_stock/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/mrp_mto_with_stock/tests/__init__.py b/mrp_mto_with_stock/tests/__init__.py index f8065ee2e..575f33c58 100644 --- a/mrp_mto_with_stock/tests/__init__.py +++ b/mrp_mto_with_stock/tests/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_mrp_mto_with_stock diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py index c9d844cde..bbdebd2fe 100644 --- a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -10,6 +9,7 @@ class TestMrpMtoWithStock(TransactionCase): def setUp(self, *args, **kwargs): super(TestMrpMtoWithStock, self).setUp(*args, **kwargs) self.production_model = self.env['mrp.production'] + self.procurement_model = self.env['procurement.group'] self.bom_model = self.env['mrp.bom'] self.stock_location_stock = self.env.ref('stock.stock_location_stock') self.manufacture_route = self.env.ref( @@ -67,20 +67,12 @@ class TestMrpMtoWithStock(TransactionCase): self.production.action_assign() self.assertEqual(self.production.availability, 'partially_available') - self.assertEquals(self.subproduct1.virtual_available, 0) - - procurement_subproduct1 = self.env['procurement.order'].search( - [('product_id', '=', self.subproduct1.id), - ('group_id', '=', self.production.procurement_group_id.id)]) - - self.assertEquals(len(procurement_subproduct1), 1) - self.assertEquals(procurement_subproduct1.product_qty, 3) - - production_sub1 = procurement_subproduct1.production_id + production_sub1 = self.production_model.search( + [('origin', 'ilike', self.production.name)]) self.assertEqual(production_sub1.state, 'confirmed') + self.assertEquals(len(production_sub1), 1) self.assertEqual(production_sub1.product_qty, 3) - self._update_product_qty(self.subproduct1, self.stock_location_stock, 7) @@ -88,20 +80,18 @@ class TestMrpMtoWithStock(TransactionCase): self.production2 = self.production_model.create( self._get_production_vals()) self.production2.action_assign() - procurement_subproduct1_2 = self.env['procurement.order'].search( - [('product_id', '=', self.subproduct1.id), - ('group_id', '=', self.production2.procurement_group_id.id)]) - self.assertEquals(len(procurement_subproduct1_2), 0) + p = self.production_model.search( + [('origin', 'ilike', self.production2.name)]) + self.assertEquals(len(p), 0) self.assertEquals(self.production2.availability, 'assigned') self.production2.do_unreserve() - self.assertEquals(self.subproduct1.virtual_available, 0) self.production.action_assign() # We check if first MO is able to assign it self even if it has # previously generate procurements, it would not be the case in the # other mode (without mrp_mto_mts_reservable_stock on warehouse) - self.assertEquals(self.production.availability, 'assigned') + self.assertEquals(self.production.availability, 'partially_available') self.assertEquals(self.subproduct1.virtual_available, 0) @@ -126,33 +116,39 @@ class TestMrpMtoWithStock(TransactionCase): # Create MO and check it create sub assemblie MO. self.production.action_assign() self.assertEqual(self.production.state, 'confirmed') + mo = self.production_model.search( + [('origin', 'ilike', self.production.name)]) + self.assertEqual(mo.product_qty, 3) - procurement_sub1 = self.env['procurement.order'].search( - [('product_id', '=', self.subproduct1.id), - ('move_dest_id', 'in', self.production.move_raw_ids.ids)]) - self.assertEquals(len(procurement_sub1), 1) + mo.action_assign() + self.assertEqual(mo.availability, 'assigned') + wizard_obj = self.env['mrp.product.produce'] + default_fields = ['lot_id', 'product_id', 'product_uom_id', + 'product_tracking', 'consume_line_ids', + 'production_id', 'product_qty', 'serial'] + wizard_vals = wizard_obj.with_context(active_id=mo.id).\ + default_get(default_fields) + wizard = wizard_obj.create(wizard_vals) + wizard.do_produce() + self.assertEqual(len(mo), 1) + mo.button_mark_done() + self.assertEqual(mo.availability, 'assigned') + self.assertEquals(self.subproduct1.qty_available, 5) - procurement_sub2 = self.env['procurement.order'].search( - [('product_id', '=', self.subproduct2.id), - ('move_dest_id', 'in', self.production.move_raw_ids.ids)]) - self.assertEquals(len(procurement_sub2), 0) - - production_sub1 = procurement_sub1.production_id - self.assertEqual(production_sub1.product_qty, 3) - production_sub1.action_assign() - self.assertEqual(production_sub1.availability, 'assigned') + self.production.action_assign() + self.assertEqual(self.production.state, 'confirmed') wizard_obj = self.env['mrp.product.produce'] default_fields = ['lot_id', 'product_id', 'product_uom_id', 'product_tracking', 'consume_line_ids', 'production_id', 'product_qty', 'serial'] - wizard_vals = wizard_obj.with_context(active_id=production_sub1.id).\ + wizard_vals = wizard_obj.with_context(active_id=self.production.id).\ default_get(default_fields) wizard = wizard_obj.create(wizard_vals) wizard.do_produce() - self.assertTrue(production_sub1.check_to_done) - self.assertEquals(self.subproduct1.qty_available, 2) - production_sub1.button_mark_done() - self.assertEquals(self.subproduct1.qty_available, 5) - self.assertEqual(self.production.availability, 'assigned') + + self.assertTrue(self.production.check_to_done) + self.production.button_mark_done() + self.assertEqual(self.production.state, 'done') + self.assertEquals(self.subproduct2.qty_available, 2) diff --git a/mrp_mto_with_stock/views/product_template_view.xml b/mrp_mto_with_stock/views/product_template_view.xml index cbe221f8f..5eff34d89 100644 --- a/mrp_mto_with_stock/views/product_template_view.xml +++ b/mrp_mto_with_stock/views/product_template_view.xml @@ -1,4 +1,4 @@ - + diff --git a/mrp_mto_with_stock/views/stock_warehouse.xml b/mrp_mto_with_stock/views/stock_warehouse.xml index 68a4266ce..6775e1e80 100644 --- a/mrp_mto_with_stock/views/stock_warehouse.xml +++ b/mrp_mto_with_stock/views/stock_warehouse.xml @@ -1,4 +1,4 @@ - + From 5ab5fe129e1d403c3f75ee286c212f34242c2d85 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Mon, 9 Apr 2018 22:27:20 +0200 Subject: [PATCH 10/20] Fix mto_with_no_move_dest_id option + avoid useless procurement group creation --- mrp_mto_with_stock/models/mrp_production.py | 64 +++++++++---------- .../tests/test_mrp_mto_with_stock.py | 2 +- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index 313ba4bba..118f3ca2a 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -4,6 +4,7 @@ from odoo import api, models from odoo.exceptions import UserError +import copy import logging _logger = logging.getLogger(__name__) @@ -25,60 +26,57 @@ class MrpProduction(models.Model): res = super(MrpProduction, self).action_assign() # try to create procurements: move_obj = self.env['stock.move'] - procurement_obj = self.env['procurement.group'] for production in self: warehouse = production.location_src_id.get_warehouse() mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty - for move in self.move_raw_ids: - group = new_move = procurement = False + move_ids = copy.copy(self.move_raw_ids.ids) + for move in move_obj.browse(move_ids): + new_move = False qty_to_procure = 0.0 if move.state in ('partially_available', 'confirmed') \ and move.location_id in \ move.product_id.mrp_mts_mto_location_ids \ and not mto_with_no_move_dest_id: - # Search procurement group which has created from here - group_name = '{0}:{1}'.format( - production.name, move.product_id.name) - procurement = procurement_obj.search( - [('name', '=', group_name)]) - if not procurement: - # We have to split the move because we can't have - # a part of the move that have ancestors and not the - # other else it won't ever be reserved. - qty_to_procure = ( - move.product_uom_qty - move.reserved_availability) - if qty_to_procure < move.product_uom_qty: - move._do_unreserve() - new_move_id = move._split( - qty_to_procure, - restrict_partner_id=move.restrict_partner_id) - new_move = move_obj.browse(new_move_id) - move._action_assign() - else: - new_move = move - pg_data = production._get_procurement_group_data( - new_move) - group = procurement_obj.create(pg_data) - if move.state in ('partially_available', 'confirmed') \ + # We have to split the move because we can't have + # a part of the move that have ancestors and not the + # other else it won't ever be reserved. + qty_to_procure = ( + move.product_uom_qty - move.reserved_availability) + if qty_to_procure < move.product_uom_qty: + move._do_unreserve() + new_move_id = move._split( + qty_to_procure, + restrict_partner_id=move.restrict_partner_id) + new_move = move_obj.browse(new_move_id) + move._action_assign() + else: + new_move = move + elif move.state in ('partially_available', 'confirmed') \ and move.procure_method == 'make_to_stock' \ and mto_with_no_move_dest_id and \ move.location_id in \ move.product_id.mrp_mts_mto_location_ids: qty_to_procure = production.get_mto_qty_to_procure(move) if qty_to_procure > 0.0: - pg_data = production._get_procurement_group_data(move) - group = procurement_obj.create(pg_data) new_move = move - if group: - production.run_procurement(new_move, group, qty_to_procure) + else: + continue + if new_move: + production.run_procurement(new_move, qty_to_procure, + mto_with_no_move_dest_id) return res @api.multi - def run_procurement(self, move, group, qty): + def run_procurement(self, move, qty, mto_with_no_move_dest_id): self.ensure_one() errors = [] values = move._prepare_procurement_values() - origin = ((group and group.name + ":") or "") + 'MTO -> Production' + # In that mode, we don't want any link between the raw material move + # And the previous move generated now. + if mto_with_no_move_dest_id: + values.pop('move_dest_ids', None) + origin = '{0}:{1}'.format(self.name, move.product_id.name) + \ + ':MTO -> Production' values['route_ids'] = move.product_id.route_ids try: self.env['procurement.group'].run( diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py index bbdebd2fe..24e3db02b 100644 --- a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -91,7 +91,7 @@ class TestMrpMtoWithStock(TransactionCase): # We check if first MO is able to assign it self even if it has # previously generate procurements, it would not be the case in the # other mode (without mrp_mto_mts_reservable_stock on warehouse) - self.assertEquals(self.production.availability, 'partially_available') + self.assertEquals(self.production.availability, 'assigned') self.assertEquals(self.subproduct1.virtual_available, 0) From 6c6cd45c868692ad52dfa4d5db314e0cd6d24e47 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Tue, 29 May 2018 14:25:46 +0200 Subject: [PATCH 11/20] [11.0][REW] mrp_mto_with_stock: * logic for reservable stock moved to _adjust_procure_method. * hook for mto_with_stock condition. * fix bug with unit_factor and add tests for it. * update module dependencies. * move configuration field to operations group. * propagate origin if existing MO. --- mrp_mto_with_stock/__manifest__.py | 8 +- mrp_mto_with_stock/models/mrp_production.py | 84 ++++++++++++------- .../tests/test_mrp_mto_with_stock.py | 19 +++-- .../views/product_template_view.xml | 4 +- 4 files changed, 77 insertions(+), 38 deletions(-) diff --git a/mrp_mto_with_stock/__manifest__.py b/mrp_mto_with_stock/__manifest__.py index fb12f2dff..23cb051fc 100644 --- a/mrp_mto_with_stock/__manifest__.py +++ b/mrp_mto_with_stock/__manifest__.py @@ -9,11 +9,15 @@ "author": "John Walsh, Eficent, Odoo Community Association (OCA)", "website": "https://odoo-community.org/", "category": "Manufacturing", - "version": "11.0.1.0.0", + "version": "11.0.2.0.0", "license": "AGPL-3", "application": False, "installable": True, - "depends": ["stock", "sale", "purchase", "mrp"], + "depends": [ + "stock", + "mrp", + "stock_available_unreserved", + ], "data": [ 'views/product_template_view.xml', 'views/stock_warehouse.xml', diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index 118f3ca2a..73ad9012b 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -1,20 +1,19 @@ -# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017-18 Eficent Business and IT Consulting Services S.L. # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models from odoo.exceptions import UserError import copy -import logging -_logger = logging.getLogger(__name__) class MrpProduction(models.Model): _inherit = 'mrp.production' - def _get_procurement_group_data(self, move): - return {'partner_id': move.partner_id.id, - 'name': '{0}:{1}'.format(self.name, move.product_id.name)} + def _mto_with_stock_condition(self, move): + """Extensibility-enhancer method for modifying the scenarios when + MTO/MTS method should apply.""" + return move.location_id in move.product_id.mrp_mts_mto_location_ids @api.multi def action_assign(self): @@ -34,28 +33,9 @@ class MrpProduction(models.Model): new_move = False qty_to_procure = 0.0 if move.state in ('partially_available', 'confirmed') \ - and move.location_id in \ - move.product_id.mrp_mts_mto_location_ids \ - and not mto_with_no_move_dest_id: - # We have to split the move because we can't have - # a part of the move that have ancestors and not the - # other else it won't ever be reserved. - qty_to_procure = ( - move.product_uom_qty - move.reserved_availability) - if qty_to_procure < move.product_uom_qty: - move._do_unreserve() - new_move_id = move._split( - qty_to_procure, - restrict_partner_id=move.restrict_partner_id) - new_move = move_obj.browse(new_move_id) - move._action_assign() - else: - new_move = move - elif move.state in ('partially_available', 'confirmed') \ and move.procure_method == 'make_to_stock' \ and mto_with_no_move_dest_id and \ - move.location_id in \ - move.product_id.mrp_mts_mto_location_ids: + self._mto_with_stock_condition(move): qty_to_procure = production.get_mto_qty_to_procure(move) if qty_to_procure > 0.0: new_move = move @@ -66,6 +46,55 @@ class MrpProduction(models.Model): mto_with_no_move_dest_id) return res + @api.multi + def _adjust_procure_method(self): + """When configured as MTO/MTS manufacturing location, if there is + stock available unreserved, use it and procure the remaining.""" + res = super()._adjust_procure_method() + warehouse = self.location_src_id.get_warehouse() + mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty + for move in self.move_raw_ids: + if not self._mto_with_stock_condition(move): + continue + new_move = False + qty_to_procure = 0.0 + if not mto_with_no_move_dest_id: + # We have to split the move because we can't have + # a part of the move that have ancestors and not the + # other else it won't ever be reserved. + qty_to_procure = min( + move.product_uom_qty - + move.product_id.qty_available_not_res, + move.product_uom_qty) + if 0.0 < qty_to_procure < move.product_uom_qty: + # we need to adjust the unit_factor of the stock moves + # to split correctly the load of each one. + ratio = qty_to_procure / move.product_uom_qty + new_move = move.copy({ + 'product_uom_qty': qty_to_procure, + 'procure_method': 'make_to_order', + 'unit_factor': move.unit_factor * ratio, + }) + move.write({ + 'product_uom_qty': + move.product_uom_qty - qty_to_procure, + 'unit_factor': move.unit_factor * (1 - ratio), + }) + move._action_confirm() + move._action_assign() + elif qty_to_procure > 0.0: + new_move = move + else: + # If we don't need to procure, we reserve the qty + # for this move so it won't be available for others, + # which would generate planning issues. + move._action_confirm() + move._action_assign() + if new_move: + self.run_procurement( + new_move, qty_to_procure, mto_with_no_move_dest_id) + return res + @api.multi def run_procurement(self, move, qty, mto_with_no_move_dest_id): self.ensure_one() @@ -75,8 +104,7 @@ class MrpProduction(models.Model): # And the previous move generated now. if mto_with_no_move_dest_id: values.pop('move_dest_ids', None) - origin = '{0}:{1}'.format(self.name, move.product_id.name) + \ - ':MTO -> Production' + origin = self.origin or move.origin values['route_ids'] = move.product_id.route_ids try: self.env['procurement.group'].run( diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py index 24e3db02b..7a5b3187d 100644 --- a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -106,16 +106,14 @@ class TestMrpMtoWithStock(TransactionCase): 2) self._update_product_qty(self.subproduct2, self.stock_location_stock, 4) - - self.production = self.production_model.create( - self._get_production_vals()) - self._update_product_qty(self.subproduct_1_1, self.stock_location_stock, 50) + self.production = self.production_model.create( + self._get_production_vals()) + self.assertEqual(len(self.production.move_raw_ids), 3) + # Create MO and check it create sub assemblie MO. - self.production.action_assign() - self.assertEqual(self.production.state, 'confirmed') mo = self.production_model.search( [('origin', 'ilike', self.production.name)]) self.assertEqual(mo.product_qty, 3) @@ -147,6 +145,15 @@ class TestMrpMtoWithStock(TransactionCase): wizard = wizard_obj.create(wizard_vals) wizard.do_produce() + # Check that not extra moves were generated and qty's are ok: + self.assertEqual(len(self.production.move_raw_ids), 3) + for move in self.production.move_raw_ids: + if move.product_id == self.subproduct1 and \ + move.procure_method == 'make_to_order': + qty = 3.0 + else: + qty = 2.0 + self.assertEqual(move.quantity_done, qty) self.assertTrue(self.production.check_to_done) self.production.button_mark_done() diff --git a/mrp_mto_with_stock/views/product_template_view.xml b/mrp_mto_with_stock/views/product_template_view.xml index 5eff34d89..99d027ae0 100644 --- a/mrp_mto_with_stock/views/product_template_view.xml +++ b/mrp_mto_with_stock/views/product_template_view.xml @@ -10,10 +10,10 @@ product.template - + - + From 242390d9f3088d83ce4e0561380085d3669f3d0c Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 19 Jun 2018 12:13:41 +0000 Subject: [PATCH 12/20] [UPD] Update mrp_mto_with_stock.pot --- mrp_mto_with_stock/i18n/ca.po | 4 +- mrp_mto_with_stock/i18n/de.po | 4 +- mrp_mto_with_stock/i18n/es.po | 4 +- mrp_mto_with_stock/i18n/es_MX.po | 7 +- mrp_mto_with_stock/i18n/fi.po | 4 +- mrp_mto_with_stock/i18n/fr.po | 4 +- mrp_mto_with_stock/i18n/fr_CH.po | 7 +- mrp_mto_with_stock/i18n/hr.po | 7 +- mrp_mto_with_stock/i18n/hr_HR.po | 10 +- mrp_mto_with_stock/i18n/it.po | 4 +- mrp_mto_with_stock/i18n/lt.po | 7 +- .../i18n/mrp_mto_with_stock.pot | 96 +++++++++++++++++++ mrp_mto_with_stock/i18n/nl_NL.po | 7 +- mrp_mto_with_stock/i18n/pt_BR.po | 7 +- mrp_mto_with_stock/i18n/ro.po | 7 +- mrp_mto_with_stock/i18n/sl.po | 7 +- mrp_mto_with_stock/i18n/tr_TR.po | 7 +- mrp_mto_with_stock/i18n/vi_VN.po | 7 +- mrp_mto_with_stock/i18n/zh_CN.po | 7 +- 19 files changed, 158 insertions(+), 49 deletions(-) create mode 100644 mrp_mto_with_stock/i18n/mrp_mto_with_stock.pot diff --git a/mrp_mto_with_stock/i18n/ca.po b/mrp_mto_with_stock/i18n/ca.po index dbb97319c..787b83a59 100644 --- a/mrp_mto_with_stock/i18n/ca.po +++ b/mrp_mto_with_stock/i18n/ca.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po index 47e7213a3..96500da13 100644 --- a/mrp_mto_with_stock/i18n/de.po +++ b/mrp_mto_with_stock/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/es.po b/mrp_mto_with_stock/i18n/es.po index 5d71bc8e8..e986a5e5a 100644 --- a/mrp_mto_with_stock/i18n/es.po +++ b/mrp_mto_with_stock/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/es_MX.po b/mrp_mto_with_stock/i18n/es_MX.po index 181d998c1..11b525ce3 100644 --- a/mrp_mto_with_stock/i18n/es_MX.po +++ b/mrp_mto_with_stock/i18n/es_MX.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/es_MX/)\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es_MX\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/fi.po b/mrp_mto_with_stock/i18n/fi.po index 900ceadb0..93d03c8b7 100644 --- a/mrp_mto_with_stock/i18n/fi.po +++ b/mrp_mto_with_stock/i18n/fi.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/fr.po b/mrp_mto_with_stock/i18n/fr.po index 759091161..57402938e 100644 --- a/mrp_mto_with_stock/i18n/fr.po +++ b/mrp_mto_with_stock/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # Quentin THEURET , 2017 # OCA Transbot , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/fr_CH.po b/mrp_mto_with_stock/i18n/fr_CH.po index 3499af4b4..d518de4b3 100644 --- a/mrp_mto_with_stock/i18n/fr_CH.po +++ b/mrp_mto_with_stock/i18n/fr_CH.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: French (Switzerland) (https://www.transifex.com/oca/teams/23907/fr_CH/)\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/" +"teams/23907/fr_CH/)\n" +"Language: fr_CH\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr_CH\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/hr.po b/mrp_mto_with_stock/i18n/hr.po index ed3a5c964..3905f1840 100644 --- a/mrp_mto_with_stock/i18n/hr.po +++ b/mrp_mto_with_stock/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty diff --git a/mrp_mto_with_stock/i18n/hr_HR.po b/mrp_mto_with_stock/i18n/hr_HR.po index 9f915c076..f39cfd669 100644 --- a/mrp_mto_with_stock/i18n/hr_HR.po +++ b/mrp_mto_with_stock/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # Bole , 2017 msgid "" @@ -11,12 +11,14 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: Bole , 2017\n" -"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty diff --git a/mrp_mto_with_stock/i18n/it.po b/mrp_mto_with_stock/i18n/it.po index 25424a05a..69ac89263 100644 --- a/mrp_mto_with_stock/i18n/it.po +++ b/mrp_mto_with_stock/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/lt.po b/mrp_mto_with_stock/i18n/lt.po index f062ca7f9..e07fd798a 100644 --- a/mrp_mto_with_stock/i18n/lt.po +++ b/mrp_mto_with_stock/i18n/lt.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # Viktoras Norkus , 2018 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2018-01-16 08:02+0000\n" "Last-Translator: Viktoras Norkus , 2018\n" "Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n" +"Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: lt\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty diff --git a/mrp_mto_with_stock/i18n/mrp_mto_with_stock.pot b/mrp_mto_with_stock/i18n/mrp_mto_with_stock.pot new file mode 100644 index 000000000..8ad377dee --- /dev/null +++ b/mrp_mto_with_stock/i18n/mrp_mto_with_stock.pot @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_mto_with_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "MRP MTO with forecast stock" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "Manufacturing MTO/MTS Locations" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_mrp_production +msgid "Manufacturing Order" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_product_template +msgid "Product Template" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +msgid "Subproduct 1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +msgid "Subproduct 1-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +msgid "Subproduct 2" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +msgid "Subproduct 2-1" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_1_1 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2 +#: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1_2_1 +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template +#: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TODO" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 +#: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template +msgid "TOP" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids +#: model:ir.model.fields,help:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids +msgid "These manufacturing locations will create procurements when there is no stock availale in the source location." +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse +msgid "Warehouse" +msgstr "" + +#. module: mrp_mto_with_stock +#: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty +msgid "When you use Mrp_mto_with_stock, the procurement creation is based on reservable stock by default. Check this option if you prefer base it on the forecast stock. In this case, the created procurements won't be linked to the raw material moves" +msgstr "" + diff --git a/mrp_mto_with_stock/i18n/nl_NL.po b/mrp_mto_with_stock/i18n/nl_NL.po index 7a0bc6977..0fcc3f4d7 100644 --- a/mrp_mto_with_stock/i18n/nl_NL.po +++ b/mrp_mto_with_stock/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/pt_BR.po b/mrp_mto_with_stock/i18n/pt_BR.po index 986464daf..d6f0e552e 100644 --- a/mrp_mto_with_stock/i18n/pt_BR.po +++ b/mrp_mto_with_stock/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/ro.po b/mrp_mto_with_stock/i18n/ro.po index fbe05a73a..6fde2dde7 100644 --- a/mrp_mto_with_stock/i18n/ro.po +++ b/mrp_mto_with_stock/i18n/ro.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: ro\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty diff --git a/mrp_mto_with_stock/i18n/sl.po b/mrp_mto_with_stock/i18n/sl.po index db6d101f7..a815f6a0f 100644 --- a/mrp_mto_with_stock/i18n/sl.po +++ b/mrp_mto_with_stock/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty diff --git a/mrp_mto_with_stock/i18n/tr_TR.po b/mrp_mto_with_stock/i18n/tr_TR.po index 98bf044b9..b33a1dca6 100644 --- a/mrp_mto_with_stock/i18n/tr_TR.po +++ b/mrp_mto_with_stock/i18n/tr_TR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr_TR\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/vi_VN.po b/mrp_mto_with_stock/i18n/vi_VN.po index ca132106b..6e15c09db 100644 --- a/mrp_mto_with_stock/i18n/vi_VN.po +++ b/mrp_mto_with_stock/i18n/vi_VN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/teams/23907/vi_VN/)\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: vi_VN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: mrp_mto_with_stock diff --git a/mrp_mto_with_stock/i18n/zh_CN.po b/mrp_mto_with_stock/i18n/zh_CN.po index 83adac2f3..83d72cb28 100644 --- a/mrp_mto_with_stock/i18n/zh_CN.po +++ b/mrp_mto_with_stock/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * mrp_mto_with_stock -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-11-28 03:44+0000\n" "PO-Revision-Date: 2017-11-28 03:44+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: mrp_mto_with_stock From ceda0823060c4e6174a4eceac5274a44e1cc39ac Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Tue, 28 Aug 2018 11:21:29 +0200 Subject: [PATCH 13/20] Take draft PO quantities into account for forecast stock in mrp_mto_with_stock --- mrp_mto_with_stock/models/mrp_production.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index 73ad9012b..c2ae07cf8 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -122,6 +122,13 @@ class MrpProduction(models.Model): raise UserError('\n'.join(errors)) return True + # This method should be overriden in submodule to manage cases where + # we need to add quantities to the forecast quantity. Like draft purchase + # order, purchase request, etc... + @api.model + def _get_incoming_qty_waiting_validation(self, move): + return 0.0 + @api.multi def get_mto_qty_to_procure(self, move): self.ensure_one() @@ -130,6 +137,8 @@ class MrpProduction(models.Model): virtual_available = move_location.product_id.virtual_available qty_available = move.product_id.uom_id._compute_quantity( virtual_available, move.product_uom) + draft_incoming_qty = self._get_incoming_qty_waiting_validation(move) + qty_available += draft_incoming_qty if qty_available >= 0: return 0.0 else: From 1d08857d494c0bfa3ae7e340445d11e458697bca Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Thu, 30 Aug 2018 22:26:38 +0200 Subject: [PATCH 14/20] Fix typo --- mrp_mto_with_stock/models/mrp_production.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index c2ae07cf8..dcbc73d09 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -122,11 +122,13 @@ class MrpProduction(models.Model): raise UserError('\n'.join(errors)) return True - # This method should be overriden in submodule to manage cases where - # we need to add quantities to the forecast quantity. Like draft purchase - # order, purchase request, etc... @api.model def _get_incoming_qty_waiting_validation(self, move): + """ + This method should be overriden in submodule to manage cases where + we need to add quantities to the forecast quantity. Like draft + purchase order, purchase request, etc... + """ return 0.0 @api.multi From 214af60f2ba086efdf101e621361f148595069a0 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Sat, 8 Dec 2018 15:11:53 +0000 Subject: [PATCH 15/20] Translated using Weblate (German) Currently translated at 92.3% (12 of 13 strings) Translation: manufacture-11.0/manufacture-11.0-mrp_mto_with_stock Translate-URL: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-mrp_mto_with_stock/de/ --- mrp_mto_with_stock/i18n/de.po | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po index 96500da13..8656003cc 100644 --- a/mrp_mto_with_stock/i18n/de.po +++ b/mrp_mto_with_stock/i18n/de.po @@ -9,25 +9,26 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-28 03:44+0000\n" -"PO-Revision-Date: 2017-11-28 03:44+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2018-12-09 10:43+0000\n" +"Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\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" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.3\n" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty msgid "MRP MTO with forecast stock" -msgstr "" +msgstr "MRP MTO mit Bestandsvorhersage" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_template_mrp_mts_mto_location_ids msgid "Manufacturing MTO/MTS Locations" -msgstr "" +msgstr "Lagerorte für die Fertigung MTO/MTS" #. module: mrp_mto_with_stock #: model:ir.model,name:mrp_mto_with_stock.model_mrp_production @@ -43,25 +44,25 @@ msgstr "Produktvorlage" #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1 #: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_product_template msgid "Subproduct 1" -msgstr "" +msgstr "Teilprodukt 1" #. module: mrp_mto_with_stock #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_1_1 #: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_1_1_product_template msgid "Subproduct 1-1" -msgstr "" +msgstr "Teilprodukt 1-1" #. module: mrp_mto_with_stock #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2 #: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_product_template msgid "Subproduct 2" -msgstr "" +msgstr "Teilprodukt 2" #. module: mrp_mto_with_stock #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1_2_1 #: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_2_1_product_template msgid "Subproduct 2-1" -msgstr "" +msgstr "Teilprodukt 2-1" #. module: mrp_mto_with_stock #: model:product.product,description:mrp_mto_with_stock.product_product_manufacture_1 @@ -75,7 +76,7 @@ msgstr "" #: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_2_product_template #: model:product.template,description:mrp_mto_with_stock.product_product_manufacture_1_product_template msgid "TODO" -msgstr "" +msgstr "TODO" #. module: mrp_mto_with_stock #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 @@ -90,11 +91,13 @@ msgid "" "These manufacturing locations will create procurements when there is no " "stock availale in the source location." msgstr "" +"Diese Lagerorte für die Fertigung werden Beschaffungen auslösen, wenn kein " +"Bestand im Quelllager vorhanden ist." #. module: mrp_mto_with_stock #: model:ir.model,name:mrp_mto_with_stock.model_stock_warehouse msgid "Warehouse" -msgstr "" +msgstr "Lager" #. module: mrp_mto_with_stock #: model:ir.model.fields,help:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty @@ -104,3 +107,7 @@ msgid "" "forecast stock. In this case, the created procurements won't be linked to " "the raw material moves" msgstr "" +"Wenn Sie Mrp_mto_with-stock verwenden, basiert die ausgelöste Beschaffung " +"standardmäßig auf reservierbaren Bestand. Aktivieren Sie diese Option, wenn " +"es auf Bestandsvorhersagen basieren soll. In diesem Fall werden die " +"ausgelösten Beschaffungen nicht mit Lagerbewegungen des Rohmaterials verlinkt" From 9afc9b299e4251d882eed090f661dad565da95f8 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Sun, 9 Dec 2018 11:09:04 +0000 Subject: [PATCH 16/20] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: manufacture-11.0/manufacture-11.0-mrp_mto_with_stock Translate-URL: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-mrp_mto_with_stock/de/ --- mrp_mto_with_stock/i18n/de.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po index 8656003cc..0c59fee1d 100644 --- a/mrp_mto_with_stock/i18n/de.po +++ b/mrp_mto_with_stock/i18n/de.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-28 03:44+0000\n" -"PO-Revision-Date: 2018-12-09 10:43+0000\n" +"PO-Revision-Date: 2018-12-09 15:51+0000\n" "Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" @@ -82,7 +82,7 @@ msgstr "TODO" #: model:product.product,name:mrp_mto_with_stock.product_product_manufacture_1 #: model:product.template,name:mrp_mto_with_stock.product_product_manufacture_1_product_template msgid "TOP" -msgstr "" +msgstr "Oben" #. module: mrp_mto_with_stock #: model:ir.model.fields,help:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids From 07215a6edf084d2f220507397e815ff0250c0c41 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Sun, 9 Dec 2018 16:12:07 +0000 Subject: [PATCH 17/20] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: manufacture-11.0/manufacture-11.0-mrp_mto_with_stock Translate-URL: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-mrp_mto_with_stock/de/ --- mrp_mto_with_stock/i18n/de.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po index 0c59fee1d..a43e32851 100644 --- a/mrp_mto_with_stock/i18n/de.po +++ b/mrp_mto_with_stock/i18n/de.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-28 03:44+0000\n" -"PO-Revision-Date: 2018-12-09 15:51+0000\n" +"PO-Revision-Date: 2018-12-09 20:50+0000\n" "Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" @@ -33,7 +33,7 @@ msgstr "Lagerorte für die Fertigung MTO/MTS" #. module: mrp_mto_with_stock #: model:ir.model,name:mrp_mto_with_stock.model_mrp_production msgid "Manufacturing Order" -msgstr "Fertigungsautrag" +msgstr "Fertigungsauftrag" #. module: mrp_mto_with_stock #: model:ir.model,name:mrp_mto_with_stock.model_product_template From 51581374d77f3aa7143eacee4e2286029b4f1759 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Wed, 12 Dec 2018 11:11:01 +0000 Subject: [PATCH 18/20] Translated using Weblate (German) Currently translated at 100.0% (13 of 13 strings) Translation: manufacture-11.0/manufacture-11.0-mrp_mto_with_stock Translate-URL: https://translation.odoo-community.org/projects/manufacture-11-0/manufacture-11-0-mrp_mto_with_stock/de/ --- mrp_mto_with_stock/i18n/de.po | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mrp_mto_with_stock/i18n/de.po b/mrp_mto_with_stock/i18n/de.po index a43e32851..c5bdaf471 100644 --- a/mrp_mto_with_stock/i18n/de.po +++ b/mrp_mto_with_stock/i18n/de.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-11-28 03:44+0000\n" -"PO-Revision-Date: 2018-12-09 20:50+0000\n" +"PO-Revision-Date: 2018-12-13 11:58+0000\n" "Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" @@ -22,7 +22,7 @@ msgstr "" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_stock_warehouse_mrp_mto_mts_forecast_qty msgid "MRP MTO with forecast stock" -msgstr "MRP MTO mit Bestandsvorhersage" +msgstr "Fertigung: MTO mit Bestandsvorhersage" #. module: mrp_mto_with_stock #: model:ir.model.fields,field_description:mrp_mto_with_stock.field_product_product_mrp_mts_mto_location_ids @@ -107,7 +107,8 @@ msgid "" "forecast stock. In this case, the created procurements won't be linked to " "the raw material moves" msgstr "" -"Wenn Sie Mrp_mto_with-stock verwenden, basiert die ausgelöste Beschaffung " -"standardmäßig auf reservierbaren Bestand. Aktivieren Sie diese Option, wenn " -"es auf Bestandsvorhersagen basieren soll. In diesem Fall werden die " -"ausgelösten Beschaffungen nicht mit Lagerbewegungen des Rohmaterials verlinkt" +"Wenn Sie \"Fertigung: MTO mit Bestandsvorhersage\" verwenden, basieren die " +"ausgelösten Beschaffungen standardmäßig auf reservierbaren Bestand. " +"Aktivieren Sie diese Option, wenn es auf Bestandsvorhersagen basieren soll. " +"In diesem Fall werden die ausgelösten Beschaffungen nicht mit " +"Lagerbewegungen des Rohmaterials verlinkt" From ef730eb59133c039be5f67c0ae01a2e7db91bb82 Mon Sep 17 00:00:00 2001 From: Isaac Gallart Bochons Date: Mon, 10 Jun 2019 11:42:45 +0200 Subject: [PATCH 19/20] [FIX] mrp_mto_with_stock: Error singleton Loop second haven't production, it has self. --- mrp_mto_with_stock/README.rst | 1 + mrp_mto_with_stock/__manifest__.py | 2 +- mrp_mto_with_stock/models/mrp_production.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index b8606761e..9749931b7 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -70,6 +70,7 @@ Contributors * Lois Rilo * Florian da Costa * Bhavesh Odedra +* Isaac Gallart Maintainer ---------- diff --git a/mrp_mto_with_stock/__manifest__.py b/mrp_mto_with_stock/__manifest__.py index 23cb051fc..f26062533 100644 --- a/mrp_mto_with_stock/__manifest__.py +++ b/mrp_mto_with_stock/__manifest__.py @@ -9,7 +9,7 @@ "author": "John Walsh, Eficent, Odoo Community Association (OCA)", "website": "https://odoo-community.org/", "category": "Manufacturing", - "version": "11.0.2.0.0", + "version": "11.0.2.0.1", "license": "AGPL-3", "application": False, "installable": True, diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index dcbc73d09..6130648da 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -28,7 +28,7 @@ class MrpProduction(models.Model): for production in self: warehouse = production.location_src_id.get_warehouse() mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty - move_ids = copy.copy(self.move_raw_ids.ids) + move_ids = copy.copy(production.move_raw_ids.ids) for move in move_obj.browse(move_ids): new_move = False qty_to_procure = 0.0 From eefce8e5b0e9578f9c11eff40d3b6174a158d6c1 Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Mon, 6 Jan 2020 23:12:16 +0100 Subject: [PATCH 20/20] [MIG] mrp_mto_with_stock: standard migration --- mrp_mto_with_stock/README.rst | 70 ++- mrp_mto_with_stock/__manifest__.py | 4 +- mrp_mto_with_stock/demo/product.xml | 34 +- mrp_mto_with_stock/models/mrp_production.py | 52 +- mrp_mto_with_stock/readme/CONFIGURE.rst | 13 + mrp_mto_with_stock/readme/CONTRIBUTORS.rst | 6 + mrp_mto_with_stock/readme/DESCRIPTION.rst | 11 + mrp_mto_with_stock/readme/USAGE.rst | 4 + .../static/description/index.html | 462 ++++++++++++++++++ .../tests/test_mrp_mto_with_stock.py | 61 +-- mrp_mto_with_stock/views/stock_warehouse.xml | 2 +- .../odoo/addons/mrp_mto_with_stock | 1 + setup/mrp_mto_with_stock/setup.py | 6 + 13 files changed, 619 insertions(+), 107 deletions(-) create mode 100644 mrp_mto_with_stock/readme/CONFIGURE.rst create mode 100644 mrp_mto_with_stock/readme/CONTRIBUTORS.rst create mode 100644 mrp_mto_with_stock/readme/DESCRIPTION.rst create mode 100644 mrp_mto_with_stock/readme/USAGE.rst create mode 100644 mrp_mto_with_stock/static/description/index.html create mode 120000 setup/mrp_mto_with_stock/odoo/addons/mrp_mto_with_stock create mode 100644 setup/mrp_mto_with_stock/setup.py diff --git a/mrp_mto_with_stock/README.rst b/mrp_mto_with_stock/README.rst index 9749931b7..4a1aec0cd 100644 --- a/mrp_mto_with_stock/README.rst +++ b/mrp_mto_with_stock/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ================== MRP MTO with Stock ================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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/12.0/mrp_mto_with_stock + :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_mto_with_stock + :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 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module extends the functionality of Manufacturing to support the creation of procurements only for a part of the raw material. It has 2 modes. The default one allow you to pull @@ -18,6 +37,11 @@ the missing products. In this mode, there is no link between the procurement created and MO that has generated it. The procurement may be used to fulfill another MO. +**Table of contents** + +.. contents:: + :local: + Configuration ============= @@ -31,7 +55,7 @@ To configure this module, you need to: If you want to use the second mode, based on forecast quantity #. Go to the warehouse you want to follow this behaviour. -#. In the view form go to the tab *Warehouse Configuration* and set the +#. In the view form go to the tab *Warehouse Configuration* and set the *MRP MTO with forecast stock*. You still need to configure the products like described in last step. @@ -43,46 +67,48 @@ To use this module, you need to: #. Go to *Manufacturing* and create a Manufacturing Order. #. Click on *Check availability*. -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/129/11.0 - 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 smash it by providing detailed and welcomed feedback. +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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* John Walsh +* Eficent Contributors ------------- +~~~~~~~~~~~~ * John Walsh * Lois Rilo * Florian da Costa * Bhavesh Odedra * Isaac Gallart +* Sergio Corato -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +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_mto_with_stock/__manifest__.py b/mrp_mto_with_stock/__manifest__.py index f26062533..65f21b9fc 100644 --- a/mrp_mto_with_stock/__manifest__.py +++ b/mrp_mto_with_stock/__manifest__.py @@ -1,3 +1,4 @@ +# Copyright 2019 Sergio Corato # Copyright 2017 Eficent Business and IT Consulting Services S.L. # Copyright 2015 John Walsh # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -7,9 +8,10 @@ "summary": "Fix Manufacturing orders to pull from stock until qty is " "zero, and then create a procurement for them.", "author": "John Walsh, Eficent, Odoo Community Association (OCA)", + "maintainer": "sergiocorato", "website": "https://odoo-community.org/", "category": "Manufacturing", - "version": "11.0.2.0.1", + "version": "12.0.1.0.0", "license": "AGPL-3", "application": False, "installable": True, diff --git a/mrp_mto_with_stock/demo/product.xml b/mrp_mto_with_stock/demo/product.xml index fefb255f2..c51e07970 100644 --- a/mrp_mto_with_stock/demo/product.xml +++ b/mrp_mto_with_stock/demo/product.xml @@ -12,8 +12,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 600.00 400.00 product - - + + TODO MANUF @@ -25,8 +25,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 300.00 100.00 product - - + + TODO MANUF 1-1 @@ -39,8 +39,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 100.00 30.00 product - - + + TODO MANUF 1-2 @@ -53,8 +53,8 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 10.00 3.00 product - - + + TODO MANUF 1-1-1 @@ -65,22 +65,22 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 10.00 3.00 product - - + + TODO MANUF 1-2-1 - + 10 5 - + 1 @@ -88,35 +88,35 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). 2 - + 1 - + 10 2 - + 1 - + 10 4 - + 1 diff --git a/mrp_mto_with_stock/models/mrp_production.py b/mrp_mto_with_stock/models/mrp_production.py index 6130648da..1fbe4f70b 100644 --- a/mrp_mto_with_stock/models/mrp_production.py +++ b/mrp_mto_with_stock/models/mrp_production.py @@ -4,6 +4,7 @@ from odoo import api, models from odoo.exceptions import UserError +from odoo.tools import float_compare import copy @@ -25,6 +26,8 @@ class MrpProduction(models.Model): res = super(MrpProduction, self).action_assign() # try to create procurements: move_obj = self.env['stock.move'] + precision = self.env['decimal.precision'].precision_get( + 'Product Unit of Measure') for production in self: warehouse = production.location_src_id.get_warehouse() mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty @@ -37,7 +40,8 @@ class MrpProduction(models.Model): and mto_with_no_move_dest_id and \ self._mto_with_stock_condition(move): qty_to_procure = production.get_mto_qty_to_procure(move) - if qty_to_procure > 0.0: + if float_compare( + qty_to_procure, 0, precision_digits=precision) > 0: new_move = move else: continue @@ -53,11 +57,11 @@ class MrpProduction(models.Model): res = super()._adjust_procure_method() warehouse = self.location_src_id.get_warehouse() mto_with_no_move_dest_id = warehouse.mrp_mto_mts_forecast_qty + precision = self.env['decimal.precision'].precision_get( + 'Product Unit of Measure') for move in self.move_raw_ids: if not self._mto_with_stock_condition(move): continue - new_move = False - qty_to_procure = 0.0 if not mto_with_no_move_dest_id: # We have to split the move because we can't have # a part of the move that have ancestors and not the @@ -66,11 +70,15 @@ class MrpProduction(models.Model): move.product_uom_qty - move.product_id.qty_available_not_res, move.product_uom_qty) - if 0.0 < qty_to_procure < move.product_uom_qty: + if qty_to_procure > 0.0 and float_compare( + qty_to_procure, move.product_uom_qty, + precision_digits=precision + ) < 0: # we need to adjust the unit_factor of the stock moves # to split correctly the load of each one. ratio = qty_to_procure / move.product_uom_qty - new_move = move.copy({ + # create new move for make to order part + move.copy({ 'product_uom_qty': qty_to_procure, 'procure_method': 'make_to_order', 'unit_factor': move.unit_factor * ratio, @@ -80,19 +88,8 @@ class MrpProduction(models.Model): move.product_uom_qty - qty_to_procure, 'unit_factor': move.unit_factor * (1 - ratio), }) - move._action_confirm() - move._action_assign() - elif qty_to_procure > 0.0: - new_move = move - else: - # If we don't need to procure, we reserve the qty - # for this move so it won't be available for others, - # which would generate planning issues. - move._action_confirm() - move._action_assign() - if new_move: - self.run_procurement( - new_move, qty_to_procure, mto_with_no_move_dest_id) + move._action_confirm() + move._action_assign() return res @api.multi @@ -122,28 +119,21 @@ class MrpProduction(models.Model): raise UserError('\n'.join(errors)) return True - @api.model - def _get_incoming_qty_waiting_validation(self, move): - """ - This method should be overriden in submodule to manage cases where - we need to add quantities to the forecast quantity. Like draft - purchase order, purchase request, etc... - """ - return 0.0 - @api.multi def get_mto_qty_to_procure(self, move): self.ensure_one() + precision = self.env['decimal.precision'].precision_get( + 'Product Unit of Measure') stock_location_id = move.location_id.id move_location = move.with_context(location=stock_location_id) virtual_available = move_location.product_id.virtual_available qty_available = move.product_id.uom_id._compute_quantity( virtual_available, move.product_uom) - draft_incoming_qty = self._get_incoming_qty_waiting_validation(move) - qty_available += draft_incoming_qty - if qty_available >= 0: + if float_compare(qty_available, 0, precision_digits=precision) >= 0: return 0.0 else: - if abs(qty_available) < move.product_uom_qty: + if float_compare( + abs(qty_available), move.product_uom_qty, + precision_digits=precision) < 0: return abs(qty_available) return move.product_uom_qty diff --git a/mrp_mto_with_stock/readme/CONFIGURE.rst b/mrp_mto_with_stock/readme/CONFIGURE.rst new file mode 100644 index 000000000..2d20ead18 --- /dev/null +++ b/mrp_mto_with_stock/readme/CONFIGURE.rst @@ -0,0 +1,13 @@ +To configure this module, you need to: + +#. Go to the products you want to follow this behaviour. +#. In the view form go to the tab *Inventory* and set the *Manufacturing + MTO/MTS Locations*. Any other location not specified here will have the + standard behavior. + +If you want to use the second mode, based on forecast quantity + +#. Go to the warehouse you want to follow this behaviour. +#. In the view form go to the tab *Warehouse Configuration* and set the + *MRP MTO with forecast stock*. You still need to configure the products + like described in last step. diff --git a/mrp_mto_with_stock/readme/CONTRIBUTORS.rst b/mrp_mto_with_stock/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..0b1c351fa --- /dev/null +++ b/mrp_mto_with_stock/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* John Walsh +* Lois Rilo +* Florian da Costa +* Bhavesh Odedra +* Isaac Gallart +* Sergio Corato diff --git a/mrp_mto_with_stock/readme/DESCRIPTION.rst b/mrp_mto_with_stock/readme/DESCRIPTION.rst new file mode 100644 index 000000000..7d515ac7c --- /dev/null +++ b/mrp_mto_with_stock/readme/DESCRIPTION.rst @@ -0,0 +1,11 @@ +This module extends the functionality of Manufacturing to support the creation +of procurements only for a part of the raw material. +It has 2 modes. The default one allow you to pull +from stock until the quantity on hand is zero, and then create a procurement +to fulfill the MO requirements. In this mode, the created procurements must +be the ones fulfilling the MO that has generated it. +The other mode is based on the forecast quantity. It will allow to pull from +stock until the forecast quantity is zero and then create a procurement for +the missing products. In this mode, there is no link between the procurement +created and MO that has generated it. The procurement may be used to fulfill +another MO. \ No newline at end of file diff --git a/mrp_mto_with_stock/readme/USAGE.rst b/mrp_mto_with_stock/readme/USAGE.rst new file mode 100644 index 000000000..bdd99773f --- /dev/null +++ b/mrp_mto_with_stock/readme/USAGE.rst @@ -0,0 +1,4 @@ +To use this module, you need to: + +#. Go to *Manufacturing* and create a Manufacturing Order. +#. Click on *Check availability*. diff --git a/mrp_mto_with_stock/static/description/index.html b/mrp_mto_with_stock/static/description/index.html new file mode 100644 index 000000000..cece78a11 --- /dev/null +++ b/mrp_mto_with_stock/static/description/index.html @@ -0,0 +1,462 @@ + + + + + + +MRP MTO with Stock + + + +
+

MRP MTO with Stock

+ + +

Beta License: AGPL-3 OCA/manufacture Translate me on Weblate Try me on Runbot

+

This module extends the functionality of Manufacturing to support the creation +of procurements only for a part of the raw material. +It has 2 modes. The default one allow you to pull +from stock until the quantity on hand is zero, and then create a procurement +to fulfill the MO requirements. In this mode, the created procurements must +be the ones fulfilling the MO that has generated it. +The other mode is based on the forecast quantity. It will allow to pull from +stock until the forecast quantity is zero and then create a procurement for +the missing products. In this mode, there is no link between the procurement +created and MO that has generated it. The procurement may be used to fulfill +another MO.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to the products you want to follow this behaviour.
  2. +
  3. In the view form go to the tab Inventory and set the Manufacturing +MTO/MTS Locations. Any other location not specified here will have the +standard behavior.
  4. +
+

If you want to use the second mode, based on forecast quantity

+
    +
  1. Go to the warehouse you want to follow this behaviour.
  2. +
  3. In the view form go to the tab Warehouse Configuration and set the +MRP MTO with forecast stock. You still need to configure the products +like described in last step.
  4. +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Manufacturing and create a Manufacturing Order.
  2. +
  3. Click on Check availability.
  4. +
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • John Walsh
  • +
  • Eficent
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/manufacture project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py index 7a5b3187d..1bb12b233 100644 --- a/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py +++ b/mrp_mto_with_stock/tests/test_mrp_mto_with_stock.py @@ -14,7 +14,7 @@ class TestMrpMtoWithStock(TransactionCase): self.stock_location_stock = self.env.ref('stock.stock_location_stock') self.manufacture_route = self.env.ref( 'mrp.route_warehouse0_manufacture') - self.uom_unit = self.env.ref('product.product_uom_unit') + self.uom_unit = self.env.ref('uom.product_uom_unit') self.warehouse = self.env.ref('stock.warehouse0') self.top_product = self.env.ref( @@ -55,10 +55,8 @@ class TestMrpMtoWithStock(TransactionCase): self.warehouse.mrp_mto_mts_forecast_qty = True - self._update_product_qty(self.subproduct1, self.stock_location_stock, - 2) - self._update_product_qty(self.subproduct2, self.stock_location_stock, - 4) + self._update_product_qty(self.subproduct1, self.stock_location_stock, 2) + self._update_product_qty(self.subproduct2, self.stock_location_stock, 4) self.production = self.production_model.create( self._get_production_vals()) @@ -73,8 +71,7 @@ class TestMrpMtoWithStock(TransactionCase): self.assertEqual(production_sub1.state, 'confirmed') self.assertEquals(len(production_sub1), 1) self.assertEqual(production_sub1.product_qty, 3) - self._update_product_qty(self.subproduct1, self.stock_location_stock, - 7) + self._update_product_qty(self.subproduct1, self.stock_location_stock, 7) # Create second MO and check it does not create procurement self.production2 = self.production_model.create( @@ -99,35 +96,30 @@ class TestMrpMtoWithStock(TransactionCase): """ Test Manufacture mto with stock based on reservable stock and there is a link between sub assemblies MO's and Main MO raw - materi al + material """ - self._update_product_qty(self.subproduct1, self.stock_location_stock, - 2) - self._update_product_qty(self.subproduct2, self.stock_location_stock, - 4) - self._update_product_qty(self.subproduct_1_1, - self.stock_location_stock, 50) + self._update_product_qty(self.subproduct1, self.stock_location_stock, 2) + self._update_product_qty(self.subproduct2, self.stock_location_stock, 4) + self._update_product_qty(self.subproduct_1_1, self.stock_location_stock, 50) - self.production = self.production_model.create( - self._get_production_vals()) + self.production = self.production_model.create(self._get_production_vals()) self.assertEqual(len(self.production.move_raw_ids), 3) # Create MO and check it create sub assemblie MO. - mo = self.production_model.search( - [('origin', 'ilike', self.production.name)]) + mo = self.production_model.search([('origin', 'ilike', self.production.name)]) self.assertEqual(mo.product_qty, 3) mo.action_assign() self.assertEqual(mo.availability, 'assigned') - wizard_obj = self.env['mrp.product.produce'] - default_fields = ['lot_id', 'product_id', 'product_uom_id', - 'product_tracking', 'consume_line_ids', - 'production_id', 'product_qty', 'serial'] - wizard_vals = wizard_obj.with_context(active_id=mo.id).\ - default_get(default_fields) - wizard = wizard_obj.create(wizard_vals) - wizard.do_produce() + produce_wizard = self.env['mrp.product.produce'].with_context({ + 'active_id': mo.id, + 'active_ids': [mo.id] + }).create({ + 'product_qty': mo.product_qty + }) + produce_wizard._onchange_product_qty() + produce_wizard.do_produce() self.assertEqual(len(mo), 1) mo.button_mark_done() self.assertEqual(mo.availability, 'assigned') @@ -136,15 +128,14 @@ class TestMrpMtoWithStock(TransactionCase): self.production.action_assign() self.assertEqual(self.production.state, 'confirmed') - wizard_obj = self.env['mrp.product.produce'] - default_fields = ['lot_id', 'product_id', 'product_uom_id', - 'product_tracking', 'consume_line_ids', - 'production_id', 'product_qty', 'serial'] - wizard_vals = wizard_obj.with_context(active_id=self.production.id).\ - default_get(default_fields) - - wizard = wizard_obj.create(wizard_vals) - wizard.do_produce() + produce_wizard = self.env['mrp.product.produce'].with_context({ + 'active_id': self.production.id, + 'active_ids': [self.production.id] + }).create({ + 'product_qty': self.production.product_qty + }) + produce_wizard._onchange_product_qty() + produce_wizard.do_produce() # Check that not extra moves were generated and qty's are ok: self.assertEqual(len(self.production.move_raw_ids), 3) for move in self.production.move_raw_ids: diff --git a/mrp_mto_with_stock/views/stock_warehouse.xml b/mrp_mto_with_stock/views/stock_warehouse.xml index 6775e1e80..a00edc05a 100644 --- a/mrp_mto_with_stock/views/stock_warehouse.xml +++ b/mrp_mto_with_stock/views/stock_warehouse.xml @@ -6,7 +6,7 @@ stock.warehouse - + diff --git a/setup/mrp_mto_with_stock/odoo/addons/mrp_mto_with_stock b/setup/mrp_mto_with_stock/odoo/addons/mrp_mto_with_stock new file mode 120000 index 000000000..f10c8de86 --- /dev/null +++ b/setup/mrp_mto_with_stock/odoo/addons/mrp_mto_with_stock @@ -0,0 +1 @@ +../../../../mrp_mto_with_stock \ No newline at end of file diff --git a/setup/mrp_mto_with_stock/setup.py b/setup/mrp_mto_with_stock/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/mrp_mto_with_stock/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)