From 80c92af79291b7f3b42fb92bdd8f4a8ae9260109 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Wed, 29 Apr 2015 17:36:21 +0200 Subject: [PATCH 01/36] refactore creating a new route, a new procurement action and separate procurement rules to handle the mts+mto scenario --- stock_mts_mto_rule/README.rst | 62 +++++++++ stock_mts_mto_rule/__init__.py | 1 + stock_mts_mto_rule/__openerp__.py | 38 ++++++ stock_mts_mto_rule/data/stock_data.xml | 17 +++ stock_mts_mto_rule/model/__init__.py | 5 + stock_mts_mto_rule/model/procurement.py | 91 +++++++++++++ stock_mts_mto_rule/model/rule.py | 37 ++++++ stock_mts_mto_rule/model/warehouse.py | 166 ++++++++++++++++++++++++ stock_mts_mto_rule/view/pull_rule.xml | 21 +++ stock_mts_mto_rule/view/warehouse.xml | 17 +++ 10 files changed, 455 insertions(+) create mode 100644 stock_mts_mto_rule/README.rst create mode 100644 stock_mts_mto_rule/__init__.py create mode 100644 stock_mts_mto_rule/__openerp__.py create mode 100644 stock_mts_mto_rule/data/stock_data.xml create mode 100644 stock_mts_mto_rule/model/__init__.py create mode 100644 stock_mts_mto_rule/model/procurement.py create mode 100644 stock_mts_mto_rule/model/rule.py create mode 100644 stock_mts_mto_rule/model/warehouse.py create mode 100644 stock_mts_mto_rule/view/pull_rule.xml create mode 100644 stock_mts_mto_rule/view/warehouse.xml diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst new file mode 100644 index 000000000..a3049f0d8 --- /dev/null +++ b/stock_mts_mto_rule/README.rst @@ -0,0 +1,62 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Stock MTS+MTO Rule +================== + +This module add a Make To Stock + Make to Order Route. + +If you choose the make to stock + make to order rule instead of the make to +order route, the creation of a purchase order will depend on the virtual stock. +There are 3 cases : + +1. The virtual stock of the product is 0 + => It will act exactly like the make to order route. + +2. The virtual stock is equal to the quantity ordered + => It will act exactly like a make to stock route + +3. The virtual stock is more than 0 but less than ordered quantity + => On part of the products will be taken from stock and a purchase order + will be created for the rest. So it will act like both make to order and + make to stock rule. + +Example : +We have a virtual stock of : 1 product A +A sale Order is made for 3 products A. +2 Procurements will be created : + +1. 1 with a make to stock rule and a quantity of 1 + +2. 1 with a make to order rule and a quantity of 2. + +After validation, a purchase order with 2 products will be created. + +Usage +===== + +You have to choose the mts+mto route on the product form. +You should not choose both mts+mto route and mto route. + +Credits +======= + +Contributors +------------ + +* Florian da Costa + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://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 http://odoo-community.org. diff --git a/stock_mts_mto_rule/__init__.py b/stock_mts_mto_rule/__init__.py new file mode 100644 index 000000000..9186ee3ad --- /dev/null +++ b/stock_mts_mto_rule/__init__.py @@ -0,0 +1 @@ +from . import model diff --git a/stock_mts_mto_rule/__openerp__.py b/stock_mts_mto_rule/__openerp__.py new file mode 100644 index 000000000..ea19cac08 --- /dev/null +++ b/stock_mts_mto_rule/__openerp__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2015 Akretion (). +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{'name': 'Stock MTS+MTO Rule', + 'version': '1.0', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'license': 'AGPL-3', + 'category': 'Warehouse', + 'summary': 'Add a MTS+MTO route', + 'depends': ['stock', + ], + 'demo': [], + 'data': ['data/stock_data.xml', + 'view/pull_rule.xml', + 'view/warehouse.xml', + ], + 'installable': True, + } diff --git a/stock_mts_mto_rule/data/stock_data.xml b/stock_mts_mto_rule/data/stock_data.xml new file mode 100644 index 000000000..8297d5a83 --- /dev/null +++ b/stock_mts_mto_rule/data/stock_data.xml @@ -0,0 +1,17 @@ + + + + + + + + Make To Order + Make To Stock + 5 + + + + + + diff --git a/stock_mts_mto_rule/model/__init__.py b/stock_mts_mto_rule/model/__init__.py new file mode 100644 index 000000000..cb1cbd4ab --- /dev/null +++ b/stock_mts_mto_rule/model/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import rule +from . import warehouse +from . import procurement diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py new file mode 100644 index 000000000..b128c6458 --- /dev/null +++ b/stock_mts_mto_rule/model/procurement.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Module for OpenERP +# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved +# @author Florian DA COSTA +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from openerp import models, api + + +class ProcurementOrder(models.Model): + _inherit = 'procurement.order' + + @api.multi + def get_mto_qty_to_order(self): + self.ensure_one() + uom_obj = self.env['product.uom'] + proc_warehouse = self.with_context(warehouse=self.warehouse_id.id) + virtual_available = proc_warehouse.product_id.virtual_available + qty_available = uom_obj._compute_qty(self.product_id.uom_id.id, + virtual_available, + self.product_uom.id) + if qty_available > 0: + if qty_available >= self.product_qty: + return 0.0 + else: + return self.product_qty - qty_available + return self.product_qty + + @api.model + def _get_mts_mto_procurement(self, proc, rule, qty, uos_qty): + return { + 'name': rule.name, + 'origin': proc.rule_id.name, + 'product_qty': qty, + 'product_uos_qty': uos_qty, + 'rule_id': rule.id, + } + + @api.model + def _run(self, procurement): + if procurement.rule_id and \ + procurement.rule_id.action == 'split_procurement': + uom_obj = self.env['product.uom'] + needed_qty = procurement.get_mto_qty_to_order() + rule = procurement.rule_id + if needed_qty == 0.0: + mts_vals = self._get_mts_mto_procurement( + procurement, rule.mts_rule_id, procurement.product_qty, + procurement.product_uos_qty) + mts_proc = procurement.copy(mts_vals) + mts_proc.run() + elif needed_qty == procurement.product_qty: + mto_vals = self._get_mts_mto_procurement( + procurement, rule.mto_rule_id, procurement.product_qty, + procurement.product_uos_qty) + mto_proc = procurement.copy(mto_vals) + mto_proc.run() + else: + mts_qty = procurement.product_qty - needed_qty + mts_uos_qty = uom_obj._compute_qty( + procurement.product_uom.id, + mts_qty, + procurement.product_uos.id) + mts_vals = self._get_mts_mto_procurement( + procurement, rule.mts_rule_id, mts_qty, mts_uos_qty) + mts_proc = procurement.copy(mts_vals) + mts_proc.run() + + uos_qty = procurement.product_uos_qty + mto_vals = self._get_mts_mto_procurement( + procurement, rule.mto_rule_id, needed_qty, + uos_qty - mts_uos_qty) + + mto_proc = procurement.copy(mto_vals) + mto_proc.run() + return super(ProcurementOrder, self)._run(procurement) diff --git a/stock_mts_mto_rule/model/rule.py b/stock_mts_mto_rule/model/rule.py new file mode 100644 index 000000000..481ffedce --- /dev/null +++ b/stock_mts_mto_rule/model/rule.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Module for OpenERP +# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved +# @author Florian DA COSTA +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from openerp import models, api, fields +from openerp.tools.translate import _ + + +class ProcurementRule(models.Model): + _inherit = 'procurement.rule' + + mts_rule_id = fields.Many2one('procurement.rule', + string="MTS Rule") + mto_rule_id = fields.Many2one('procurement.rule', + string="MTO Rule") + + @api.model + def _get_action(self): + return [('split_procurement', _('Choose between MTS and MTO'))] + \ + super(ProcurementRule, self)._get_action() diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py new file mode 100644 index 000000000..b2b0b0b74 --- /dev/null +++ b/stock_mts_mto_rule/model/warehouse.py @@ -0,0 +1,166 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Module for OpenERP +# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved +# @author Florian DA COSTA +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from openerp import models, api, fields, exceptions +from openerp.tools.translate import _ + + +class Warehouse(models.Model): + _inherit = 'stock.warehouse' + + mto_mts_management = fields.Boolean( + 'Use MTO+MTS rules') + mts_mto_rule_id = fields.Many2one('procurement.rule', + 'MTO+MTS rule') + + @api.model + def _get_mts_mto_mto_rule(self, warehouse): + return { + 'name': self._format_routename(warehouse, _('MTS+MTO : MTO')), + 'route_id': False, + } + + @api.model + def _get_mts_mto_mts_rule(self, warehouse): + return { + 'name': self._format_routename(warehouse, _('MTS+MTO : MTS')), + 'route_id': False, + 'procure_method': 'make_to_stock', + } + + @api.model + def _get_mts_mto_rule(self, warehouse): + route_model = self.env['stock.location.route'] + try: + mts_mto_route = self.env.ref( + 'stock_mts_mto_rule.route_mto_mts') + except: + mts_mto_route = route_model.search([ + ('name', 'like', 'Make To Order + Make To Stock') + ]) + if not mts_mto_route: + raise exceptions.Warning(_( + 'Can\'t find any generic MTS+MTO route.')) + + return { + 'name': self._format_routename(warehouse, _('MTS+MTO')), + 'route_id': mts_mto_route.id, + 'action': 'split_procurement', + } + + @api.model + def create_mts_mto_rules(self, warehouse): + model_rule = warehouse.mto_pull_id + mts_pull_vals = self._get_mts_mto_mts_rule(warehouse) + mts_pull = model_rule.copy(mts_pull_vals) + mto_pull_vals = self._get_mts_mto_mto_rule(warehouse) + mto_pull_vals['mts_pull_rule_id'] = mts_pull.id + mto_pull = model_rule.copy(mto_pull_vals) + + mts_mto_pull_vals = self._get_mts_mto_rule(warehouse) + mts_mto_pull_vals.update({'mts_rule_id': mts_pull.id, + 'mto_rule_id': mto_pull.id}) + mts_mto_pull = model_rule.copy(mts_mto_pull_vals) + + res = { + 'mts_rule_id': mts_pull.id, + 'mto_rule_id': mto_pull.id, + 'mts_mto_rule_id': mts_mto_pull.id, + } + return res + + @api.multi + def create_routes(self, warehouse): + res = super(Warehouse, self).create_routes(warehouse) + if warehouse.mto_mts_management: + vals = self.create_mts_mto_rules(warehouse) + res['mts_mto_rule_id'] = vals.get('mts_mto_rule_id', False) + return res + + @api.multi + def write(self, vals): + if 'mto_mts_management' in vals: + if vals.get("mto_mts_management"): + for warehouse in self: + if not warehouse.mts_mto_rule_id: + rule_vals = self.create_mts_mto_rules(warehouse) + vals['mts_mto_rule_id'] = rule_vals.get( + 'mts_mto_rule_id', False) + else: + for warehouse in self: + if warehouse.mts_mto_rule_id: + warehouse.mts_mto_rule_id.mts_rule_id.unlink() + warehouse.mts_mto_rule_id.mto_rule_id.unlink() + warehouse.mts_mto_rule_id.unlink() + return super(Warehouse, self).write(vals) + + @api.model + def get_all_routes_for_wh(self, warehouse): + all_routes = super(Warehouse, self).get_all_routes_for_wh(warehouse) + if ( + warehouse.mto_mts_management and + warehouse.mts_mto_mto_rule_id.route_id + ): + all_routes += [warehouse.mts_mto_rule_id.route_id.id] + return all_routes + + @api.model + def _handle_renaming(self, warehouse, name, code): + res = super(Warehouse, self)._handle_renaming(warehouse, name, code) + + if warehouse.mts_mto_rule_id: + warehouse.mts_mto_rule_id.mts_rule_id.name = ( + warehouse.mts_mto_rule_id.mts_rule_id.name.replace( + warehouse.name, name, 1) + ) + warehouse.mts_mto_rule_id.mto_rule_id.name = ( + warehouse.mts_mto_rule_id.mto_rule_id.name.replace( + warehouse.name, name, 1) + ) + warehouse.mts_mto_rule_id.name = ( + warehouse.mts_mto_rule_id.name.replace( + warehouse.name, name, 1) + ) + return res + + @api.multi + def change_route(self, warehouse, new_reception_step=False, + new_delivery_step=False): + res = super(Warehouse, self).change_route( + warehouse, + new_reception_step=new_reception_step, + new_delivery_step=new_delivery_step) + + mts_mto_rule_id = warehouse.mts_mto_rule_id + if new_delivery_step and mts_mto_rule_id: + model_rule = warehouse.mto_pull_id + rule_ids = [ + mts_mto_rule_id.id, + mts_mto_rule_id.mts_rule_id.id, + mts_mto_rule_id.mto_rule_id.id + ] + pull_model = self.env['procurement.rule'] + vals = { + 'location_id': model_rule.location_id.id, + 'location_src_id': model_rule.location_src_id.id, + } + pull_model.write(rule_ids, vals) + return res diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml new file mode 100644 index 000000000..e21a59ff8 --- /dev/null +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -0,0 +1,21 @@ + + + + + procurement.rule.mts.mto + procurement.rule + + + + + + + + + + + diff --git a/stock_mts_mto_rule/view/warehouse.xml b/stock_mts_mto_rule/view/warehouse.xml new file mode 100644 index 000000000..5dc891581 --- /dev/null +++ b/stock_mts_mto_rule/view/warehouse.xml @@ -0,0 +1,17 @@ + + + + + + view_warehouse_inherited + stock.warehouse + + + + + + + + + + From 4d9bf5988dc117459ad6f1450ccbe7f751f523fa Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Tue, 12 May 2015 18:57:17 +0200 Subject: [PATCH 02/36] add test + use standard mts and mto rules --- stock_mts_mto_rule/model/procurement.py | 24 +++- stock_mts_mto_rule/model/warehouse.py | 99 ++++++----------- stock_mts_mto_rule/tests/__init__.py | 2 + .../tests/test_mto_mts_route.py | 104 ++++++++++++++++++ 4 files changed, 163 insertions(+), 66 deletions(-) create mode 100644 stock_mts_mto_rule/tests/__init__.py create mode 100644 stock_mts_mto_rule/tests/test_mto_mts_route.py diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index b128c6458..cb563241f 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -29,7 +29,8 @@ class ProcurementOrder(models.Model): def get_mto_qty_to_order(self): self.ensure_one() uom_obj = self.env['product.uom'] - proc_warehouse = self.with_context(warehouse=self.warehouse_id.id) + stock_location = self.warehouse_id.lot_stock_id.id + proc_warehouse = self.with_context(location=stock_location) virtual_available = proc_warehouse.product_id.virtual_available qty_available = uom_obj._compute_qty(self.product_id.uom_id.id, virtual_available, @@ -43,14 +44,33 @@ class ProcurementOrder(models.Model): @api.model def _get_mts_mto_procurement(self, proc, rule, qty, uos_qty): + origin = (proc.group_id and (proc.group_id.name + ":") or "") + \ + (proc.rule_id and proc.rule_id.name or proc.origin or "/") return { 'name': rule.name, - 'origin': proc.rule_id.name, + 'origin': origin, 'product_qty': qty, 'product_uos_qty': uos_qty, 'rule_id': rule.id, } + @api.model + def _check(self, procurement): + if procurement.rule_id and \ + procurement.rule_id.action == 'split_procurement': + if procurement.state == 'running': + return True + return super(ProcurementOrder, self)._check(procurement) + + @api.multi + def run(self, autocommit=False): + res = super(ProcurementOrder, self).run(autocommit=autocommit) + for proc in self: + if proc.rule_id and \ + proc.rule_id.action == 'split_procurement': + proc.check() + return res + @api.model def _run(self, procurement): if procurement.rule_id and \ diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index b2b0b0b74..6f06ada0f 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -27,28 +27,17 @@ class Warehouse(models.Model): _inherit = 'stock.warehouse' mto_mts_management = fields.Boolean( - 'Use MTO+MTS rules') + 'Use MTO+MTS rules', + help='If this new route is selected on product form view, a ' + 'purchase order will be created only if the virtual stock is ' + 'less than 0 else, the product will be taken from stocks') mts_mto_rule_id = fields.Many2one('procurement.rule', 'MTO+MTS rule') - @api.model - def _get_mts_mto_mto_rule(self, warehouse): - return { - 'name': self._format_routename(warehouse, _('MTS+MTO : MTO')), - 'route_id': False, - } - - @api.model - def _get_mts_mto_mts_rule(self, warehouse): - return { - 'name': self._format_routename(warehouse, _('MTS+MTO : MTS')), - 'route_id': False, - 'procure_method': 'make_to_stock', - } - @api.model def _get_mts_mto_rule(self, warehouse): route_model = self.env['stock.location.route'] + pull_model = self.env['procurement.rule'] try: mts_mto_route = self.env.ref( 'stock_mts_mto_rule.route_mto_mts') @@ -60,55 +49,50 @@ class Warehouse(models.Model): raise exceptions.Warning(_( 'Can\'t find any generic MTS+MTO route.')) + if not warehouse.mto_pull_id: + raise exceptions.Warning(_( + 'Can\'t find MTO Rule on the warehouse')) + + mts_rules = pull_model.search( + [('location_src_id', '=', warehouse.lot_stock_id.id), + ('route_id', '=', warehouse.delivery_route_id.id)]) + if not mts_rules: + raise exceptions.Warning(_( + 'Can\'t find MTS Rule on the warehouse')) return { 'name': self._format_routename(warehouse, _('MTS+MTO')), 'route_id': mts_mto_route.id, 'action': 'split_procurement', + 'mto_rule_id': warehouse.mto_pull_id.id, + 'mts_rule_id': mts_rules[0].id, + 'warehouse_id': warehouse.id, + 'location_id': warehouse.mto_pull_id.location_id.id, + 'picking_type_id': warehouse.mto_pull_id.picking_type_id.id, } - @api.model - def create_mts_mto_rules(self, warehouse): - model_rule = warehouse.mto_pull_id - mts_pull_vals = self._get_mts_mto_mts_rule(warehouse) - mts_pull = model_rule.copy(mts_pull_vals) - mto_pull_vals = self._get_mts_mto_mto_rule(warehouse) - mto_pull_vals['mts_pull_rule_id'] = mts_pull.id - mto_pull = model_rule.copy(mto_pull_vals) - - mts_mto_pull_vals = self._get_mts_mto_rule(warehouse) - mts_mto_pull_vals.update({'mts_rule_id': mts_pull.id, - 'mto_rule_id': mto_pull.id}) - mts_mto_pull = model_rule.copy(mts_mto_pull_vals) - - res = { - 'mts_rule_id': mts_pull.id, - 'mto_rule_id': mto_pull.id, - 'mts_mto_rule_id': mts_mto_pull.id, - } - return res - @api.multi def create_routes(self, warehouse): + pull_model = self.env['procurement.rule'] res = super(Warehouse, self).create_routes(warehouse) if warehouse.mto_mts_management: - vals = self.create_mts_mto_rules(warehouse) - res['mts_mto_rule_id'] = vals.get('mts_mto_rule_id', False) + mts_mto_pull_vals = self._get_mts_mto_rule(warehouse) + mts_mto_pull = pull_model.create(mts_mto_pull_vals) + res['mts_mto_rule_id'] = mts_mto_pull.id return res @api.multi def write(self, vals): + pull_model = self.env['procurement.rule'] if 'mto_mts_management' in vals: if vals.get("mto_mts_management"): for warehouse in self: if not warehouse.mts_mto_rule_id: - rule_vals = self.create_mts_mto_rules(warehouse) - vals['mts_mto_rule_id'] = rule_vals.get( - 'mts_mto_rule_id', False) + rule_vals = self._get_mts_mto_rule(warehouse) + mts_mto_pull = pull_model.create(rule_vals) + vals['mts_mto_rule_id'] = mts_mto_pull.id else: for warehouse in self: if warehouse.mts_mto_rule_id: - warehouse.mts_mto_rule_id.mts_rule_id.unlink() - warehouse.mts_mto_rule_id.mto_rule_id.unlink() warehouse.mts_mto_rule_id.unlink() return super(Warehouse, self).write(vals) @@ -117,7 +101,7 @@ class Warehouse(models.Model): all_routes = super(Warehouse, self).get_all_routes_for_wh(warehouse) if ( warehouse.mto_mts_management and - warehouse.mts_mto_mto_rule_id.route_id + warehouse.mts_mto_rule_id.route_id ): all_routes += [warehouse.mts_mto_rule_id.route_id.id] return all_routes @@ -127,14 +111,6 @@ class Warehouse(models.Model): res = super(Warehouse, self)._handle_renaming(warehouse, name, code) if warehouse.mts_mto_rule_id: - warehouse.mts_mto_rule_id.mts_rule_id.name = ( - warehouse.mts_mto_rule_id.mts_rule_id.name.replace( - warehouse.name, name, 1) - ) - warehouse.mts_mto_rule_id.mto_rule_id.name = ( - warehouse.mts_mto_rule_id.mto_rule_id.name.replace( - warehouse.name, name, 1) - ) warehouse.mts_mto_rule_id.name = ( warehouse.mts_mto_rule_id.name.replace( warehouse.name, name, 1) @@ -151,16 +127,11 @@ class Warehouse(models.Model): mts_mto_rule_id = warehouse.mts_mto_rule_id if new_delivery_step and mts_mto_rule_id: - model_rule = warehouse.mto_pull_id - rule_ids = [ - mts_mto_rule_id.id, - mts_mto_rule_id.mts_rule_id.id, - mts_mto_rule_id.mto_rule_id.id - ] pull_model = self.env['procurement.rule'] - vals = { - 'location_id': model_rule.location_id.id, - 'location_src_id': model_rule.location_src_id.id, - } - pull_model.write(rule_ids, vals) + warehouse.mts_mto_rule_id.location_id = ( + warehouse.mto_pull_id.location_id) + mts_rules = pull_model.search( + [('location_src_id', '=', warehouse.lot_stock_id.id), + ('route_id', '=', warehouse.delivery_route_id.id)]) + warehouse.mts_mto_rule_id.mts_rule_id = mts_rules[0].id return res diff --git a/stock_mts_mto_rule/tests/__init__.py b/stock_mts_mto_rule/tests/__init__.py new file mode 100644 index 000000000..96aebab0d --- /dev/null +++ b/stock_mts_mto_rule/tests/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import test_mto_mts_route diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py new file mode 100644 index 000000000..bc38de754 --- /dev/null +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -0,0 +1,104 @@ +# Author: Florian da Costa +# Copyright 2015 Akretion +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +from openerp.tests.common import TransactionCase +from datetime import datetime + + +class TestMtoMtsRoute(TransactionCase): + + def test_standard_mto_route(self): + mto_route = self.env.ref('stock.route_warehouse0_mto') + self.product.route_ids = [(6, 0, [mto_route.id])] + self.procurement.run() + self.assertEqual(self.warehouse.mto_pull_id, + self.procurement.rule_id) + self.assertEqual('make_to_order', + self.procurement.move_ids[0].procure_method) + self.assertEqual(self.procurement.product_qty, + self.procurement.move_ids[0].product_uom_qty) + self.assertEqual('waiting', + self.procurement.move_ids[0].state) + + def test_standard_mts_route(self): + self.procurement.run() + self.assertEqual('make_to_stock', + self.procurement.move_ids[0].procure_method) + self.assertEqual(self.procurement.product_qty, + self.procurement.move_ids[0].product_uom_qty) + self.assertEqual('confirmed', + self.procurement.move_ids[0].state) + + def test_mts_mto_route_split(self): + mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.quant.qty = 1.0 + self.procurement.run() + moves = self.env['stock.move'].search( + [('group_id', '=', self.group.id)]) + self.assertEqual(2, len(moves)) + self.assertEqual(1.0, moves[0].product_uom_qty) + + def test_mts_mto_route_mts_only(self): + mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.quant.qty = 0.0 + self.procurement.run() + moves = self.env['stock.move'].search( + [('group_id', '=', self.group.id)]) + self.assertEqual(1, len(moves)) + self.assertEqual(2.0, moves[0].product_uom_qty) + self.assertEqual('make_to_order', + moves[0].procure_method) + + def test_mts_mto_route_mto_only(self): + mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.quant.qty = 3.0 + self.procurement.run() + moves = self.env['stock.move'].search( + [('group_id', '=', self.group.id)]) + self.assertEqual(1, len(moves)) + self.assertEqual(2.0, moves[0].product_uom_qty) + self.assertEqual('make_to_stock', + moves[0].procure_method) + + def setUp(self): + super(TestMtoMtsRoute, self).setUp() + self.warehouse = self.env.ref('stock.warehouse0') + self.warehouse.mto_mts_management = True + self.product = self.env.ref('product.product_product_4') + self.company_partner = self.env.ref('base.main_partner') + self.group = self.env['procurement.group'].create({ + 'name': 'test', + }) + self.procurement = self.env['procurement.order'].create({ + 'location_id': self.env.ref('stock.stock_location_customers').id, + 'product_id': self.product.id, + 'product_qty': 2.0, + 'product_uom': 1, + 'warehouse_id': self.warehouse.id, + 'priority': '1', + 'date_planned': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + 'name': self.product.name, + 'origin': 'test', + 'group_id': self.group.id, + }) + self.quant = self.env['stock.quant'].create({ + 'owner_id': self.company_partner.id, + 'location_id': self.env.ref('stock.stock_location_stock').id, + 'product_id': self.product.id, + 'qty': 0.0, + }) From e402bdb6407ac2ee061f7668df4945ed2fb95989 Mon Sep 17 00:00:00 2001 From: Gabriel Davini Date: Wed, 23 Sep 2015 14:14:29 -0300 Subject: [PATCH 03/36] Better readme in stock_mts_mto_rule --- stock_mts_mto_rule/README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index a3049f0d8..8f755b83a 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -38,6 +38,11 @@ Usage You have to choose the mts+mto route on the product form. You should not choose both mts+mto route and mto route. +Configuration +============= + +You have to choose 'Use MTO+MTS rules' on the company's warehouse form. + Credits ======= From 3addd1b98cda8b0b5e6a66cfc65a33a9cb5815fc Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 5 Oct 2015 06:16:20 -0400 Subject: [PATCH 04/36] OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/en.po | 96 ++++++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/fr.po | 97 +++++++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+) create mode 100644 stock_mts_mto_rule/i18n/en.po create mode 100644 stock_mts_mto_rule/i18n/fr.po diff --git a/stock_mts_mto_rule/i18n/en.po b/stock_mts_mto_rule/i18n/en.po new file mode 100644 index 000000000..a2a47da8d --- /dev/null +++ b/stock_mts_mto_rule/i18n/en.po @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-23 20:23+0000\n" +"PO-Revision-Date: 2015-09-15 13:05+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "Can't find MTO Rule on the warehouse" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "Can't find MTS Rule on the warehouse" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "Can't find any generic MTS+MTO route." + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "Choose between MTS and MTO" + +#. module: stock_mts_mto_rule +#: help:stock.warehouse,mto_mts_management:0 +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "If this new route is selected on product form view, a purchase order will be created only if the virtual stock is less than 0 else, the product will be taken from stocks" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mto_rule_id:0 +msgid "MTO Rule" +msgstr "MTO Rule" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mts_mto_rule_id:0 +msgid "MTO+MTS rule" +msgstr "MTO+MTS rule" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mts_rule_id:0 +msgid "MTS Rule" +msgstr "MTS Rule" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#, python-format +msgid "MTS+MTO" +msgstr "MTS+MTO" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "Make To Order + Make To Stock" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Procurement" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Procurement Rule" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mto_mts_management:0 +msgid "Use MTO+MTS rules" +msgstr "Use MTO+MTS rules" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Warehouse" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po new file mode 100644 index 000000000..d9a16e84e --- /dev/null +++ b/stock_mts_mto_rule/i18n/fr.po @@ -0,0 +1,97 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Pierre Verkest , 2015 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-23 20:23+0000\n" +"PO-Revision-Date: 2015-09-27 20:47+0000\n" +"Last-Translator: Pierre Verkest \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "Ne trouve pas la règle MTO (Make To Order: Fabrication à la commande) de l'entrepôt" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "Ne trouve pas la règle MTS (Make To Stock: produit géré en stock) de l'entrepôt" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "Aucune règle par défaut MTS+MTO configurée. " + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To Order: Produit fabriqué à la commande). " + +#. module: stock_mts_mto_rule +#: help:stock.warehouse,mto_mts_management:0 +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "Si cette nouvelle route est sélectionnée sur la vue formulaire du produit, une commande d'achat sera créée seulement si le stock virtuel est inférieur à 0, sinon, le produit sera pris en stock." + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mto_rule_id:0 +msgid "MTO Rule" +msgstr "MTO (Fab. à la demande)" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mts_mto_rule_id:0 +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mts_rule_id:0 +msgid "MTS Rule" +msgstr "MTS: Produit stocké" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mto_mts_management:0 +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Entrepôt" From dd83d52e640b42d4ce8a26d1a319a3987e9230ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 10:03:18 +0200 Subject: [PATCH 05/36] [UPD] prefix versions with 8.0 --- stock_mts_mto_rule/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/__openerp__.py b/stock_mts_mto_rule/__openerp__.py index ea19cac08..e81acfc1d 100644 --- a/stock_mts_mto_rule/__openerp__.py +++ b/stock_mts_mto_rule/__openerp__.py @@ -21,7 +21,7 @@ ############################################################################## {'name': 'Stock MTS+MTO Rule', - 'version': '1.0', + 'version': '8.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'license': 'AGPL-3', From 094233cb6bf31fedd611a412433510d7e2f06b70 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 02:54:54 +0200 Subject: [PATCH 06/36] [MIG] Make modules uninstallable --- stock_mts_mto_rule/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/__openerp__.py b/stock_mts_mto_rule/__openerp__.py index e81acfc1d..bb2d0911a 100644 --- a/stock_mts_mto_rule/__openerp__.py +++ b/stock_mts_mto_rule/__openerp__.py @@ -34,5 +34,5 @@ 'view/pull_rule.xml', 'view/warehouse.xml', ], - 'installable': True, + 'installable': False, } From ceef61fece6081bc1d1659e4f823630fadaa3b5a Mon Sep 17 00:00:00 2001 From: otherjustin Date: Tue, 8 Mar 2016 15:56:45 +0100 Subject: [PATCH 07/36] Update README.rst Add explanation for finding this setting --- stock_mts_mto_rule/README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 8f755b83a..130c57887 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -43,6 +43,8 @@ Configuration You have to choose 'Use MTO+MTS rules' on the company's warehouse form. +Note: In order to see this option, you must enable "Manage advanced routes for your warehouse" under Settings -> Configuration -> Warehouse. + Credits ======= From 30cc869890661a3f6b9c4e5ec6f267ab9817e779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 15 Aug 2016 22:15:34 +0200 Subject: [PATCH 08/36] [FIX] remove en.po that was erroneously created by transbot --- stock_mts_mto_rule/i18n/en.po | 96 ----------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 stock_mts_mto_rule/i18n/en.po diff --git a/stock_mts_mto_rule/i18n/en.po b/stock_mts_mto_rule/i18n/en.po deleted file mode 100644 index a2a47da8d..000000000 --- a/stock_mts_mto_rule/i18n/en.po +++ /dev/null @@ -1,96 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * stock_mts_mto_rule -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 20:23+0000\n" -"PO-Revision-Date: 2015-09-15 13:05+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 -#, python-format -msgid "Can't find MTO Rule on the warehouse" -msgstr "Can't find MTO Rule on the warehouse" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 -#, python-format -msgid "Can't find MTS Rule on the warehouse" -msgstr "Can't find MTS Rule on the warehouse" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "Can't find any generic MTS+MTO route." - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:36 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Choose between MTS and MTO" - -#. module: stock_mts_mto_rule -#: help:stock.warehouse,mto_mts_management:0 -msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" -msgstr "If this new route is selected on product form view, a purchase order will be created only if the virtual stock is less than 0 else, the product will be taken from stocks" - -#. module: stock_mts_mto_rule -#: field:procurement.rule,mto_rule_id:0 -msgid "MTO Rule" -msgstr "MTO Rule" - -#. module: stock_mts_mto_rule -#: field:stock.warehouse,mts_mto_rule_id:0 -msgid "MTO+MTS rule" -msgstr "MTO+MTS rule" - -#. module: stock_mts_mto_rule -#: field:procurement.rule,mts_rule_id:0 -msgid "MTS Rule" -msgstr "MTS Rule" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 -#, python-format -msgid "MTS+MTO" -msgstr "MTS+MTO" - -#. module: stock_mts_mto_rule -#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts -msgid "Make To Order + Make To Stock" -msgstr "Make To Order + Make To Stock" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Procurement" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Procurement Rule" - -#. module: stock_mts_mto_rule -#: field:stock.warehouse,mto_mts_management:0 -msgid "Use MTO+MTS rules" -msgstr "Use MTO+MTS rules" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse -msgid "Warehouse" -msgstr "Warehouse" From 14b7fc1f20542f6223dc9aec967586e9271796d0 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 16:09:41 +0200 Subject: [PATCH 09/36] [MIG] Rename manifest files --- stock_mts_mto_rule/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename stock_mts_mto_rule/{__openerp__.py => __manifest__.py} (100%) diff --git a/stock_mts_mto_rule/__openerp__.py b/stock_mts_mto_rule/__manifest__.py similarity index 100% rename from stock_mts_mto_rule/__openerp__.py rename to stock_mts_mto_rule/__manifest__.py From 6657f96fe463e7063b3e80e7ccbb565b1b3b69ea Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Wed, 12 Aug 2015 19:22:57 +0200 Subject: [PATCH 10/36] fix stock_mts_mto procurement check method --- stock_mts_mto_rule/model/procurement.py | 33 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index cb563241f..fdafa30e5 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -19,12 +19,21 @@ # along with this program. If not, see . # ############################################################################### -from openerp import models, api +from openerp import models, api, fields class ProcurementOrder(models.Model): _inherit = 'procurement.order' + mts_mto_procurement_id = fields.Many2one( + 'procurement.order', + string="Mto+Mts Procurement", + copy=False) + mts_mto_procurement_ids = fields.One2many( + 'procurement.order', + 'mts_mto_procurement_id', + string="Procurements") + @api.multi def get_mto_qty_to_order(self): self.ensure_one() @@ -52,23 +61,31 @@ class ProcurementOrder(models.Model): 'product_qty': qty, 'product_uos_qty': uos_qty, 'rule_id': rule.id, + 'mts_mto_procurement_id': proc.id, } @api.model def _check(self, procurement): if procurement.rule_id and \ procurement.rule_id.action == 'split_procurement': - if procurement.state == 'running': + cancel_proc_list = [x.state == 'cancel' + for x in procurement.mts_mto_procurement_ids] + done_cancel_test_list = [ + x.state in ('done', 'cancel') + for x in procurement.mts_mto_procurement_ids] + if all(cancel_proc_list): + procurement.write({'state': 'cancel'}) + elif all(done_cancel_test_list): return True return super(ProcurementOrder, self)._check(procurement) @api.multi - def run(self, autocommit=False): - res = super(ProcurementOrder, self).run(autocommit=autocommit) - for proc in self: - if proc.rule_id and \ - proc.rule_id.action == 'split_procurement': - proc.check() + def check(self, autocommit=False): + res = super(ProcurementOrder, self).check(autocommit=autocommit) + for procurement in self: + if procurement.mts_mto_procurement_id: + procurement.mts_mto_procurement_id.check( + autocommit=autocommit) return res @api.model From d181bb3de4c3eefbf53c2956b2d16143deb0fbf6 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 26 Oct 2015 07:57:56 -0400 Subject: [PATCH 11/36] OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/sl.po | 107 ++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 stock_mts_mto_rule/i18n/sl.po diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po new file mode 100644 index 000000000..bd7b21544 --- /dev/null +++ b/stock_mts_mto_rule/i18n/sl.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-24 09:07+0000\n" +"PO-Revision-Date: 2015-10-23 12:22+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/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" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "Za skladišče ni pravila 'po naročilu'" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "Za skladišče ni pravila 'na zalogo'" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "Ni generične proge 'na zalogo' + 'po naročilu'" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" + +#. module: stock_mts_mto_rule +#: help:stock.warehouse,mto_mts_management:0 +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "Če je na prikazu obrazca proizvoda izbrana ta proga, se nabavni nalog ustvari le, če je navidezna zaloga manj od 0. V nasprotnem primeru se proizvod vzame iz zaloge." + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mto_rule_id:0 +msgid "MTO Rule" +msgstr "Pravilo 'Po naročilu'" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mts_mto_rule_id:0 +msgid "MTO+MTS rule" +msgstr "Pravilo 'Po naročilu' + 'Na zalogo'" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mts_rule_id:0 +msgid "MTS Rule" +msgstr "Pravilo 'Na zalogo'" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#, python-format +msgid "MTS+MTO" +msgstr "Na zalogo + Po naročilu" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "Naredi po naročilu + Naredi na zalogo" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_id:0 +msgid "Mto+Mts Procurement" +msgstr "Oskrbovanja 'po naročilu'+'na zalogo'" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Oskrbovanje" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Oskrbovalno pravilo" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_ids:0 +msgid "Procurements" +msgstr "Oskrbovanja" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mto_mts_management:0 +msgid "Use MTO+MTS rules" +msgstr "Uporabi pravila Po naročilu + Na zalogo" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Skladišče" From 85d882a0367daacddb337cd8099d8aa0446c31d1 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Wed, 25 Nov 2015 15:56:51 +0100 Subject: [PATCH 12/36] Update READMEs Conforms to the latest README template: bugtracker, runbot etc. Fixes bugtracker URL on some modules. States OCA as maintainer, removes other contributors from the 'Maintainer' section. --- stock_mts_mto_rule/README.rst | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 130c57887..00f85b320 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -1,6 +1,8 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +================== Stock MTS+MTO Rule ================== @@ -35,13 +37,29 @@ After validation, a purchase order with 2 products will be created. Usage ===== -You have to choose the mts+mto route on the product form. -You should not choose both mts+mto route and mto route. +You have to select the mts+mto route on the product form. +You should not select both the mts+mto route and the mto route. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/153/8.0 Configuration ============= -You have to choose 'Use MTO+MTS rules' on the company's warehouse form. +You have to select 'Use MTO+MTS rules' on the company's warehouse form. + +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 +`_. Note: In order to see this option, you must enable "Manage advanced routes for your warehouse" under Settings -> Configuration -> Warehouse. @@ -56,9 +74,9 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. @@ -66,4 +84,4 @@ 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 http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. From decdfd9ef80f905617fae8618411a81acf8917e6 Mon Sep 17 00:00:00 2001 From: JulioSerna Date: Tue, 5 Jan 2016 20:49:12 +0000 Subject: [PATCH 13/36] set pull rule of customer location like split_procurement to allow when warehouse is two/three steps delivery propagate move by mts-mto in pick/pack/out --- stock_mts_mto_rule/model/warehouse.py | 26 ++++++++++++++++++- .../tests/test_mto_mts_route.py | 10 ++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index 6f06ada0f..0c10b17aa 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -70,6 +70,26 @@ class Warehouse(models.Model): 'picking_type_id': warehouse.mto_pull_id.picking_type_id.id, } + @api.model + def _get_push_pull_rules(self, warehouse, active, values, new_route_id): + pull_obj = self.env['procurement.rule'] + res = super(Warehouse, self)._get_push_pull_rules( + warehouse, active, values, new_route_id) + customer_location = warehouse._get_partner_locations() + location_id = customer_location[0].id + if warehouse.mto_mts_management: + for pull in res[1]: + if pull['location_id'] == location_id: + pull_mto_mts = pull.copy() + pull_mto_mts_id = pull_obj.create(pull_mto_mts) + pull.update({ + 'action': 'split_procurement', + 'mto_rule_id': pull_mto_mts_id.id, + 'mts_rule_id': pull_mto_mts_id.id, + 'sequence': 10 + }) + return res + @api.multi def create_routes(self, warehouse): pull_model = self.env['procurement.rule'] @@ -94,7 +114,11 @@ class Warehouse(models.Model): for warehouse in self: if warehouse.mts_mto_rule_id: warehouse.mts_mto_rule_id.unlink() - return super(Warehouse, self).write(vals) + res = super(Warehouse, self).write(vals) + if 'mto_mts_management' in vals: + self.with_context({'active_test': False}).change_route( + warehouse, new_delivery_step=warehouse.delivery_steps) + return res @api.model def get_all_routes_for_wh(self, warehouse): diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index bc38de754..eacf3c3e4 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -34,12 +34,15 @@ class TestMtoMtsRoute(TransactionCase): def test_standard_mts_route(self): self.procurement.run() + procurement_id = self.procurement_obj.search([ + ('group_id', '=', self.procurement.group_id.id), + ('move_ids', '!=', False)], limit=1) self.assertEqual('make_to_stock', - self.procurement.move_ids[0].procure_method) + procurement_id.move_ids[0].procure_method) self.assertEqual(self.procurement.product_qty, - self.procurement.move_ids[0].product_uom_qty) + procurement_id.move_ids[0].product_uom_qty) self.assertEqual('confirmed', - self.procurement.move_ids[0].state) + procurement_id.move_ids[0].state) def test_mts_mto_route_split(self): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') @@ -81,6 +84,7 @@ class TestMtoMtsRoute(TransactionCase): self.warehouse.mto_mts_management = True self.product = self.env.ref('product.product_product_4') self.company_partner = self.env.ref('base.main_partner') + self.procurement_obj = self.env['procurement.order'] self.group = self.env['procurement.group'].create({ 'name': 'test', }) From 1486b80d8328a2d9a25693355c8eeefec65657f9 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 31 Jan 2016 00:24:23 -0500 Subject: [PATCH 14/36] OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/de.po | 107 ++++++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/es.po | 107 ++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 stock_mts_mto_rule/i18n/de.po create mode 100644 stock_mts_mto_rule/i18n/es.po diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po new file mode 100644 index 000000000..40d9d8d0a --- /dev/null +++ b/stock_mts_mto_rule/i18n/de.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-14 01:38+0000\n" +"PO-Revision-Date: 2016-01-14 09:50+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "Kann MTO-Regel zum Lager nicht finden" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "Kann MTS-Regel zum Lager nicht finden" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "Kann keine allg. MTO- oder MTS-Route finden" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "Wähle aus MTO und MTS" + +#. module: stock_mts_mto_rule +#: help:stock.warehouse,mto_mts_management:0 +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "Wird diese neue Route in der Produktdetailsicht gewählt, wird eine Beschaffung nur dann bewirkt, wenn der Planbestand unter 0 fällt, anderenfalls wird das Produkt aus dem Bestand genommen." + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mto_rule_id:0 +msgid "MTO Rule" +msgstr "MTO-Regel" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mts_mto_rule_id:0 +msgid "MTO+MTS rule" +msgstr "MTO+MTS-Regel" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mts_rule_id:0 +msgid "MTS Rule" +msgstr "MTS-Regel" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#, python-format +msgid "MTS+MTO" +msgstr "MTS+MTO" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "MTO Auftragsfertigung + MTS Lagerfertigung" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_id:0 +msgid "Mto+Mts Procurement" +msgstr "MTO+MTS-Beschaffung" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Beschaffung" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Beschaffungsregel" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_ids:0 +msgid "Procurements" +msgstr "Beschaffungen" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mto_mts_management:0 +msgid "Use MTO+MTS rules" +msgstr "Verwende MTO+MTS-Regeln" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Warenlager" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po new file mode 100644 index 000000000..2427c3ec1 --- /dev/null +++ b/stock_mts_mto_rule/i18n/es.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Antonio Trueba, 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-14 01:38+0000\n" +"PO-Revision-Date: 2016-02-10 16:39+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: help:stock.warehouse,mto_mts_management:0 +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mto_rule_id:0 +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mts_mto_rule_id:0 +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:procurement.rule,mts_rule_id:0 +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_id:0 +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Abastecimiento" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Regla de abastecimiento" + +#. module: stock_mts_mto_rule +#: field:procurement.order,mts_mto_procurement_ids:0 +msgid "Procurements" +msgstr "Abastecimientos" + +#. module: stock_mts_mto_rule +#: field:stock.warehouse,mto_mts_management:0 +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Almacén" From c0a0a0d34f03d4cd87e17715a486597919a1a90f Mon Sep 17 00:00:00 2001 From: Levent Karakas Date: Tue, 1 Mar 2016 16:09:41 +0200 Subject: [PATCH 15/36] stock move name fix --- stock_mts_mto_rule/model/procurement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index fdafa30e5..a92fb5bab 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -56,7 +56,7 @@ class ProcurementOrder(models.Model): origin = (proc.group_id and (proc.group_id.name + ":") or "") + \ (proc.rule_id and proc.rule_id.name or proc.origin or "/") return { - 'name': rule.name, + 'name': proc.name, 'origin': origin, 'product_qty': qty, 'product_uos_qty': uos_qty, From fdf4fdb326d71d94c28101cbb709b0f7563a08e1 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Thu, 10 Mar 2016 15:22:13 +0100 Subject: [PATCH 16/36] Do no run mts mto procurement if it already has been splited into at least another procurement --- stock_mts_mto_rule/README.rst | 9 +++++++++ stock_mts_mto_rule/model/procurement.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 00f85b320..91c13ea9c 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -49,6 +49,15 @@ Configuration You have to select 'Use MTO+MTS rules' on the company's warehouse form. +Known issues +============ + +If you cancel a delivery order and then recreate it from Recreate +Delivery Order button in sale order form, then the stock level at the time of +the Re-Creation won't be taken into account. So if a purchase order was created +when the sale order was first validated, a similar purchase order will be created +during the Re-creation of the delivery order, even if not needed regarding the actual stock. + Bug Tracker =========== diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index a92fb5bab..2a8586c57 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -92,6 +92,8 @@ class ProcurementOrder(models.Model): def _run(self, procurement): if procurement.rule_id and \ procurement.rule_id.action == 'split_procurement': + if procurement.mts_mto_procurement_ids: + return super(ProcurementOrder, self)._run(procurement) uom_obj = self.env['product.uom'] needed_qty = procurement.get_mto_qty_to_order() rule = procurement.rule_id From 124b03026902806441b3ed427e73afb4f329c68e Mon Sep 17 00:00:00 2001 From: jbeficent Date: Tue, 12 Apr 2016 10:44:31 +0200 Subject: [PATCH 17/36] stock_mts_mto_rule --- stock_mts_mto_rule/README.rst | 2 - stock_mts_mto_rule/__manifest__.py | 4 +- stock_mts_mto_rule/model/procurement.py | 24 ++++-------- .../tests/test_mto_mts_route.py | 37 ++++++++++--------- 4 files changed, 29 insertions(+), 38 deletions(-) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 91c13ea9c..c17580cff 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -70,8 +70,6 @@ stock-logistics-warehouse/issues/new?body=module:%20 stock_mts_mto_rule%0Aversion:%20 8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. -Note: In order to see this option, you must enable "Manage advanced routes for your warehouse" under Settings -> Configuration -> Warehouse. - Credits ======= diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index bb2d0911a..67640dd6b 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################## {'name': 'Stock MTS+MTO Rule', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'license': 'AGPL-3', @@ -34,5 +34,5 @@ 'view/pull_rule.xml', 'view/warehouse.xml', ], - 'installable': False, + 'installable': True, } diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index 2a8586c57..14d66b2cf 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -19,7 +19,7 @@ # along with this program. If not, see . # ############################################################################### -from openerp import models, api, fields +from openerp import api, fields, models class ProcurementOrder(models.Model): @@ -52,14 +52,13 @@ class ProcurementOrder(models.Model): return self.product_qty @api.model - def _get_mts_mto_procurement(self, proc, rule, qty, uos_qty): + def _get_mts_mto_procurement(self, proc, rule, qty): origin = (proc.group_id and (proc.group_id.name + ":") or "") + \ (proc.rule_id and proc.rule_id.name or proc.origin or "/") return { 'name': proc.name, 'origin': origin, 'product_qty': qty, - 'product_uos_qty': uos_qty, 'rule_id': rule.id, 'mts_mto_procurement_id': proc.id, } @@ -94,37 +93,28 @@ class ProcurementOrder(models.Model): procurement.rule_id.action == 'split_procurement': if procurement.mts_mto_procurement_ids: return super(ProcurementOrder, self)._run(procurement) - uom_obj = self.env['product.uom'] needed_qty = procurement.get_mto_qty_to_order() rule = procurement.rule_id if needed_qty == 0.0: mts_vals = self._get_mts_mto_procurement( - procurement, rule.mts_rule_id, procurement.product_qty, - procurement.product_uos_qty) + procurement, rule.mts_rule_id, procurement.product_qty) mts_proc = procurement.copy(mts_vals) mts_proc.run() elif needed_qty == procurement.product_qty: mto_vals = self._get_mts_mto_procurement( - procurement, rule.mto_rule_id, procurement.product_qty, - procurement.product_uos_qty) + procurement, rule.mto_rule_id, procurement.product_qty) mto_proc = procurement.copy(mto_vals) mto_proc.run() else: mts_qty = procurement.product_qty - needed_qty - mts_uos_qty = uom_obj._compute_qty( - procurement.product_uom.id, - mts_qty, - procurement.product_uos.id) mts_vals = self._get_mts_mto_procurement( - procurement, rule.mts_rule_id, mts_qty, mts_uos_qty) + procurement, rule.mts_rule_id, mts_qty) mts_proc = procurement.copy(mts_vals) mts_proc.run() - uos_qty = procurement.product_uos_qty mto_vals = self._get_mts_mto_procurement( - procurement, rule.mto_rule_id, needed_qty, - uos_qty - mts_uos_qty) - + procurement, rule.mto_rule_id, needed_qty) mto_proc = procurement.copy(mto_vals) mto_proc.run() + return super(ProcurementOrder, self)._run(procurement) diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index eacf3c3e4..838c3a0c3 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -19,10 +19,24 @@ from datetime import datetime class TestMtoMtsRoute(TransactionCase): + def _procurement_create(self): + self.procurement = self.env['procurement.order'].create({ + 'location_id': self.env.ref('stock.stock_location_customers').id, + 'product_id': self.product.id, + 'product_qty': 2.0, + 'product_uom': 1, + 'warehouse_id': self.warehouse.id, + 'priority': '1', + 'date_planned': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), + 'name': self.product.name, + 'origin': 'test', + 'group_id': self.group.id, + }) + def test_standard_mto_route(self): mto_route = self.env.ref('stock.route_warehouse0_mto') self.product.route_ids = [(6, 0, [mto_route.id])] - self.procurement.run() + self._procurement_create() self.assertEqual(self.warehouse.mto_pull_id, self.procurement.rule_id) self.assertEqual('make_to_order', @@ -33,7 +47,7 @@ class TestMtoMtsRoute(TransactionCase): self.procurement.move_ids[0].state) def test_standard_mts_route(self): - self.procurement.run() + self._procurement_create() procurement_id = self.procurement_obj.search([ ('group_id', '=', self.procurement.group_id.id), ('move_ids', '!=', False)], limit=1) @@ -48,7 +62,7 @@ class TestMtoMtsRoute(TransactionCase): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] self.quant.qty = 1.0 - self.procurement.run() + self._procurement_create() moves = self.env['stock.move'].search( [('group_id', '=', self.group.id)]) self.assertEqual(2, len(moves)) @@ -58,7 +72,7 @@ class TestMtoMtsRoute(TransactionCase): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] self.quant.qty = 0.0 - self.procurement.run() + self._procurement_create() moves = self.env['stock.move'].search( [('group_id', '=', self.group.id)]) self.assertEqual(1, len(moves)) @@ -70,7 +84,7 @@ class TestMtoMtsRoute(TransactionCase): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] self.quant.qty = 3.0 - self.procurement.run() + self._procurement_create() moves = self.env['stock.move'].search( [('group_id', '=', self.group.id)]) self.assertEqual(1, len(moves)) @@ -88,18 +102,7 @@ class TestMtoMtsRoute(TransactionCase): self.group = self.env['procurement.group'].create({ 'name': 'test', }) - self.procurement = self.env['procurement.order'].create({ - 'location_id': self.env.ref('stock.stock_location_customers').id, - 'product_id': self.product.id, - 'product_qty': 2.0, - 'product_uom': 1, - 'warehouse_id': self.warehouse.id, - 'priority': '1', - 'date_planned': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), - 'name': self.product.name, - 'origin': 'test', - 'group_id': self.group.id, - }) + self.quant = self.env['stock.quant'].create({ 'owner_id': self.company_partner.id, 'location_id': self.env.ref('stock.stock_location_stock').id, From e4ec707558aa060d8294de60763bb2019a68027e Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Sun, 9 Oct 2016 17:23:38 +0200 Subject: [PATCH 18/36] [MIG] Migrate stock_mts_mto_rule to v10.0 --- stock_mts_mto_rule/README.rst | 8 +- stock_mts_mto_rule/__manifest__.py | 23 +----- stock_mts_mto_rule/data/stock_data.xml | 23 +++--- stock_mts_mto_rule/model/procurement.py | 82 ++++++++----------- stock_mts_mto_rule/model/rule.py | 26 +----- stock_mts_mto_rule/model/warehouse.py | 64 ++++++--------- .../tests/test_mto_mts_route.py | 20 +---- stock_mts_mto_rule/view/pull_rule.xml | 37 ++++----- stock_mts_mto_rule/view/warehouse.xml | 22 +++-- 9 files changed, 106 insertions(+), 199 deletions(-) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index c17580cff..7ff843b93 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -42,7 +42,7 @@ You should not select both the mts+mto route and the mto route. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/8.0 + :target: https://runbot.odoo-community.org/runbot/153/10.0 Configuration ============= @@ -64,11 +64,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 67640dd6b..ecccd1339 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -1,27 +1,8 @@ # -*- coding: utf-8 -*- - -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Akretion (). -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Stock MTS+MTO Rule', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'license': 'AGPL-3', diff --git a/stock_mts_mto_rule/data/stock_data.xml b/stock_mts_mto_rule/data/stock_data.xml index 8297d5a83..7b7dfb257 100644 --- a/stock_mts_mto_rule/data/stock_data.xml +++ b/stock_mts_mto_rule/data/stock_data.xml @@ -1,17 +1,14 @@ - - + - - - - Make To Order + Make To Stock - 5 - - + + + Make To Order + Make To Stock + 5 + + - - + diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index 14d66b2cf..6e70c23ff 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -1,25 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved -# @author Florian DA COSTA -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### -from openerp import api, fields, models +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models class ProcurementOrder(models.Model): @@ -37,13 +19,12 @@ class ProcurementOrder(models.Model): @api.multi def get_mto_qty_to_order(self): self.ensure_one() - uom_obj = self.env['product.uom'] stock_location = self.warehouse_id.lot_stock_id.id proc_warehouse = self.with_context(location=stock_location) virtual_available = proc_warehouse.product_id.virtual_available - qty_available = uom_obj._compute_qty(self.product_id.uom_id.id, - virtual_available, - self.product_uom.id) + qty_available = self.product_id.uom_id._compute_quantity( + virtual_available, self.product_uom) + if qty_available > 0: if qty_available >= self.product_qty: return 0.0 @@ -51,16 +32,17 @@ class ProcurementOrder(models.Model): return self.product_qty - qty_available return self.product_qty - @api.model - def _get_mts_mto_procurement(self, proc, rule, qty): - origin = (proc.group_id and (proc.group_id.name + ":") or "") + \ - (proc.rule_id and proc.rule_id.name or proc.origin or "/") + @api.multi + def _get_mts_mto_procurement(self, rule, qty): + self.ensure_one() + origin = (self.group_id and (self.group_id.name + ":") or "") + \ + (self.rule_id and self.rule_id.name or self.origin or "/") return { - 'name': proc.name, + 'name': self.name, 'origin': origin, 'product_qty': qty, 'rule_id': rule.id, - 'mts_mto_procurement_id': proc.id, + 'mts_mto_procurement_id': self.id, } @api.model @@ -87,34 +69,34 @@ class ProcurementOrder(models.Model): autocommit=autocommit) return res - @api.model - def _run(self, procurement): - if procurement.rule_id and \ - procurement.rule_id.action == 'split_procurement': - if procurement.mts_mto_procurement_ids: - return super(ProcurementOrder, self)._run(procurement) - needed_qty = procurement.get_mto_qty_to_order() - rule = procurement.rule_id + @api.multi + def _run(self): + self.ensure_one() + if self.rule_id and self.rule_id.action == 'split_procurement': + if self.mts_mto_procurement_ids: + return super(ProcurementOrder, self)._run() + needed_qty = self.get_mto_qty_to_order() + rule = self.rule_id if needed_qty == 0.0: mts_vals = self._get_mts_mto_procurement( - procurement, rule.mts_rule_id, procurement.product_qty) - mts_proc = procurement.copy(mts_vals) + rule.mts_rule_id, self.product_qty) + mts_proc = self.copy(mts_vals) mts_proc.run() - elif needed_qty == procurement.product_qty: + elif needed_qty == self.product_qty: mto_vals = self._get_mts_mto_procurement( - procurement, rule.mto_rule_id, procurement.product_qty) - mto_proc = procurement.copy(mto_vals) + rule.mto_rule_id, self.product_qty) + mto_proc = self.copy(mto_vals) mto_proc.run() else: - mts_qty = procurement.product_qty - needed_qty + mts_qty = self.product_qty - needed_qty mts_vals = self._get_mts_mto_procurement( - procurement, rule.mts_rule_id, mts_qty) - mts_proc = procurement.copy(mts_vals) + rule.mts_rule_id, mts_qty) + mts_proc = self.copy(mts_vals) mts_proc.run() mto_vals = self._get_mts_mto_procurement( - procurement, rule.mto_rule_id, needed_qty) - mto_proc = procurement.copy(mto_vals) + rule.mto_rule_id, needed_qty) + mto_proc = self.copy(mto_vals) mto_proc.run() - return super(ProcurementOrder, self)._run(procurement) + return super(ProcurementOrder, self)._run() diff --git a/stock_mts_mto_rule/model/rule.py b/stock_mts_mto_rule/model/rule.py index 481ffedce..38c22b4c4 100644 --- a/stock_mts_mto_rule/model/rule.py +++ b/stock_mts_mto_rule/model/rule.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved -# @author Florian DA COSTA -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### -from openerp import models, api, fields -from openerp.tools.translate import _ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api, fields +from odoo.tools.translate import _ class ProcurementRule(models.Model): diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index 0c10b17aa..cbb62ab7d 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################### -# -# Module for OpenERP -# Copyright (C) 2015 Akretion (http://www.akretion.com). All Rights Reserved -# @author Florian DA COSTA -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### -from openerp import models, api, fields, exceptions -from openerp.tools.translate import _ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api, fields, exceptions +from odoo.tools.translate import _ class Warehouse(models.Model): @@ -60,7 +42,7 @@ class Warehouse(models.Model): raise exceptions.Warning(_( 'Can\'t find MTS Rule on the warehouse')) return { - 'name': self._format_routename(warehouse, _('MTS+MTO')), + 'name': warehouse._format_routename(route_type='mts_mto'), 'route_id': mts_mto_route.id, 'action': 'split_procurement', 'mto_rule_id': warehouse.mto_pull_id.id, @@ -116,8 +98,7 @@ class Warehouse(models.Model): warehouse.mts_mto_rule_id.unlink() res = super(Warehouse, self).write(vals) if 'mto_mts_management' in vals: - self.with_context({'active_test': False}).change_route( - warehouse, new_delivery_step=warehouse.delivery_steps) + self.with_context({'active_test': False})._update_routes() return res @api.model @@ -141,21 +122,24 @@ class Warehouse(models.Model): ) return res - @api.multi - def change_route(self, warehouse, new_reception_step=False, - new_delivery_step=False): - res = super(Warehouse, self).change_route( - warehouse, - new_reception_step=new_reception_step, - new_delivery_step=new_delivery_step) + def _get_route_name(self, route_type): + names = {'mts_mto': _('MTS+MTO')} + if route_type in names: + return names[route_type] - mts_mto_rule_id = warehouse.mts_mto_rule_id - if new_delivery_step and mts_mto_rule_id: + return super(Warehouse, self)._get_route_name(route_type) + + @api.multi + def _update_routes(self): + res = super(Warehouse, self)._update_routes() + + mts_mto_rule_id = self.mts_mto_rule_id + if self.delivery_steps and mts_mto_rule_id: pull_model = self.env['procurement.rule'] - warehouse.mts_mto_rule_id.location_id = ( - warehouse.mto_pull_id.location_id) - mts_rules = pull_model.search( - [('location_src_id', '=', warehouse.lot_stock_id.id), - ('route_id', '=', warehouse.delivery_route_id.id)]) - warehouse.mts_mto_rule_id.mts_rule_id = mts_rules[0].id + self.mts_mto_rule_id.location_id = self.mto_pull_id.location_id + mts_rules = pull_model.search([ + ('location_src_id', '=', self.lot_stock_id.id), + ('route_id', '=', self.delivery_route_id.id), + ]) + self.mts_mto_rule_id.mts_rule_id = mts_rules[0].id return res diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index 838c3a0c3..c9d8e6563 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -1,19 +1,7 @@ -# Author: Florian da Costa -# Copyright 2015 Akretion -# -# 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -from openerp.tests.common import TransactionCase +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase from datetime import datetime diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index e21a59ff8..9504f205a 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -1,21 +1,20 @@ - - - - procurement.rule.mts.mto - procurement.rule - - - - - - - - + - - + + procurement.rule.mts.mto + procurement.rule + + + + + + + + + + diff --git a/stock_mts_mto_rule/view/warehouse.xml b/stock_mts_mto_rule/view/warehouse.xml index 5dc891581..a0368b30c 100644 --- a/stock_mts_mto_rule/view/warehouse.xml +++ b/stock_mts_mto_rule/view/warehouse.xml @@ -1,17 +1,15 @@ - - + - view_warehouse_inherited - stock.warehouse - - - - - - + view_warehouse_inherited + stock.warehouse + + + + + + - - + From 34091a9d8dd27cd9a4c07dba6c248868bdad767f Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Mon, 17 Oct 2016 12:42:22 +0200 Subject: [PATCH 19/36] [IMP] stock_mts_mto_rule : Added some unit tests --- .../tests/test_mto_mts_route.py | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index c9d8e6563..09e8cbe0d 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import exceptions from odoo.tests.common import TransactionCase from datetime import datetime @@ -56,6 +57,26 @@ class TestMtoMtsRoute(TransactionCase): self.assertEqual(2, len(moves)) self.assertEqual(1.0, moves[0].product_uom_qty) + def test_mts_mto_route_split_done(self): + mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.quant.qty = 1.0 + self._procurement_create() + self.assertEqual(self.procurement.state, 'running') + self.procurement.mts_mto_procurement_ids.mapped( + 'move_ids').action_done() + self.assertEqual(self.procurement.state, 'done') + + def test_mts_mto_route_split_cancel(self): + mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + self.product.route_ids = [(6, 0, [mto_mts_route.id])] + self.quant.qty = 1.0 + self._procurement_create() + self.procurement.mts_mto_procurement_ids.cancel() + self.assertEqual(self.procurement.state, 'running') + self.procurement.check() + self.assertEqual(self.procurement.state, 'cancel') + def test_mts_mto_route_mts_only(self): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] @@ -80,6 +101,62 @@ class TestMtoMtsRoute(TransactionCase): self.assertEqual('make_to_stock', moves[0].procure_method) + def test_mts_mto_route_mto_removed(self): + self.env.ref('stock_mts_mto_rule.route_mto_mts').unlink() + self.warehouse.mts_mto_rule_id = False + with self.assertRaises(exceptions.Warning): + self.warehouse.mto_mts_management = True + + def test_mts_mto_route_mts_removed(self): + self.warehouse.mto_mts_management = True + self.env['procurement.rule'].search([ + ('location_src_id', '=', self.warehouse.lot_stock_id.id), + ('route_id', '=', self.warehouse.delivery_route_id.id), + ]).unlink() + self.warehouse.mts_mto_rule_id = False + with self.assertRaises(exceptions.Warning): + self.warehouse.mto_mts_management = True + + def test_mts_mto_route_mto_no_mts_rule(self): + self.warehouse.mts_mto_rule_id = False + self.warehouse.mto_pull_id = False + with self.assertRaises(exceptions.Warning): + self.warehouse.mto_mts_management = True + + def test_create_routes(self): + rule_obj = self.env['procurement.rule'] + created_routes = self.warehouse.create_routes(self.warehouse) + mts_mto_route = rule_obj.browse(created_routes['mts_mto_rule_id']) + self.assertEqual(mts_mto_route.warehouse_id, self.warehouse) + self.assertEqual( + mts_mto_route.location_id, self.warehouse.mto_pull_id.location_id) + self.assertEqual( + mts_mto_route.picking_type_id, + self.warehouse.mto_pull_id.picking_type_id) + self.assertEqual( + mts_mto_route.route_id, + self.env.ref('stock_mts_mto_rule.route_mto_mts')) + + def test_remove_mts_mto_management(self): + warehouse_rule = self.warehouse.mts_mto_rule_id + self.assertTrue(self.warehouse.mts_mto_rule_id) + self.warehouse.mto_mts_management = False + self.assertFalse(warehouse_rule.exists()) + self.assertFalse(self.warehouse.mts_mto_rule_id) + + def test_get_all_routes_for_wh(self): + routes = self.warehouse.get_all_routes_for_wh(self.warehouse) + self.assertTrue(self.warehouse.mts_mto_rule_id) + self.assertTrue(self.warehouse.mts_mto_rule_id.route_id.id in routes) + + def test_rename_warehouse(self): + rule_name = self.warehouse.mts_mto_rule_id.name + new_warehouse_name = 'NewName' + new_rule_name = rule_name.replace( + self.warehouse.name, new_warehouse_name, 1) + self.warehouse.name = new_warehouse_name + self.assertEqual(new_rule_name, self.warehouse.mts_mto_rule_id.name) + def setUp(self): super(TestMtoMtsRoute, self).setUp() self.warehouse = self.env.ref('stock.warehouse0') From 1aacd10c99e87e7f00b125c4ef2efefb2ab5e40f Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Tue, 18 Oct 2016 14:39:17 +0200 Subject: [PATCH 20/36] [FIX] stock_mts_mto_rule : Fixed v10 migration bugs, revealed by new unit tests --- stock_mts_mto_rule/model/procurement.py | 17 ++-- stock_mts_mto_rule/model/warehouse.py | 90 +++++++++++-------- .../tests/test_mto_mts_route.py | 6 +- 3 files changed, 65 insertions(+), 48 deletions(-) diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index 6e70c23ff..24de0babc 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -45,20 +45,21 @@ class ProcurementOrder(models.Model): 'mts_mto_procurement_id': self.id, } - @api.model - def _check(self, procurement): - if procurement.rule_id and \ - procurement.rule_id.action == 'split_procurement': + @api.multi + def _check(self): + self.ensure_one() + if self.rule_id and \ + self.rule_id.action == 'split_procurement': cancel_proc_list = [x.state == 'cancel' - for x in procurement.mts_mto_procurement_ids] + for x in self.mts_mto_procurement_ids] done_cancel_test_list = [ x.state in ('done', 'cancel') - for x in procurement.mts_mto_procurement_ids] + for x in self.mts_mto_procurement_ids] if all(cancel_proc_list): - procurement.write({'state': 'cancel'}) + self.write({'state': 'cancel'}) elif all(done_cancel_test_list): return True - return super(ProcurementOrder, self)._check(procurement) + return super(ProcurementOrder, self)._check() @api.multi def check(self, autocommit=False): diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index cbb62ab7d..7b30aad84 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -16,8 +16,9 @@ class Warehouse(models.Model): mts_mto_rule_id = fields.Many2one('procurement.rule', 'MTO+MTS rule') - @api.model - def _get_mts_mto_rule(self, warehouse): + @api.multi + def _get_mts_mto_rule(self): + self.ensure_one() route_model = self.env['stock.location.route'] pull_model = self.env['procurement.rule'] try: @@ -31,35 +32,50 @@ class Warehouse(models.Model): raise exceptions.Warning(_( 'Can\'t find any generic MTS+MTO route.')) - if not warehouse.mto_pull_id: + if not self.mto_pull_id: raise exceptions.Warning(_( 'Can\'t find MTO Rule on the warehouse')) mts_rules = pull_model.search( - [('location_src_id', '=', warehouse.lot_stock_id.id), - ('route_id', '=', warehouse.delivery_route_id.id)]) + [('location_src_id', '=', self.lot_stock_id.id), + ('route_id', '=', self.delivery_route_id.id)]) if not mts_rules: raise exceptions.Warning(_( 'Can\'t find MTS Rule on the warehouse')) return { - 'name': warehouse._format_routename(route_type='mts_mto'), + 'name': self._format_routename(route_type='mts_mto'), 'route_id': mts_mto_route.id, 'action': 'split_procurement', - 'mto_rule_id': warehouse.mto_pull_id.id, + 'mto_rule_id': self.mto_pull_id.id, 'mts_rule_id': mts_rules[0].id, - 'warehouse_id': warehouse.id, - 'location_id': warehouse.mto_pull_id.location_id.id, - 'picking_type_id': warehouse.mto_pull_id.picking_type_id.id, + 'warehouse_id': self.id, + 'location_id': self.mto_pull_id.location_id.id, + 'picking_type_id': self.mto_pull_id.picking_type_id.id, } - @api.model - def _get_push_pull_rules(self, warehouse, active, values, new_route_id): + def _get_mto_pull_rules_values(self, route_values): + """ + Prevent changing standard MTO rules' action from "move" + """ + pull_rules_list = super(Warehouse, self)._get_mto_pull_rules_values( + route_values) + for pull_rule in pull_rules_list: + pull_rule['action'] = 'move' + + return pull_rules_list + + @api.multi + def _get_push_pull_rules_values( + self, route_values, values=None, push_values=None, + pull_values=None, name_suffix=''): + self.ensure_one() pull_obj = self.env['procurement.rule'] - res = super(Warehouse, self)._get_push_pull_rules( - warehouse, active, values, new_route_id) - customer_location = warehouse._get_partner_locations() + res = super(Warehouse, self)._get_push_pull_rules_values( + route_values, values=values, push_values=push_values, + pull_values=pull_values, name_suffix=name_suffix) + customer_location = self._get_partner_locations() location_id = customer_location[0].id - if warehouse.mto_mts_management: + if self.mto_mts_management: for pull in res[1]: if pull['location_id'] == location_id: pull_mto_mts = pull.copy() @@ -69,15 +85,15 @@ class Warehouse(models.Model): 'mto_rule_id': pull_mto_mts_id.id, 'mts_rule_id': pull_mto_mts_id.id, 'sequence': 10 - }) + }) return res @api.multi - def create_routes(self, warehouse): + def create_routes(self): pull_model = self.env['procurement.rule'] - res = super(Warehouse, self).create_routes(warehouse) - if warehouse.mto_mts_management: - mts_mto_pull_vals = self._get_mts_mto_rule(warehouse) + res = super(Warehouse, self).create_routes() + if self.mto_mts_management: + mts_mto_pull_vals = self._get_mts_mto_rule() mts_mto_pull = pull_model.create(mts_mto_pull_vals) res['mts_mto_rule_id'] = mts_mto_pull.id return res @@ -89,7 +105,7 @@ class Warehouse(models.Model): if vals.get("mto_mts_management"): for warehouse in self: if not warehouse.mts_mto_rule_id: - rule_vals = self._get_mts_mto_rule(warehouse) + rule_vals = warehouse._get_mts_mto_rule() mts_mto_pull = pull_model.create(rule_vals) vals['mts_mto_rule_id'] = mts_mto_pull.id else: @@ -102,24 +118,24 @@ class Warehouse(models.Model): return res @api.model - def get_all_routes_for_wh(self, warehouse): - all_routes = super(Warehouse, self).get_all_routes_for_wh(warehouse) - if ( - warehouse.mto_mts_management and - warehouse.mts_mto_rule_id.route_id - ): - all_routes += [warehouse.mts_mto_rule_id.route_id.id] + def get_all_routes_for_wh(self): + all_routes = super(Warehouse, self).get_all_routes_for_wh() + + if self.mto_mts_management and self.mts_mto_rule_id.route_id: + all_routes += self.mts_mto_rule_id.route_id + return all_routes - @api.model - def _handle_renaming(self, warehouse, name, code): - res = super(Warehouse, self)._handle_renaming(warehouse, name, code) + @api.multi + def _update_name_and_code(self, name, code): + res = super(Warehouse, self)._update_name_and_code(name, code) - if warehouse.mts_mto_rule_id: - warehouse.mts_mto_rule_id.name = ( - warehouse.mts_mto_rule_id.name.replace( - warehouse.name, name, 1) - ) + for warehouse in self: + if warehouse.mts_mto_rule_id: + warehouse.mts_mto_rule_id.name = ( + warehouse.mts_mto_rule_id.name.replace( + warehouse.name, name, 1) + ) return res def _get_route_name(self, route_type): diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index 09e8cbe0d..ea24cf2ad 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -125,7 +125,7 @@ class TestMtoMtsRoute(TransactionCase): def test_create_routes(self): rule_obj = self.env['procurement.rule'] - created_routes = self.warehouse.create_routes(self.warehouse) + created_routes = self.warehouse.create_routes() mts_mto_route = rule_obj.browse(created_routes['mts_mto_rule_id']) self.assertEqual(mts_mto_route.warehouse_id, self.warehouse) self.assertEqual( @@ -145,9 +145,9 @@ class TestMtoMtsRoute(TransactionCase): self.assertFalse(self.warehouse.mts_mto_rule_id) def test_get_all_routes_for_wh(self): - routes = self.warehouse.get_all_routes_for_wh(self.warehouse) + routes = self.warehouse.get_all_routes_for_wh() self.assertTrue(self.warehouse.mts_mto_rule_id) - self.assertTrue(self.warehouse.mts_mto_rule_id.route_id.id in routes) + self.assertTrue(self.warehouse.mts_mto_rule_id.route_id in routes) def test_rename_warehouse(self): rule_name = self.warehouse.mts_mto_rule_id.name From 746f141ae8a21be1aecf00a9f76567489614f68d Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 29 Nov 2016 13:29:41 -0500 Subject: [PATCH 21/36] OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/de.po | 41 +++++++++++++----------- stock_mts_mto_rule/i18n/es.po | 36 ++++++++++----------- stock_mts_mto_rule/i18n/fr.po | 59 +++++++++++++++++++++++------------ stock_mts_mto_rule/i18n/sl.po | 41 +++++++++++++----------- 4 files changed, 101 insertions(+), 76 deletions(-) diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index 40d9d8d0a..052fddc9d 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -3,15 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# Rudolf Schnapka , 2016 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-14 01:38+0000\n" -"PO-Revision-Date: 2016-01-14 09:50+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/de/)\n" +"POT-Creation-Date: 2016-11-26 03:39+0000\n" +"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"Last-Translator: OCA Transbot , 2016\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" @@ -19,54 +19,57 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "Kann MTO-Regel zum Lager nicht finden" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "Kann MTS-Regel zum Lager nicht finden" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Kann keine allg. MTO- oder MTS-Route finden" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" msgstr "Wähle aus MTO und MTS" #. module: stock_mts_mto_rule -#: help:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be" " created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" -msgstr "Wird diese neue Route in der Produktdetailsicht gewählt, wird eine Beschaffung nur dann bewirkt, wenn der Planbestand unter 0 fällt, anderenfalls wird das Produkt aus dem Bestand genommen." +msgstr "" +"Wird diese neue Route in der Produktdetailsicht gewählt, wird eine " +"Beschaffung nur dann bewirkt, wenn der Planbestand unter 0 fällt, " +"anderenfalls wird das Produkt aus dem Bestand genommen." #. module: stock_mts_mto_rule -#: field:procurement.rule,mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" msgstr "MTO-Regel" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mts_mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" msgstr "MTO+MTS-Regel" #. module: stock_mts_mto_rule -#: field:procurement.rule,mts_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" msgstr "MTS-Regel" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" @@ -77,7 +80,7 @@ msgid "Make To Order + Make To Stock" msgstr "MTO Auftragsfertigung + MTS Lagerfertigung" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id msgid "Mto+Mts Procurement" msgstr "MTO+MTS-Beschaffung" @@ -92,12 +95,12 @@ msgid "Procurement Rule" msgstr "Beschaffungsregel" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_ids:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids msgid "Procurements" msgstr "Beschaffungen" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" msgstr "Verwende MTO+MTS-Regeln" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index 2427c3ec1..1eb850dc8 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -3,15 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# Antonio Trueba, 2016 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-14 01:38+0000\n" -"PO-Revision-Date: 2016-02-10 16:39+0000\n" -"Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/es/)\n" +"POT-Creation-Date: 2016-11-26 03:39+0000\n" +"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"Last-Translator: OCA Transbot , 2016\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" @@ -19,31 +19,31 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: help:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be" " created only if the virtual stock is less than 0 else, the product will be " @@ -51,22 +51,22 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: field:procurement.rule,mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mts_mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: field:procurement.rule,mts_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,7 +77,7 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id msgid "Mto+Mts Procurement" msgstr "" @@ -92,12 +92,12 @@ msgid "Procurement Rule" msgstr "Regla de abastecimiento" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_ids:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids msgid "Procurements" msgstr "Abastecimientos" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index d9a16e84e..4c9077130 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -3,15 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# Pierre Verkest , 2015 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 20:23+0000\n" -"PO-Revision-Date: 2015-09-27 20:47+0000\n" -"Last-Translator: Pierre Verkest \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fr/)\n" +"POT-Creation-Date: 2016-11-26 03:39+0000\n" +"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"Last-Translator: OCA Transbot , 2016\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" @@ -19,54 +19,63 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" -msgstr "Ne trouve pas la règle MTO (Make To Order: Fabrication à la commande) de l'entrepôt" +msgstr "" +"Ne trouve pas la règle MTO (Make To Order: Fabrication à la commande) de " +"l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" -msgstr "Ne trouve pas la règle MTS (Make To Stock: produit géré en stock) de l'entrepôt" +msgstr "" +"Ne trouve pas la règle MTS (Make To Stock: produit géré en stock) de " +"l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Aucune règle par défaut MTS+MTO configurée. " #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" -msgstr "Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To Order: Produit fabriqué à la commande). " +msgstr "" +"Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To " +"Order: Produit fabriqué à la commande). " #. module: stock_mts_mto_rule -#: help:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be" " created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" -msgstr "Si cette nouvelle route est sélectionnée sur la vue formulaire du produit, une commande d'achat sera créée seulement si le stock virtuel est inférieur à 0, sinon, le produit sera pris en stock." +msgstr "" +"Si cette nouvelle route est sélectionnée sur la vue formulaire du produit, " +"une commande d'achat sera créée seulement si le stock virtuel est inférieur " +"à 0, sinon, le produit sera pris en stock." #. module: stock_mts_mto_rule -#: field:procurement.rule,mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" msgstr "MTO (Fab. à la demande)" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mts_mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: field:procurement.rule,mts_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" msgstr "MTS: Produit stocké" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 #, python-format msgid "MTS+MTO" msgstr "" @@ -76,6 +85,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_order msgid "Procurement" @@ -87,7 +101,12 @@ msgid "Procurement Rule" msgstr "" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index bd7b21544..32f7479d6 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -3,15 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-24 09:07+0000\n" -"PO-Revision-Date: 2015-10-23 12:22+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/sl/)\n" +"POT-Creation-Date: 2016-11-26 03:39+0000\n" +"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"Last-Translator: OCA Transbot , 2016\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" @@ -19,54 +19,57 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:53 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "Za skladišče ni pravila 'po naročilu'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:60 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "Za skladišče ni pravila 'na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:49 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Ni generične proge 'na zalogo' + 'po naročilu'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:36 +#: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" #. module: stock_mts_mto_rule -#: help:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be" " created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" -msgstr "Če je na prikazu obrazca proizvoda izbrana ta proga, se nabavni nalog ustvari le, če je navidezna zaloga manj od 0. V nasprotnem primeru se proizvod vzame iz zaloge." +msgstr "" +"Če je na prikazu obrazca proizvoda izbrana ta proga, se nabavni nalog " +"ustvari le, če je navidezna zaloga manj od 0. V nasprotnem primeru se " +"proizvod vzame iz zaloge." #. module: stock_mts_mto_rule -#: field:procurement.rule,mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" msgstr "Pravilo 'Po naročilu'" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mts_mto_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" msgstr "Pravilo 'Po naročilu' + 'Na zalogo'" #. module: stock_mts_mto_rule -#: field:procurement.rule,mts_rule_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" msgstr "Pravilo 'Na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:63 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 #, python-format msgid "MTS+MTO" msgstr "Na zalogo + Po naročilu" @@ -77,7 +80,7 @@ msgid "Make To Order + Make To Stock" msgstr "Naredi po naročilu + Naredi na zalogo" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_id:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id msgid "Mto+Mts Procurement" msgstr "Oskrbovanja 'po naročilu'+'na zalogo'" @@ -92,12 +95,12 @@ msgid "Procurement Rule" msgstr "Oskrbovalno pravilo" #. module: stock_mts_mto_rule -#: field:procurement.order,mts_mto_procurement_ids:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids msgid "Procurements" msgstr "Oskrbovanja" #. module: stock_mts_mto_rule -#: field:stock.warehouse,mto_mts_management:0 +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" msgstr "Uporabi pravila Po naročilu + Na zalogo" From 9acca99c7c2dcc7aa997ad079d4854ce1d72fb7c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 31 Mar 2017 10:32:38 +0200 Subject: [PATCH 22/36] [FIX] stock_mts_mto_rule: Don't fail on renaming WH code There's a traceback when renaming warehouse code (without renaming warehouse name), as name argument is False. --- stock_mts_mto_rule/model/warehouse.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index 7b30aad84..20105f700 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -129,13 +129,14 @@ class Warehouse(models.Model): @api.multi def _update_name_and_code(self, name, code): res = super(Warehouse, self)._update_name_and_code(name, code) - - for warehouse in self: - if warehouse.mts_mto_rule_id: - warehouse.mts_mto_rule_id.name = ( - warehouse.mts_mto_rule_id.name.replace( - warehouse.name, name, 1) + if not name: + return res + for warehouse in self.filtered('mts_mto_rule_id'): + warehouse.mts_mto_rule_id.name = ( + warehouse.mts_mto_rule_id.name.replace( + warehouse.name, name, 1, ) + ) return res def _get_route_name(self, route_type): From 38725b6268ba03d8b728337d9b640dd4061f3af7 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 2 May 2017 02:17:45 +0200 Subject: [PATCH 23/36] OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/de.po | 6 +- stock_mts_mto_rule/i18n/es_MX.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/fr.po | 10 +-- stock_mts_mto_rule/i18n/fr_FR.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/hr.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/it.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/nl.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/nl_NL.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/pt_BR.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/ro.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/sl.po | 6 +- stock_mts_mto_rule/i18n/vi_VN.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/zh_CN.po | 107 +++++++++++++++++++++++++++++++ 13 files changed, 1081 insertions(+), 11 deletions(-) create mode 100644 stock_mts_mto_rule/i18n/es_MX.po create mode 100644 stock_mts_mto_rule/i18n/fr_FR.po create mode 100644 stock_mts_mto_rule/i18n/hr.po create mode 100644 stock_mts_mto_rule/i18n/it.po create mode 100644 stock_mts_mto_rule/i18n/nl.po create mode 100644 stock_mts_mto_rule/i18n/nl_NL.po create mode 100644 stock_mts_mto_rule/i18n/pt_BR.po create mode 100644 stock_mts_mto_rule/i18n/ro.po create mode 100644 stock_mts_mto_rule/i18n/vi_VN.po create mode 100644 stock_mts_mto_rule/i18n/zh_CN.po diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index 052fddc9d..32c2eb0c4 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:39+0000\n" -"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"POT-Creation-Date: 2017-03-31 08:35+0000\n" +"PO-Revision-Date: 2017-03-31 08:35+0000\n" "Last-Translator: OCA Transbot , 2016\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" @@ -69,7 +69,7 @@ msgid "MTS Rule" msgstr "MTS-Regel" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" diff --git a/stock_mts_mto_rule/i18n/es_MX.po b/stock_mts_mto_rule/i18n/es_MX.po new file mode 100644 index 000000000..bcc50702b --- /dev/null +++ b/stock_mts_mto_rule/i18n/es_MX.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Contratación" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index 4c9077130..3f396970d 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:39+0000\n" -"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+0000\n" "Last-Translator: OCA Transbot , 2016\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" @@ -75,7 +75,7 @@ msgid "MTS Rule" msgstr "MTS: Produit stocké" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 #, python-format msgid "MTS+MTO" msgstr "" @@ -93,12 +93,12 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_order msgid "Procurement" -msgstr "" +msgstr "Procurement" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" -msgstr "" +msgstr "Règle d'approvisionnement" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids diff --git a/stock_mts_mto_rule/i18n/fr_FR.po b/stock_mts_mto_rule/i18n/fr_FR.po new file mode 100644 index 000000000..ae847b67a --- /dev/null +++ b/stock_mts_mto_rule/i18n/fr_FR.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr_FR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Entrepôt " diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po new file mode 100644 index 000000000..67a37da81 --- /dev/null +++ b/stock_mts_mto_rule/i18n/hr.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Nabava" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/it.po b/stock_mts_mto_rule/i18n/it.po new file mode 100644 index 000000000..ef2e2d11d --- /dev/null +++ b/stock_mts_mto_rule/i18n/it.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Approvvigionamento" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Regola d'Approvvigionamento" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Magazzino" diff --git a/stock_mts_mto_rule/i18n/nl.po b/stock_mts_mto_rule/i18n/nl.po new file mode 100644 index 000000000..deeecd85d --- /dev/null +++ b/stock_mts_mto_rule/i18n/nl.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Magazijn" diff --git a/stock_mts_mto_rule/i18n/nl_NL.po b/stock_mts_mto_rule/i18n/nl_NL.po new file mode 100644 index 000000000..b55e05fcf --- /dev/null +++ b/stock_mts_mto_rule/i18n/nl_NL.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-23 00:57+0000\n" +"PO-Revision-Date: 2017-06-23 00:57+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "Kies tussen MTS en MTO" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "MTO Regel" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "Op Order + Op Voorrad" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Magazijn" diff --git a/stock_mts_mto_rule/i18n/pt_BR.po b/stock_mts_mto_rule/i18n/pt_BR.po new file mode 100644 index 000000000..67e217e1d --- /dev/null +++ b/stock_mts_mto_rule/i18n/pt_BR.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Aprovisionamento" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "Armazém" diff --git a/stock_mts_mto_rule/i18n/ro.po b/stock_mts_mto_rule/i18n/ro.po new file mode 100644 index 000000000..8ad1b83e4 --- /dev/null +++ b/stock_mts_mto_rule/i18n/ro.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Aprovizionare" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index 32f7479d6..36d592fe6 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:39+0000\n" -"PO-Revision-Date: 2016-11-26 03:39+0000\n" +"POT-Creation-Date: 2017-03-31 08:35+0000\n" +"PO-Revision-Date: 2017-03-31 08:35+0000\n" "Last-Translator: OCA Transbot , 2016\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" @@ -69,7 +69,7 @@ msgid "MTS Rule" msgstr "Pravilo 'Na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 #, python-format msgid "MTS+MTO" msgstr "Na zalogo + Po naročilu" diff --git a/stock_mts_mto_rule/i18n/vi_VN.po b/stock_mts_mto_rule/i18n/vi_VN.po new file mode 100644 index 000000000..a932c78e7 --- /dev/null +++ b/stock_mts_mto_rule/i18n/vi_VN.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Mua sắm / Cung ứng" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/zh_CN.po b/stock_mts_mto_rule/i18n/zh_CN.po new file mode 100644 index 000000000..1c1f64b4e --- /dev/null +++ b/stock_mts_mto_rule/i18n/zh_CN.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-28 02:58+0000\n" +"PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "补货" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" From d4be9d65a45b297a0ab41a83b475759f7e9c3cd1 Mon Sep 17 00:00:00 2001 From: "Katherine Zaoral [Vauxoo]" Date: Fri, 1 Sep 2017 18:07:24 -0400 Subject: [PATCH 24/36] [FIX] _update_routes now handle multiple records (#325) This method is called from the write() method the one how support multiple records an api.multi method. I was making some test when I tried to activate the mto+mts option for multiple warehouse and the next error appears: ``ValueError: Expected singleton`` In order to fix this error I only added a loop to manage the multiple registers. --- stock_mts_mto_rule/model/warehouse.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/warehouse.py index 20105f700..7d6c9138c 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/warehouse.py @@ -150,13 +150,15 @@ class Warehouse(models.Model): def _update_routes(self): res = super(Warehouse, self)._update_routes() - mts_mto_rule_id = self.mts_mto_rule_id - if self.delivery_steps and mts_mto_rule_id: - pull_model = self.env['procurement.rule'] - self.mts_mto_rule_id.location_id = self.mto_pull_id.location_id - mts_rules = pull_model.search([ - ('location_src_id', '=', self.lot_stock_id.id), - ('route_id', '=', self.delivery_route_id.id), - ]) - self.mts_mto_rule_id.mts_rule_id = mts_rules[0].id + for warehouse in self: + mts_mto_rule_id = warehouse.mts_mto_rule_id + if warehouse.delivery_steps and mts_mto_rule_id: + pull_model = self.env['procurement.rule'] + warehouse.mts_mto_rule_id.location_id = \ + warehouse.mto_pull_id.location_id + mts_rules = pull_model.search([ + ('location_src_id', '=', warehouse.lot_stock_id.id), + ('route_id', '=', warehouse.delivery_route_id.id), + ]) + warehouse.mts_mto_rule_id.mts_rule_id = mts_rules[0].id return res From f8397db47f725a4d57db01eaa5ee6bcfcf2e5f3e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 2 Dec 2017 14:28:21 +0100 Subject: [PATCH 25/36] OCA Transbot updated translations from Transifex OCA Transbot updated translations from Transifex --- stock_mts_mto_rule/i18n/cs_CZ.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/de.po | 10 +-- stock_mts_mto_rule/i18n/es.po | 36 ++++++----- stock_mts_mto_rule/i18n/fr.po | 11 ++-- stock_mts_mto_rule/i18n/hr.po | 35 +++++----- stock_mts_mto_rule/i18n/pt_PT.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/sk.po | 107 +++++++++++++++++++++++++++++++ stock_mts_mto_rule/i18n/tr_TR.po | 107 +++++++++++++++++++++++++++++++ 8 files changed, 478 insertions(+), 42 deletions(-) create mode 100644 stock_mts_mto_rule/i18n/cs_CZ.po create mode 100644 stock_mts_mto_rule/i18n/pt_PT.po create mode 100644 stock_mts_mto_rule/i18n/sk.po create mode 100644 stock_mts_mto_rule/i18n/tr_TR.po diff --git a/stock_mts_mto_rule/i18n/cs_CZ.po b/stock_mts_mto_rule/i18n/cs_CZ.po new file mode 100644 index 000000000..4322ba4f3 --- /dev/null +++ b/stock_mts_mto_rule/i18n/cs_CZ.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: cs_CZ\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Zakázka" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "Pravidlo zadávání zakázek" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index 32c2eb0c4..2e2811c7d 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -3,14 +3,14 @@ # * stock_mts_mto_rule # # Translators: -# OCA Transbot , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-31 08:35+0000\n" -"PO-Revision-Date: 2017-03-31 08:35+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"POT-Creation-Date: 2017-11-30 03:53+0000\n" +"PO-Revision-Date: 2017-11-30 03:53+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" @@ -107,4 +107,4 @@ msgstr "Verwende MTO+MTS-Regeln" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" -msgstr "Warenlager" +msgstr "Lager" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index 1eb850dc8..d43b71ff1 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -3,14 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# OCA Transbot , 2016 +# OCA Transbot , 2017 +# Pedro M. Baeza , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-26 03:39+0000\n" -"PO-Revision-Date: 2016-11-26 03:39+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"POT-Creation-Date: 2017-11-30 03:53+0000\n" +"PO-Revision-Date: 2017-11-30 03:53+0000\n" +"Last-Translator: Pedro M. Baeza , 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" @@ -22,25 +23,27 @@ msgstr "" #: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" -msgstr "" +msgstr "No se puede encontrar un regla \"bajo pedido\" en el almacén" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" -msgstr "" +msgstr "No se puede encontrar una regla \"bajo existencias\" en el almacén" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" +"No se puede encontrar una regla genérica MTS+MTO - \"bajo existencias+bajo " +"pedido\"." #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" -msgstr "" +msgstr "Escoja entre \"bajo existencias\" o \"bajo pedido\"" #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management @@ -49,37 +52,40 @@ msgid "" " created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" +"Si se selecciona esta nueva ruta en la vista formulario de producto, se " +"creará un pedido de compra sólo si la cantidad virtual es menor de 0. Si no," +" se cogerá el producto desde existencias." #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" -msgstr "" +msgstr "Regla \"bajo pedido\"" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" -msgstr "" +msgstr "Regla MTO+MTS" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" -msgstr "" +msgstr "Regla \"bajo existencias\"" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:142 +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 #, python-format msgid "MTS+MTO" -msgstr "" +msgstr "MTS+MTO" #. module: stock_mts_mto_rule #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts msgid "Make To Order + Make To Stock" -msgstr "" +msgstr "Bajo pedido + bajo existencias" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id msgid "Mto+Mts Procurement" -msgstr "" +msgstr "Abastecimiento MTO+MTS" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_order @@ -99,7 +105,7 @@ msgstr "Abastecimientos" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" -msgstr "" +msgstr "Usar reglas MTO+MTS" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index 3f396970d..ba90b96a4 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -3,14 +3,15 @@ # * stock_mts_mto_rule # # Translators: -# OCA Transbot , 2016 +# OCA Transbot , 2017 +# Quentin THEURET , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-28 02:58+0000\n" -"PO-Revision-Date: 2017-07-28 02:58+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Quentin THEURET , 2018\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" @@ -103,7 +104,7 @@ msgstr "Règle d'approvisionnement" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids msgid "Procurements" -msgstr "" +msgstr "Approvisionnements" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po index 67a37da81..9a92b84c2 100644 --- a/stock_mts_mto_rule/i18n/hr.po +++ b/stock_mts_mto_rule/i18n/hr.po @@ -4,13 +4,14 @@ # # Translators: # OCA Transbot , 2017 +# Bole , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-28 02:58+0000\n" -"PO-Revision-Date: 2017-07-28 02:58+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Bole , 2018\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" @@ -22,25 +23,25 @@ msgstr "" #: code:addons/stock_mts_mto_rule/model/warehouse.py:36 #, python-format msgid "Can't find MTO Rule on the warehouse" -msgstr "" +msgstr "Nemogu naći MTO pravilo na skladištu" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/warehouse.py:43 #, python-format msgid "Can't find MTS Rule on the warehouse" -msgstr "" +msgstr "Nemogu naći MTO pravilo na skladištu" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/warehouse.py:32 #, python-format msgid "Can't find any generic MTS+MTO route." -msgstr "" +msgstr "Nemogu naći nijedno generičko MTO+MTS pravilo." #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/rule.py:18 #, python-format msgid "Choose between MTS and MTO" -msgstr "" +msgstr "Izaberite između MTO i MTS pravila" #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management @@ -53,33 +54,33 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" -msgstr "" +msgstr "MTO pravilo" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id msgid "MTO+MTS rule" -msgstr "" +msgstr "MTO+MTS pravilo" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id msgid "MTS Rule" -msgstr "" +msgstr "MTS pravilo" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/model/warehouse.py:143 #, python-format msgid "MTS+MTO" -msgstr "" +msgstr "MTS+MTO" #. module: stock_mts_mto_rule #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts msgid "Make To Order + Make To Stock" -msgstr "" +msgstr "Make To Order + Make To Stock" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id msgid "Mto+Mts Procurement" -msgstr "" +msgstr "Mto+Mts Nabava" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_order @@ -89,19 +90,19 @@ msgstr "Nabava" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" -msgstr "" +msgstr "Pavilo nabave" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids msgid "Procurements" -msgstr "" +msgstr "Nabave" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" -msgstr "" +msgstr "Koristi MTO+MTS pravila" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" -msgstr "" +msgstr "Skladište" diff --git a/stock_mts_mto_rule/i18n/pt_PT.po b/stock_mts_mto_rule/i18n/pt_PT.po new file mode 100644 index 000000000..7261608fb --- /dev/null +++ b/stock_mts_mto_rule/i18n/pt_PT.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/teams/23907/pt_PT/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Aquisições" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/sk.po b/stock_mts_mto_rule/i18n/sk.po new file mode 100644 index 000000000..14b5447f5 --- /dev/null +++ b/stock_mts_mto_rule/i18n/sk.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Obstarávanie" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" diff --git a/stock_mts_mto_rule/i18n/tr_TR.po b/stock_mts_mto_rule/i18n/tr_TR.po new file mode 100644 index 000000000..876b122b5 --- /dev/null +++ b/stock_mts_mto_rule/i18n/tr_TR.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: OCA Transbot , 2018\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=2; plural=(n > 1);\n" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/rule.py:18 +#, python-format +msgid "Choose between MTS and MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be" +" created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id +msgid "Mto+Mts Procurement" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order +msgid "Procurement" +msgstr "Satın alma" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids +msgid "Procurements" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" From 5cf543c7911fc0b0d90a7ea2e3679fffd4a056c3 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Wed, 14 Mar 2018 23:09:34 +0100 Subject: [PATCH 26/36] Migrate stock_mts_mto_rule to version 11 --- stock_mts_mto_rule/README.rst | 18 ++- stock_mts_mto_rule/__manifest__.py | 3 +- stock_mts_mto_rule/i18n/cs_CZ.po | 49 +++--- stock_mts_mto_rule/i18n/de.po | 59 ++++---- stock_mts_mto_rule/i18n/es.po | 63 ++++---- stock_mts_mto_rule/i18n/es_MX.po | 49 +++--- stock_mts_mto_rule/i18n/fr.po | 58 +++---- stock_mts_mto_rule/i18n/fr_FR.po | 46 +++--- stock_mts_mto_rule/i18n/hr.po | 62 ++++---- stock_mts_mto_rule/i18n/it.po | 46 +++--- stock_mts_mto_rule/i18n/nl.po | 43 +++--- stock_mts_mto_rule/i18n/nl_NL.po | 51 +++---- stock_mts_mto_rule/i18n/pt_BR.po | 49 +++--- stock_mts_mto_rule/i18n/pt_PT.po | 49 +++--- stock_mts_mto_rule/i18n/ro.po | 49 +++--- stock_mts_mto_rule/i18n/sk.po | 46 +++--- stock_mts_mto_rule/i18n/sl.po | 62 ++++---- .../i18n/stock_mts_mto_rule.pot | 91 +++++++++++ stock_mts_mto_rule/i18n/tr_TR.po | 49 +++--- stock_mts_mto_rule/i18n/vi_VN.po | 49 +++--- stock_mts_mto_rule/i18n/zh_CN.po | 49 +++--- stock_mts_mto_rule/model/__init__.py | 7 +- stock_mts_mto_rule/model/procurement.py | 103 ------------- stock_mts_mto_rule/model/procurement_rule.py | 70 +++++++++ stock_mts_mto_rule/model/rule.py | 19 --- .../{warehouse.py => stock_warehouse.py} | 45 ++---- .../tests/test_mto_mts_route.py | 141 +++++++++--------- stock_mts_mto_rule/view/pull_rule.xml | 2 +- 28 files changed, 709 insertions(+), 718 deletions(-) create mode 100644 stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot delete mode 100644 stock_mts_mto_rule/model/procurement.py create mode 100644 stock_mts_mto_rule/model/procurement_rule.py delete mode 100644 stock_mts_mto_rule/model/rule.py rename stock_mts_mto_rule/model/{warehouse.py => stock_warehouse.py} (75%) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 7ff843b93..6835c310c 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -1,5 +1,5 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl :alt: License: AGPL-3 ================== @@ -34,6 +34,11 @@ A sale Order is made for 3 products A. After validation, a purchase order with 2 products will be created. +Configuration +============= + +You have to select 'Use MTO+MTS rules' on the company's warehouse form. + Usage ===== @@ -42,12 +47,7 @@ You should not select both the mts+mto route and the mto route. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/10.0 - -Configuration -============= - -You have to select 'Use MTO+MTS rules' on the company's warehouse form. + :target: https://runbot.odoo-community.org/runbot/153/11.0 Known issues ============ @@ -74,6 +74,8 @@ Contributors * Florian da Costa +Do not contact contributors directly about support or help with technical issues. + Maintainer ---------- diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index ecccd1339..13ddfe770 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). {'name': 'Stock MTS+MTO Rule', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'license': 'AGPL-3', diff --git a/stock_mts_mto_rule/i18n/cs_CZ.po b/stock_mts_mto_rule/i18n/cs_CZ.po index 4322ba4f3..b30b6e245 100644 --- a/stock_mts_mto_rule/i18n/cs_CZ.po +++ b/stock_mts_mto_rule/i18n/cs_CZ.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # Lukáš Spurný , 2018 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2018-02-27 11:37+0000\n" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: Lukáš Spurný , 2018\n" -"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: cs_CZ\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Zakázka" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Pravidlo zadávání zakázek" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Zakázka" diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index 2e2811c7d..ed76ed6e4 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,47 +12,49 @@ msgstr "" "PO-Revision-Date: 2017-11-30 03:53+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "Kann MTO-Regel zum Lager nicht finden" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "Kann MTS-Regel zum Lager nicht finden" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Kann keine allg. MTO- oder MTS-Route finden" -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Wähle aus MTO und MTS" - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" "Wird diese neue Route in der Produktdetailsicht gewählt, wird eine " "Beschaffung nur dann bewirkt, wenn der Planbestand unter 0 fällt, " "anderenfalls wird das Produkt aus dem Bestand genommen." +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" @@ -69,7 +71,7 @@ msgid "MTS Rule" msgstr "MTS-Regel" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" @@ -80,25 +82,16 @@ msgid "Make To Order + Make To Stock" msgstr "MTO Auftragsfertigung + MTS Lagerfertigung" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "MTO+MTS-Beschaffung" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Beschaffung" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" +msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Beschaffungsregel" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "Beschaffungen" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -108,3 +101,15 @@ msgstr "Verwende MTO+MTS-Regeln" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Lager" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "Wähle aus MTO und MTS" + +#~ msgid "Mto+Mts Procurement" +#~ msgstr "MTO+MTS-Beschaffung" + +#~ msgid "Procurement" +#~ msgstr "Beschaffung" + +#~ msgid "Procurements" +#~ msgstr "Beschaffungen" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index d43b71ff1..2737734a5 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 # Pedro M. Baeza , 2017 @@ -13,48 +13,50 @@ msgstr "" "PO-Revision-Date: 2017-11-30 03:53+0000\n" "Last-Translator: Pedro M. Baeza , 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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "No se puede encontrar un regla \"bajo pedido\" en el almacén" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "No se puede encontrar una regla \"bajo existencias\" en el almacén" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" "No se puede encontrar una regla genérica MTS+MTO - \"bajo existencias+bajo " "pedido\"." -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Escoja entre \"bajo existencias\" o \"bajo pedido\"" - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" "Si se selecciona esta nueva ruta en la vista formulario de producto, se " -"creará un pedido de compra sólo si la cantidad virtual es menor de 0. Si no," -" se cogerá el producto desde existencias." +"creará un pedido de compra sólo si la cantidad virtual es menor de 0. Si no, " +"se cogerá el producto desde existencias." + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id @@ -72,7 +74,7 @@ msgid "MTS Rule" msgstr "Regla \"bajo existencias\"" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" @@ -83,25 +85,16 @@ msgid "Make To Order + Make To Stock" msgstr "Bajo pedido + bajo existencias" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "Abastecimiento MTO+MTS" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Abastecimiento" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" +msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Regla de abastecimiento" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "Abastecimientos" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -111,3 +104,15 @@ msgstr "Usar reglas MTO+MTS" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Almacén" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "Escoja entre \"bajo existencias\" o \"bajo pedido\"" + +#~ msgid "Mto+Mts Procurement" +#~ msgstr "Abastecimiento MTO+MTS" + +#~ msgid "Procurement" +#~ msgstr "Abastecimiento" + +#~ msgid "Procurements" +#~ msgstr "Abastecimientos" diff --git a/stock_mts_mto_rule/i18n/es_MX.po b/stock_mts_mto_rule/i18n/es_MX.po index bcc50702b..6138e4ee5 100644 --- a/stock_mts_mto_rule/i18n/es_MX.po +++ b/stock_mts_mto_rule/i18n/es_MX.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2017-07-28 02:58+0000\n" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Contratación" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Contratación" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index ba90b96a4..a6bede845 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 # Quentin THEURET , 2018 @@ -13,14 +13,14 @@ msgstr "" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: Quentin THEURET , 2018\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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" @@ -28,7 +28,7 @@ msgstr "" "l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" @@ -36,30 +36,30 @@ msgstr "" "l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Aucune règle par défaut MTS+MTO configurée. " -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "" -"Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To " -"Order: Produit fabriqué à la commande). " - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" "Si cette nouvelle route est sélectionnée sur la vue formulaire du produit, " "une commande d'achat sera créée seulement si le stock virtuel est inférieur " "à 0, sinon, le produit sera pris en stock." +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" @@ -76,7 +76,7 @@ msgid "MTS Rule" msgstr "MTS: Produit stocké" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -87,25 +87,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Procurement" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Règle d'approvisionnement" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "Approvisionnements" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -115,3 +106,14 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Entrepôt" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "" +#~ "Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To " +#~ "Order: Produit fabriqué à la commande). " + +#~ msgid "Procurement" +#~ msgstr "Procurement" + +#~ msgid "Procurements" +#~ msgstr "Approvisionnements" diff --git a/stock_mts_mto_rule/i18n/fr_FR.po b/stock_mts_mto_rule/i18n/fr_FR.po index ae847b67a..7391ed80c 100644 --- a/stock_mts_mto_rule/i18n/fr_FR.po +++ b/stock_mts_mto_rule/i18n/fr_FR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2017-07-28 02:58+0000\n" "PO-Revision-Date: 2017-07-28 02:58+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,13 +80,9 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule @@ -91,11 +90,6 @@ msgstr "" msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po index 9a92b84c2..b96b37f32 100644 --- a/stock_mts_mto_rule/i18n/hr.po +++ b/stock_mts_mto_rule/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 # Bole , 2018 @@ -13,44 +13,47 @@ msgstr "" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: Bole , 2018\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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "Nemogu naći MTO pravilo na skladištu" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "Nemogu naći MTO pravilo na skladištu" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Nemogu naći nijedno generičko MTO+MTS pravilo." -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Izaberite između MTO i MTS pravila" - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" @@ -67,7 +70,7 @@ msgid "MTS Rule" msgstr "MTS pravilo" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" @@ -78,25 +81,16 @@ msgid "Make To Order + Make To Stock" msgstr "Make To Order + Make To Stock" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "Mto+Mts Nabava" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Nabava" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" +msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Pavilo nabave" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "Nabave" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -106,3 +100,15 @@ msgstr "Koristi MTO+MTS pravila" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Skladište" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "Izaberite između MTO i MTS pravila" + +#~ msgid "Mto+Mts Procurement" +#~ msgstr "Mto+Mts Nabava" + +#~ msgid "Procurement" +#~ msgstr "Nabava" + +#~ msgid "Procurements" +#~ msgstr "Nabave" diff --git a/stock_mts_mto_rule/i18n/it.po b/stock_mts_mto_rule/i18n/it.po index ef2e2d11d..cc1b56b6e 100644 --- a/stock_mts_mto_rule/i18n/it.po +++ b/stock_mts_mto_rule/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,42 +12,44 @@ msgstr "" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +68,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +79,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Approvvigionamento" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Regola d'Approvvigionamento" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +98,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Magazzino" + +#~ msgid "Procurement" +#~ msgstr "Approvvigionamento" diff --git a/stock_mts_mto_rule/i18n/nl.po b/stock_mts_mto_rule/i18n/nl.po index deeecd85d..2226527b5 100644 --- a/stock_mts_mto_rule/i18n/nl.po +++ b/stock_mts_mto_rule/i18n/nl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,42 +12,44 @@ msgstr "" "PO-Revision-Date: 2017-07-28 02:58+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +68,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,13 +79,9 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule @@ -91,11 +89,6 @@ msgstr "" msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" diff --git a/stock_mts_mto_rule/i18n/nl_NL.po b/stock_mts_mto_rule/i18n/nl_NL.po index b55e05fcf..1965eca66 100644 --- a/stock_mts_mto_rule/i18n/nl_NL.po +++ b/stock_mts_mto_rule/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,45 +11,48 @@ msgstr "" "POT-Creation-Date: 2017-06-23 00:57+0000\n" "PO-Revision-Date: 2017-06-23 00:57+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Kies tussen MTS en MTO" - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,13 +80,9 @@ msgid "Make To Order + Make To Stock" msgstr "Op Order + Op Voorrad" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule @@ -91,11 +90,6 @@ msgstr "" msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Magazijn" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "Kies tussen MTS en MTO" diff --git a/stock_mts_mto_rule/i18n/pt_BR.po b/stock_mts_mto_rule/i18n/pt_BR.po index 67e217e1d..0a3ff66b6 100644 --- a/stock_mts_mto_rule/i18n/pt_BR.po +++ b/stock_mts_mto_rule/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2017-07-28 02:58+0000\n" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Aprovisionamento" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Armazém" + +#~ msgid "Procurement" +#~ msgstr "Aprovisionamento" diff --git a/stock_mts_mto_rule/i18n/pt_PT.po b/stock_mts_mto_rule/i18n/pt_PT.po index 7261608fb..fc38fce53 100644 --- a/stock_mts_mto_rule/i18n/pt_PT.po +++ b/stock_mts_mto_rule/i18n/pt_PT.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2018-02-27 11:37+0000\n" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: OCA Transbot , 2018\n" -"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/teams/23907/pt_PT/)\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/" +"teams/23907/pt_PT/)\n" +"Language: pt_PT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_PT\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Aquisições" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Aquisições" diff --git a/stock_mts_mto_rule/i18n/ro.po b/stock_mts_mto_rule/i18n/ro.po index 8ad1b83e4..3005a1938 100644 --- a/stock_mts_mto_rule/i18n/ro.po +++ b/stock_mts_mto_rule/i18n/ro.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,42 +12,45 @@ msgstr "" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Aprovizionare" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Aprovizionare" diff --git a/stock_mts_mto_rule/i18n/sk.po b/stock_mts_mto_rule/i18n/sk.po index 14b5447f5..6f437a897 100644 --- a/stock_mts_mto_rule/i18n/sk.po +++ b/stock_mts_mto_rule/i18n/sk.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,42 +12,44 @@ msgstr "" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"Language: sk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sk\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +68,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +79,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Obstarávanie" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +98,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Obstarávanie" diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index 36d592fe6..80ea7936a 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2016 msgid "" @@ -12,47 +12,50 @@ msgstr "" "PO-Revision-Date: 2017-03-31 08:35+0000\n" "Last-Translator: OCA Transbot , 2016\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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "Za skladišče ni pravila 'po naročilu'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "Za skladišče ni pravila 'na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "Ni generične proge 'na zalogo' + 'po naročilu'" -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" -msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" - #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" msgstr "" "Če je na prikazu obrazca proizvoda izbrana ta proga, se nabavni nalog " "ustvari le, če je navidezna zaloga manj od 0. V nasprotnem primeru se " "proizvod vzame iz zaloge." +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." +msgstr "" + #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id msgid "MTO Rule" @@ -69,7 +72,7 @@ msgid "MTS Rule" msgstr "Pravilo 'Na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "Na zalogo + Po naročilu" @@ -80,25 +83,16 @@ msgid "Make To Order + Make To Stock" msgstr "Naredi po naročilu + Naredi na zalogo" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" -msgstr "Oskrbovanja 'po naročilu'+'na zalogo'" - -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Oskrbovanje" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" +msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "Oskrbovalno pravilo" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "Oskrbovanja" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -108,3 +102,15 @@ msgstr "Uporabi pravila Po naročilu + Na zalogo" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Skladišče" + +#~ msgid "Choose between MTS and MTO" +#~ msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" + +#~ msgid "Mto+Mts Procurement" +#~ msgstr "Oskrbovanja 'po naročilu'+'na zalogo'" + +#~ msgid "Procurement" +#~ msgstr "Oskrbovanje" + +#~ msgid "Procurements" +#~ msgstr "Oskrbovanja" diff --git a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot new file mode 100644 index 000000000..d669ae7b1 --- /dev/null +++ b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_mts_mto_rule +# +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: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 +#, python-format +msgid "Can't find MTO Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 +#, python-format +msgid "Can't find MTS Rule on the warehouse" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 +#, python-format +msgid "Can't find any generic MTS+MTO route." +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "If this new route is selected on product form view, a purchase order will be created only if the virtual stock is less than 0 else, the product will be taken from stocks" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format +msgid "Inconsistency between the source locations of the mts and mto rules linked to the procurement rule: %s! It should be the same." +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +msgid "MTO Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +msgid "MTO+MTS rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +msgid "MTS Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#, python-format +msgid "MTS+MTO" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +msgid "Make To Order + Make To Stock" +msgstr "" + +#. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule +msgid "Procurement Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "Use MTO+MTS rules" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse +msgid "Warehouse" +msgstr "" + diff --git a/stock_mts_mto_rule/i18n/tr_TR.po b/stock_mts_mto_rule/i18n/tr_TR.po index 876b122b5..765725614 100644 --- a/stock_mts_mto_rule/i18n/tr_TR.po +++ b/stock_mts_mto_rule/i18n/tr_TR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2018-02-27 11:37+0000\n" "PO-Revision-Date: 2018-02-27 11:37+0000\n" "Last-Translator: OCA Transbot , 2018\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=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Satın alma" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Satın alma" diff --git a/stock_mts_mto_rule/i18n/vi_VN.po b/stock_mts_mto_rule/i18n/vi_VN.po index a932c78e7..74b2bbd2e 100644 --- a/stock_mts_mto_rule/i18n/vi_VN.po +++ b/stock_mts_mto_rule/i18n/vi_VN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2017-07-28 02:58+0000\n" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "Mua sắm / Cung ứng" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "Mua sắm / Cung ứng" diff --git a/stock_mts_mto_rule/i18n/zh_CN.po b/stock_mts_mto_rule/i18n/zh_CN.po index 1c1f64b4e..af7ff4c0d 100644 --- a/stock_mts_mto_rule/i18n/zh_CN.po +++ b/stock_mts_mto_rule/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_mts_mto_rule -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,43 +11,46 @@ msgstr "" "POT-Creation-Date: 2017-07-28 02:58+0000\n" "PO-Revision-Date: 2017-07-28 02:58+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: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:36 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 #, python-format msgid "Can't find MTO Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:43 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 #, python-format msgid "Can't find MTS Rule on the warehouse" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:32 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 #, python-format msgid "Can't find any generic MTS+MTO route." msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/rule.py:18 -#, python-format -msgid "Choose between MTS and MTO" +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +msgid "" +"If this new route is selected on product form view, a purchase order will be " +"created only if the virtual stock is less than 0 else, the product will be " +"taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#, python-format msgid "" -"If this new route is selected on product form view, a purchase order will be" -" created only if the virtual stock is less than 0 else, the product will be " -"taken from stocks" +"Inconsistency between the source locations of the mts and mto rules linked " +"to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule @@ -66,7 +69,7 @@ msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/warehouse.py:143 +#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 #, python-format msgid "MTS+MTO" msgstr "" @@ -77,25 +80,16 @@ msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_id -msgid "Mto+Mts Procurement" +#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#, python-format +msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_order -msgid "Procurement" -msgstr "补货" - #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule msgid "Procurement Rule" msgstr "" -#. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_order_mts_mto_procurement_ids -msgid "Procurements" -msgstr "" - #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management msgid "Use MTO+MTS rules" @@ -105,3 +99,6 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "" + +#~ msgid "Procurement" +#~ msgstr "补货" diff --git a/stock_mts_mto_rule/model/__init__.py b/stock_mts_mto_rule/model/__init__.py index cb1cbd4ab..727b200ed 100644 --- a/stock_mts_mto_rule/model/__init__.py +++ b/stock_mts_mto_rule/model/__init__.py @@ -1,5 +1,2 @@ -# -*- coding: utf-8 -*- - -from . import rule -from . import warehouse -from . import procurement +from . import procurement_rule +from . import stock_warehouse diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py deleted file mode 100644 index 24de0babc..000000000 --- a/stock_mts_mto_rule/model/procurement.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- coding: utf-8 -*- -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import api, fields, models - - -class ProcurementOrder(models.Model): - _inherit = 'procurement.order' - - mts_mto_procurement_id = fields.Many2one( - 'procurement.order', - string="Mto+Mts Procurement", - copy=False) - mts_mto_procurement_ids = fields.One2many( - 'procurement.order', - 'mts_mto_procurement_id', - string="Procurements") - - @api.multi - def get_mto_qty_to_order(self): - self.ensure_one() - stock_location = self.warehouse_id.lot_stock_id.id - proc_warehouse = self.with_context(location=stock_location) - virtual_available = proc_warehouse.product_id.virtual_available - qty_available = self.product_id.uom_id._compute_quantity( - virtual_available, self.product_uom) - - if qty_available > 0: - if qty_available >= self.product_qty: - return 0.0 - else: - return self.product_qty - qty_available - return self.product_qty - - @api.multi - def _get_mts_mto_procurement(self, rule, qty): - self.ensure_one() - origin = (self.group_id and (self.group_id.name + ":") or "") + \ - (self.rule_id and self.rule_id.name or self.origin or "/") - return { - 'name': self.name, - 'origin': origin, - 'product_qty': qty, - 'rule_id': rule.id, - 'mts_mto_procurement_id': self.id, - } - - @api.multi - def _check(self): - self.ensure_one() - if self.rule_id and \ - self.rule_id.action == 'split_procurement': - cancel_proc_list = [x.state == 'cancel' - for x in self.mts_mto_procurement_ids] - done_cancel_test_list = [ - x.state in ('done', 'cancel') - for x in self.mts_mto_procurement_ids] - if all(cancel_proc_list): - self.write({'state': 'cancel'}) - elif all(done_cancel_test_list): - return True - return super(ProcurementOrder, self)._check() - - @api.multi - def check(self, autocommit=False): - res = super(ProcurementOrder, self).check(autocommit=autocommit) - for procurement in self: - if procurement.mts_mto_procurement_id: - procurement.mts_mto_procurement_id.check( - autocommit=autocommit) - return res - - @api.multi - def _run(self): - self.ensure_one() - if self.rule_id and self.rule_id.action == 'split_procurement': - if self.mts_mto_procurement_ids: - return super(ProcurementOrder, self)._run() - needed_qty = self.get_mto_qty_to_order() - rule = self.rule_id - if needed_qty == 0.0: - mts_vals = self._get_mts_mto_procurement( - rule.mts_rule_id, self.product_qty) - mts_proc = self.copy(mts_vals) - mts_proc.run() - elif needed_qty == self.product_qty: - mto_vals = self._get_mts_mto_procurement( - rule.mto_rule_id, self.product_qty) - mto_proc = self.copy(mto_vals) - mto_proc.run() - else: - mts_qty = self.product_qty - needed_qty - mts_vals = self._get_mts_mto_procurement( - rule.mts_rule_id, mts_qty) - mts_proc = self.copy(mts_vals) - mts_proc.run() - - mto_vals = self._get_mts_mto_procurement( - rule.mto_rule_id, needed_qty) - mto_proc = self.copy(mto_vals) - mto_proc.run() - - return super(ProcurementOrder, self)._run() diff --git a/stock_mts_mto_rule/model/procurement_rule.py b/stock_mts_mto_rule/model/procurement_rule.py new file mode 100644 index 000000000..d4752e420 --- /dev/null +++ b/stock_mts_mto_rule/model/procurement_rule.py @@ -0,0 +1,70 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api, fields, _ +from odoo.exceptions import UserError + + +class ProcurementRule(models.Model): + _inherit = 'procurement.rule' + + action = fields.Selection( + selection_add=[('split_procurement', 'Choose between MTS and MTO')]) + mts_rule_id = fields.Many2one( + 'procurement.rule', string="MTS Rule") + mto_rule_id = fields.Many2one( + 'procurement.rule', string="MTO Rule") + + @api.constrains('action', 'mts_rule_id', 'mto_rule_id') + def _check_mts_mto_rule(self): + for rule in self: + if rule.action == 'split_procurement': + if not rule.mts_rule_id or not rule.mto_rule_id: + msg = _('No MTS or MTO rule configured on procurement ' + 'rule: %s!') % (rule.name, ) + raise UserError(msg) + if (rule.mts_rule_id.location_src_id.id != + rule.mto_rule_id.location_src_id.id): + msg = _('Inconsistency between the source locations of ' + 'the mts and mto rules linked to the procurement ' + 'rule: %s! It should be the same.') % (rule.name,) + raise UserError(msg) + + @api.multi + def get_mto_qty_to_order(self, product, product_qty, product_uom, values): + self.ensure_one() + src_location_id = self.mts_rule_id.location_src_id.id + product_location = product.with_context(location=src_location_id) + virtual_available = product_location.virtual_available + qty_available = product.uom_id._compute_quantity( + virtual_available, product_uom) + + if qty_available > 0: + if qty_available >= product_qty: + return 0.0 + else: + return product_qty - qty_available + return product_qty + + def _run_split_procurement(self, product_id, product_qty, product_uom, + location_id, name, origin, values): + + needed_qty = self.get_mto_qty_to_order(product_id, product_qty, + product_uom, values) + + if needed_qty == 0.0: + getattr(self.mts_rule_id, '_run_%s' % self.mts_rule_id.action)( + product_id, product_qty, product_uom, location_id, name, + origin, values) + elif needed_qty == product_qty: + getattr(self.mto_rule_id, '_run_%s' % self.mto_rule_id.action)( + product_id, product_qty, product_uom, location_id, name, + origin, values) + else: + mts_qty = product_qty - needed_qty + getattr(self.mts_rule_id, '_run_%s' % self.mts_rule_id.action)( + product_id, mts_qty, product_uom, location_id, name, origin, + values) + getattr(self.mto_rule_id, '_run_%s' % self.mto_rule_id.action)( + product_id, needed_qty, product_uom, location_id, name, + origin, values) + return True diff --git a/stock_mts_mto_rule/model/rule.py b/stock_mts_mto_rule/model/rule.py deleted file mode 100644 index 38c22b4c4..000000000 --- a/stock_mts_mto_rule/model/rule.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models, api, fields -from odoo.tools.translate import _ - - -class ProcurementRule(models.Model): - _inherit = 'procurement.rule' - - mts_rule_id = fields.Many2one('procurement.rule', - string="MTS Rule") - mto_rule_id = fields.Many2one('procurement.rule', - string="MTO Rule") - - @api.model - def _get_action(self): - return [('split_procurement', _('Choose between MTS and MTO'))] + \ - super(ProcurementRule, self)._get_action() diff --git a/stock_mts_mto_rule/model/warehouse.py b/stock_mts_mto_rule/model/stock_warehouse.py similarity index 75% rename from stock_mts_mto_rule/model/warehouse.py rename to stock_mts_mto_rule/model/stock_warehouse.py index 7d6c9138c..6e97d9c54 100644 --- a/stock_mts_mto_rule/model/warehouse.py +++ b/stock_mts_mto_rule/model/stock_warehouse.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, api, fields, exceptions from odoo.tools.translate import _ -class Warehouse(models.Model): +class StockWarehouse(models.Model): _inherit = 'stock.warehouse' mto_mts_management = fields.Boolean( @@ -57,41 +56,17 @@ class Warehouse(models.Model): """ Prevent changing standard MTO rules' action from "move" """ - pull_rules_list = super(Warehouse, self)._get_mto_pull_rules_values( - route_values) + pull_rules_list = super(StockWarehouse, self).\ + _get_mto_pull_rules_values(route_values) for pull_rule in pull_rules_list: pull_rule['action'] = 'move' return pull_rules_list - @api.multi - def _get_push_pull_rules_values( - self, route_values, values=None, push_values=None, - pull_values=None, name_suffix=''): - self.ensure_one() - pull_obj = self.env['procurement.rule'] - res = super(Warehouse, self)._get_push_pull_rules_values( - route_values, values=values, push_values=push_values, - pull_values=pull_values, name_suffix=name_suffix) - customer_location = self._get_partner_locations() - location_id = customer_location[0].id - if self.mto_mts_management: - for pull in res[1]: - if pull['location_id'] == location_id: - pull_mto_mts = pull.copy() - pull_mto_mts_id = pull_obj.create(pull_mto_mts) - pull.update({ - 'action': 'split_procurement', - 'mto_rule_id': pull_mto_mts_id.id, - 'mts_rule_id': pull_mto_mts_id.id, - 'sequence': 10 - }) - return res - @api.multi def create_routes(self): pull_model = self.env['procurement.rule'] - res = super(Warehouse, self).create_routes() + res = super(StockWarehouse, self).create_routes() if self.mto_mts_management: mts_mto_pull_vals = self._get_mts_mto_rule() mts_mto_pull = pull_model.create(mts_mto_pull_vals) @@ -112,14 +87,14 @@ class Warehouse(models.Model): for warehouse in self: if warehouse.mts_mto_rule_id: warehouse.mts_mto_rule_id.unlink() - res = super(Warehouse, self).write(vals) + res = super(StockWarehouse, self).write(vals) if 'mto_mts_management' in vals: self.with_context({'active_test': False})._update_routes() return res @api.model def get_all_routes_for_wh(self): - all_routes = super(Warehouse, self).get_all_routes_for_wh() + all_routes = super(StockWarehouse, self).get_all_routes_for_wh() if self.mto_mts_management and self.mts_mto_rule_id.route_id: all_routes += self.mts_mto_rule_id.route_id @@ -128,7 +103,7 @@ class Warehouse(models.Model): @api.multi def _update_name_and_code(self, name, code): - res = super(Warehouse, self)._update_name_and_code(name, code) + res = super(StockWarehouse, self)._update_name_and_code(name, code) if not name: return res for warehouse in self.filtered('mts_mto_rule_id'): @@ -144,12 +119,11 @@ class Warehouse(models.Model): if route_type in names: return names[route_type] - return super(Warehouse, self)._get_route_name(route_type) + return super(StockWarehouse, self)._get_route_name(route_type) @api.multi def _update_routes(self): - res = super(Warehouse, self)._update_routes() - + res = super(StockWarehouse, self)._update_routes() for warehouse in self: mts_mto_rule_id = warehouse.mts_mto_rule_id if warehouse.delivery_steps and mts_mto_rule_id: @@ -158,6 +132,7 @@ class Warehouse(models.Model): warehouse.mto_pull_id.location_id mts_rules = pull_model.search([ ('location_src_id', '=', warehouse.lot_stock_id.id), + ('location_id', '=', warehouse.mto_pull_id.location_id.id), ('route_id', '=', warehouse.delivery_route_id.id), ]) warehouse.mts_mto_rule_id.mts_rule_id = mts_rules[0].id diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index ea24cf2ad..faa5c8c98 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -3,97 +3,74 @@ from odoo import exceptions from odoo.tests.common import TransactionCase -from datetime import datetime class TestMtoMtsRoute(TransactionCase): - def _procurement_create(self): - self.procurement = self.env['procurement.order'].create({ - 'location_id': self.env.ref('stock.stock_location_customers').id, + def _create_quant(self, qty): + self.quant = self.env['stock.quant'].create({ + 'owner_id': self.company_partner.id, + 'location_id': self.env.ref('stock.stock_location_stock').id, 'product_id': self.product.id, - 'product_qty': 2.0, - 'product_uom': 1, - 'warehouse_id': self.warehouse.id, - 'priority': '1', - 'date_planned': datetime.now().strftime("%Y-%m-%d %H:%M:%S"), - 'name': self.product.name, - 'origin': 'test', - 'group_id': self.group.id, + 'quantity': qty, }) def test_standard_mto_route(self): mto_route = self.env.ref('stock.route_warehouse0_mto') self.product.route_ids = [(6, 0, [mto_route.id])] - self._procurement_create() - self.assertEqual(self.warehouse.mto_pull_id, - self.procurement.rule_id) - self.assertEqual('make_to_order', - self.procurement.move_ids[0].procure_method) - self.assertEqual(self.procurement.product_qty, - self.procurement.move_ids[0].product_uom_qty) - self.assertEqual('waiting', - self.procurement.move_ids[0].state) + self.group.run(self.product, 2.0, self.uom, self.customer_loc, + self.product.name, 'test', self.procurement_vals) + moves = self.move_obj.search([('group_id', '=', self.group.id)]) + self.assertEqual(len(moves), 2) def test_standard_mts_route(self): - self._procurement_create() - procurement_id = self.procurement_obj.search([ - ('group_id', '=', self.procurement.group_id.id), - ('move_ids', '!=', False)], limit=1) - self.assertEqual('make_to_stock', - procurement_id.move_ids[0].procure_method) - self.assertEqual(self.procurement.product_qty, - procurement_id.move_ids[0].product_uom_qty) - self.assertEqual('confirmed', - procurement_id.move_ids[0].state) + self.group.run(self.product, 2.0, self.uom, self.customer_loc, + self.product.name, 'test', self.procurement_vals) + moves = self.move_obj.search([('group_id', '=', self.group.id)]) + self.assertEqual(len(moves), 1) def test_mts_mto_route_split(self): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.quant.qty = 1.0 - self._procurement_create() + self._create_quant(1.0) + self.group.run(self.product, 2.0, self.uom, self.customer_loc, + self.product.name, 'test', self.procurement_vals) moves = self.env['stock.move'].search( [('group_id', '=', self.group.id)]) - self.assertEqual(2, len(moves)) - self.assertEqual(1.0, moves[0].product_uom_qty) + self.assertEqual(3, len(moves)) + move_mts = self.env['stock.move'].search( + [('group_id', '=', self.group.id), + ('location_dest_id', '=', self.customer_loc.id), + ('procure_method', '=', 'make_to_stock')]) + self.assertEqual(1, len(move_mts)) + self.assertEqual(1.0, move_mts.product_uom_qty) + self.assertEqual('confirmed', move_mts.state) + move_mto = self.env['stock.move'].search( + [('group_id', '=', self.group.id), + ('location_dest_id', '=', self.customer_loc.id), + ('procure_method', '=', 'make_to_order')]) + self.assertEqual(1, len(move_mto)) + self.assertEqual('waiting', move_mto.state) - def test_mts_mto_route_split_done(self): + def test_mts_mto_route_mto_only(self): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.quant.qty = 1.0 - self._procurement_create() - self.assertEqual(self.procurement.state, 'running') - self.procurement.mts_mto_procurement_ids.mapped( - 'move_ids').action_done() - self.assertEqual(self.procurement.state, 'done') - - def test_mts_mto_route_split_cancel(self): - mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') - self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.quant.qty = 1.0 - self._procurement_create() - self.procurement.mts_mto_procurement_ids.cancel() - self.assertEqual(self.procurement.state, 'running') - self.procurement.check() - self.assertEqual(self.procurement.state, 'cancel') - - def test_mts_mto_route_mts_only(self): - mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') - self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.quant.qty = 0.0 - self._procurement_create() + self.group.run(self.product, 2.0, self.uom, self.customer_loc, + self.product.name, 'test', self.procurement_vals) moves = self.env['stock.move'].search( - [('group_id', '=', self.group.id)]) + [('group_id', '=', self.group.id), + ('location_dest_id', '=', self.customer_loc.id)]) self.assertEqual(1, len(moves)) self.assertEqual(2.0, moves[0].product_uom_qty) self.assertEqual('make_to_order', moves[0].procure_method) - def test_mts_mto_route_mto_only(self): + def test_mts_mto_route_mts_only(self): mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.quant.qty = 3.0 - self._procurement_create() + self._create_quant(3.0) + self.group.run(self.product, 2.0, self.uom, self.customer_loc, + self.product.name, 'test', self.procurement_vals) moves = self.env['stock.move'].search( [('group_id', '=', self.group.id)]) self.assertEqual(1, len(moves)) @@ -101,6 +78,14 @@ class TestMtoMtsRoute(TransactionCase): self.assertEqual('make_to_stock', moves[0].procure_method) + def test_mts_mto_rule_contrains(self): + rule = self.env['procurement.rule'].search( + [('action', '=', 'split_procurement')], limit=1) + with self.assertRaises(exceptions.ValidationError): + rule.write({'mts_rule_id': False}) + with self.assertRaises(exceptions.ValidationError): + rule.write({'mts_rule_id': self.dummy_rule.id}) + def test_mts_mto_route_mto_removed(self): self.env.ref('stock_mts_mto_rule.route_mto_mts').unlink() self.warehouse.mts_mto_rule_id = False @@ -159,18 +144,36 @@ class TestMtoMtsRoute(TransactionCase): def setUp(self): super(TestMtoMtsRoute, self).setUp() + self.move_obj = self.env['stock.move'] self.warehouse = self.env.ref('stock.warehouse0') + self.uom = self.env['product.uom'].browse(1) self.warehouse.mto_mts_management = True + self.customer_loc = self.env.ref('stock.stock_location_customers') self.product = self.env.ref('product.product_product_4') self.company_partner = self.env.ref('base.main_partner') - self.procurement_obj = self.env['procurement.order'] self.group = self.env['procurement.group'].create({ 'name': 'test', }) - - self.quant = self.env['stock.quant'].create({ - 'owner_id': self.company_partner.id, + self.procurement_vals = { + 'warehouse_id': self.warehouse, 'group_id': self.group + } + # Since mrp and purchase modules may not be installed, we need to + # create a dummy step to show that mts, mto, and mts+mto flows work. + # Else, if purchase/manufacture are not installed, the mto would fail. + route_vals = { + 'warehouse_selectable': True, + 'name': 'dummy route', + } + self.dummy_route = self.env['stock.location.route'].create(route_vals) + rule_vals = { 'location_id': self.env.ref('stock.stock_location_stock').id, - 'product_id': self.product.id, - 'qty': 0.0, - }) + 'location_src_id': self.env.ref( + 'stock.stock_location_suppliers').id, + 'action': 'move', + 'warehouse_id': self.warehouse.id, + 'picking_type_id': self.env.ref('stock.picking_type_out').id, + 'name': 'dummy rule', + 'route_id': self.dummy_route.id, + } + self.dummy_rule = self.env['procurement.rule'].create(rule_vals) + self.warehouse.write({'route_ids': [(4, self.dummy_route.id)]}) diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index 9504f205a..86ca018e3 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -4,7 +4,7 @@ procurement.rule.mts.mto procurement.rule - + Date: Wed, 3 Apr 2019 03:25:44 +0000 Subject: [PATCH 27/36] [ADD] icon.png --- stock_mts_mto_rule/static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 stock_mts_mto_rule/static/description/icon.png diff --git a/stock_mts_mto_rule/static/description/icon.png b/stock_mts_mto_rule/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 From 2179ae5cd9697ea3b5f999cde760e023d697c9f6 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 6 May 2019 07:57:07 -0700 Subject: [PATCH 28/36] [MIG] Migrate stock_mts_mto_rule to 12.0 Major changes to the way Warehouses update their routes/rules and self heal. Improved rule code to use `float_compare` and `float_is_zero`. --- stock_mts_mto_rule/README.rst | 3 +- stock_mts_mto_rule/__init__.py | 2 +- stock_mts_mto_rule/__manifest__.py | 36 +++-- stock_mts_mto_rule/i18n/cs_CZ.po | 57 ++++--- stock_mts_mto_rule/i18n/de.po | 75 ++++++---- stock_mts_mto_rule/i18n/es.po | 85 +++++++---- stock_mts_mto_rule/i18n/es_MX.po | 52 ++++--- stock_mts_mto_rule/i18n/fr.po | 81 ++++++---- stock_mts_mto_rule/i18n/fr_FR.po | 52 ++++--- stock_mts_mto_rule/i18n/hr.po | 75 ++++++---- stock_mts_mto_rule/i18n/it.po | 57 ++++--- stock_mts_mto_rule/i18n/nl.po | 52 ++++--- stock_mts_mto_rule/i18n/nl_NL.po | 57 ++++--- stock_mts_mto_rule/i18n/pt_BR.po | 52 ++++--- stock_mts_mto_rule/i18n/pt_PT.po | 52 ++++--- stock_mts_mto_rule/i18n/ro.po | 52 ++++--- stock_mts_mto_rule/i18n/sk.po | 52 ++++--- stock_mts_mto_rule/i18n/sl.po | 75 ++++++---- .../i18n/stock_mts_mto_rule.pot | 54 ++++--- stock_mts_mto_rule/i18n/tr_TR.po | 52 ++++--- stock_mts_mto_rule/i18n/vi_VN.po | 52 ++++--- stock_mts_mto_rule/i18n/zh_CN.po | 52 ++++--- stock_mts_mto_rule/model/__init__.py | 2 - stock_mts_mto_rule/model/stock_warehouse.py | 139 ------------------ stock_mts_mto_rule/models/__init__.py | 2 + .../stock_rule.py} | 33 +++-- stock_mts_mto_rule/models/stock_warehouse.py | 93 ++++++++++++ stock_mts_mto_rule/tests/__init__.py | 1 - .../tests/test_mto_mts_route.py | 40 ++--- stock_mts_mto_rule/view/pull_rule.xml | 8 +- 30 files changed, 891 insertions(+), 604 deletions(-) delete mode 100644 stock_mts_mto_rule/model/__init__.py delete mode 100644 stock_mts_mto_rule/model/stock_warehouse.py create mode 100644 stock_mts_mto_rule/models/__init__.py rename stock_mts_mto_rule/{model/procurement_rule.py => models/stock_rule.py} (73%) create mode 100644 stock_mts_mto_rule/models/stock_warehouse.py diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 6835c310c..098c2209e 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -47,7 +47,7 @@ You should not select both the mts+mto route and the mto route. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 + :target: https://runbot.odoo-community.org/runbot/153/12.0 Known issues ============ @@ -73,6 +73,7 @@ Contributors ------------ * Florian da Costa +* Jared Kipe Do not contact contributors directly about support or help with technical issues. diff --git a/stock_mts_mto_rule/__init__.py b/stock_mts_mto_rule/__init__.py index 9186ee3ad..0650744f6 100644 --- a/stock_mts_mto_rule/__init__.py +++ b/stock_mts_mto_rule/__init__.py @@ -1 +1 @@ -from . import model +from . import models diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 13ddfe770..87660811a 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -1,18 +1,22 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -{'name': 'Stock MTS+MTO Rule', - 'version': '11.0.1.0.0', - 'author': 'Akretion,Odoo Community Association (OCA)', - 'website': 'http://www.akretion.com', - 'license': 'AGPL-3', - 'category': 'Warehouse', - 'summary': 'Add a MTS+MTO route', - 'depends': ['stock', - ], - 'demo': [], - 'data': ['data/stock_data.xml', - 'view/pull_rule.xml', - 'view/warehouse.xml', - ], - 'installable': True, - } +{ + 'name': 'Stock MTS+MTO Rule', + 'summary': 'Add a MTS+MTO route', + 'version': '12.0.1.0.0', + 'development_status': 'Mature', + 'category': 'Warehouse', + 'website': 'https://github.com/OCA/stock-logistics-warehouse', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': [ + 'stock', + ], + 'data': [ + 'data/stock_data.xml', + 'view/pull_rule.xml', + 'view/warehouse.xml', + ], +} diff --git a/stock_mts_mto_rule/i18n/cs_CZ.po b/stock_mts_mto_rule/i18n/cs_CZ.po index b30b6e245..f12fbcc9f 100644 --- a/stock_mts_mto_rule/i18n/cs_CZ.po +++ b/stock_mts_mto_rule/i18n/cs_CZ.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Pravidlo zadávání zakázek" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" @@ -100,5 +114,8 @@ msgstr "" msgid "Warehouse" msgstr "" +#~ msgid "Procurement Rule" +#~ msgstr "Pravidlo zadávání zakázek" + #~ msgid "Procurement" #~ msgstr "Zakázka" diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index ed76ed6e4..a16248eee 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -19,25 +19,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" -msgstr "Kann MTO-Regel zum Lager nicht finden" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" -msgstr "Kann MTS-Regel zum Lager nicht finden" +#: selection:stock.rule,action:0 +msgid "Buy" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "Kann keine allg. MTO- oder MTS-Route finden" +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "Wähle aus MTO und MTS" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -48,7 +45,7 @@ msgstr "" "anderenfalls wird das Produkt aus dem Bestand genommen." #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -56,44 +53,63 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "MTO-Regel" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "MTO+MTS-Regel" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "MTS-Regel" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "MTO Auftragsfertigung + MTS Lagerfertigung" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Beschaffungsregel" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +#, fuzzy +#| msgid "MTS Rule" +msgid "Stock Rule" +msgstr "MTS-Regel" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "Verwende MTO+MTS-Regeln" @@ -102,8 +118,17 @@ msgstr "Verwende MTO+MTS-Regeln" msgid "Warehouse" msgstr "Lager" -#~ msgid "Choose between MTS and MTO" -#~ msgstr "Wähle aus MTO und MTS" +#~ msgid "Can't find MTO Rule on the warehouse" +#~ msgstr "Kann MTO-Regel zum Lager nicht finden" + +#~ msgid "Can't find MTS Rule on the warehouse" +#~ msgstr "Kann MTS-Regel zum Lager nicht finden" + +#~ msgid "Can't find any generic MTS+MTO route." +#~ msgstr "Kann keine allg. MTO- oder MTS-Route finden" + +#~ msgid "Procurement Rule" +#~ msgstr "Beschaffungsregel" #~ msgid "Mto+Mts Procurement" #~ msgstr "MTO+MTS-Beschaffung" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index 2737734a5..51963071d 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -20,27 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" -msgstr "No se puede encontrar un regla \"bajo pedido\" en el almacén" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" -msgstr "No se puede encontrar una regla \"bajo existencias\" en el almacén" - -#. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" -"No se puede encontrar una regla genérica MTS+MTO - \"bajo existencias+bajo " -"pedido\"." #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Buy" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "Escoja entre \"bajo existencias\" o \"bajo pedido\"" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -51,7 +46,7 @@ msgstr "" "se cogerá el producto desde existencias." #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -59,44 +54,63 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "Regla \"bajo pedido\"" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "Regla MTO+MTS" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "Regla \"bajo existencias\"" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "Bajo pedido + bajo existencias" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Regla de abastecimiento" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +#, fuzzy +#| msgid "MTS Rule" +msgid "Stock Rule" +msgstr "Regla \"bajo existencias\"" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "Usar reglas MTO+MTS" @@ -105,8 +119,19 @@ msgstr "Usar reglas MTO+MTS" msgid "Warehouse" msgstr "Almacén" -#~ msgid "Choose between MTS and MTO" -#~ msgstr "Escoja entre \"bajo existencias\" o \"bajo pedido\"" +#~ msgid "Can't find MTO Rule on the warehouse" +#~ msgstr "No se puede encontrar un regla \"bajo pedido\" en el almacén" + +#~ msgid "Can't find MTS Rule on the warehouse" +#~ msgstr "No se puede encontrar una regla \"bajo existencias\" en el almacén" + +#~ msgid "Can't find any generic MTS+MTO route." +#~ msgstr "" +#~ "No se puede encontrar una regla genérica MTS+MTO - \"bajo existencias" +#~ "+bajo pedido\"." + +#~ msgid "Procurement Rule" +#~ msgstr "Regla de abastecimiento" #~ msgid "Mto+Mts Procurement" #~ msgstr "Abastecimiento MTO+MTS" diff --git a/stock_mts_mto_rule/i18n/es_MX.po b/stock_mts_mto_rule/i18n/es_MX.po index 6138e4ee5..f570f064d 100644 --- a/stock_mts_mto_rule/i18n/es_MX.po +++ b/stock_mts_mto_rule/i18n/es_MX.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index a6bede845..9302faa70 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -20,29 +20,24 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" -"Ne trouve pas la règle MTO (Make To Order: Fabrication à la commande) de " -"l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" -"Ne trouve pas la règle MTS (Make To Stock: produit géré en stock) de " -"l'entrepôt" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "Aucune règle par défaut MTS+MTO configurée. " +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "" +"Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To " +"Order: Produit fabriqué à la commande). " #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -53,7 +48,7 @@ msgstr "" "à 0, sinon, le produit sera pris en stock." #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -61,44 +56,63 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "MTO (Fab. à la demande)" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "MTS: Produit stocké" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Règle d'approvisionnement" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +#, fuzzy +#| msgid "MTS Rule" +msgid "Stock Rule" +msgstr "MTS: Produit stocké" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" @@ -107,10 +121,21 @@ msgstr "" msgid "Warehouse" msgstr "Entrepôt" -#~ msgid "Choose between MTS and MTO" +#~ msgid "Can't find MTO Rule on the warehouse" #~ msgstr "" -#~ "Choisir entre MTS(Make To Stock: Produit géré en stock) et MTO(Make To " -#~ "Order: Produit fabriqué à la commande). " +#~ "Ne trouve pas la règle MTO (Make To Order: Fabrication à la commande) de " +#~ "l'entrepôt" + +#~ msgid "Can't find MTS Rule on the warehouse" +#~ msgstr "" +#~ "Ne trouve pas la règle MTS (Make To Stock: produit géré en stock) de " +#~ "l'entrepôt" + +#~ msgid "Can't find any generic MTS+MTO route." +#~ msgstr "Aucune règle par défaut MTS+MTO configurée. " + +#~ msgid "Procurement Rule" +#~ msgstr "Règle d'approvisionnement" #~ msgid "Procurement" #~ msgstr "Procurement" diff --git a/stock_mts_mto_rule/i18n/fr_FR.po b/stock_mts_mto_rule/i18n/fr_FR.po index 7391ed80c..d243f481b 100644 --- a/stock_mts_mto_rule/i18n/fr_FR.po +++ b/stock_mts_mto_rule/i18n/fr_FR.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po index b96b37f32..2872e6a0c 100644 --- a/stock_mts_mto_rule/i18n/hr.po +++ b/stock_mts_mto_rule/i18n/hr.po @@ -21,25 +21,22 @@ msgstr "" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" -msgstr "Nemogu naći MTO pravilo na skladištu" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" -msgstr "Nemogu naći MTO pravilo na skladištu" +#: selection:stock.rule,action:0 +msgid "Buy" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "Nemogu naći nijedno generičko MTO+MTS pravilo." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "Izaberite između MTO i MTS pravila" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -47,7 +44,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -55,44 +52,63 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "MTO pravilo" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "MTO+MTS pravilo" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "MTS pravilo" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "MTS+MTO" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "Make To Order + Make To Stock" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Pavilo nabave" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +#, fuzzy +#| msgid "MTS Rule" +msgid "Stock Rule" +msgstr "MTS pravilo" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "Koristi MTO+MTS pravila" @@ -101,8 +117,17 @@ msgstr "Koristi MTO+MTS pravila" msgid "Warehouse" msgstr "Skladište" -#~ msgid "Choose between MTS and MTO" -#~ msgstr "Izaberite između MTO i MTS pravila" +#~ msgid "Can't find MTO Rule on the warehouse" +#~ msgstr "Nemogu naći MTO pravilo na skladištu" + +#~ msgid "Can't find MTS Rule on the warehouse" +#~ msgstr "Nemogu naći MTO pravilo na skladištu" + +#~ msgid "Can't find any generic MTS+MTO route." +#~ msgstr "Nemogu naći nijedno generičko MTO+MTS pravilo." + +#~ msgid "Procurement Rule" +#~ msgstr "Pavilo nabave" #~ msgid "Mto+Mts Procurement" #~ msgstr "Mto+Mts Nabava" diff --git a/stock_mts_mto_rule/i18n/it.po b/stock_mts_mto_rule/i18n/it.po index cc1b56b6e..3da138d0b 100644 --- a/stock_mts_mto_rule/i18n/it.po +++ b/stock_mts_mto_rule/i18n/it.po @@ -19,25 +19,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -45,7 +42,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -53,44 +50,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Regola d'Approvvigionamento" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" @@ -99,5 +113,8 @@ msgstr "" msgid "Warehouse" msgstr "Magazzino" +#~ msgid "Procurement Rule" +#~ msgstr "Regola d'Approvvigionamento" + #~ msgid "Procurement" #~ msgstr "Approvvigionamento" diff --git a/stock_mts_mto_rule/i18n/nl.po b/stock_mts_mto_rule/i18n/nl.po index 2226527b5..38a4a00c2 100644 --- a/stock_mts_mto_rule/i18n/nl.po +++ b/stock_mts_mto_rule/i18n/nl.po @@ -19,25 +19,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -45,7 +42,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -53,44 +50,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/nl_NL.po b/stock_mts_mto_rule/i18n/nl_NL.po index 1965eca66..696c41af6 100644 --- a/stock_mts_mto_rule/i18n/nl_NL.po +++ b/stock_mts_mto_rule/i18n/nl_NL.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "" +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "Kies tussen MTS en MTO" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "MTO Regel" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "Op Order + Op Voorrad" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" @@ -99,6 +113,3 @@ msgstr "" #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" msgstr "Magazijn" - -#~ msgid "Choose between MTS and MTO" -#~ msgstr "Kies tussen MTS en MTO" diff --git a/stock_mts_mto_rule/i18n/pt_BR.po b/stock_mts_mto_rule/i18n/pt_BR.po index 0a3ff66b6..8d6fec33e 100644 --- a/stock_mts_mto_rule/i18n/pt_BR.po +++ b/stock_mts_mto_rule/i18n/pt_BR.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/pt_PT.po b/stock_mts_mto_rule/i18n/pt_PT.po index fc38fce53..e39386323 100644 --- a/stock_mts_mto_rule/i18n/pt_PT.po +++ b/stock_mts_mto_rule/i18n/pt_PT.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/ro.po b/stock_mts_mto_rule/i18n/ro.po index 3005a1938..49edc765f 100644 --- a/stock_mts_mto_rule/i18n/ro.po +++ b/stock_mts_mto_rule/i18n/ro.po @@ -20,25 +20,22 @@ msgstr "" "2:1));\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/sk.po b/stock_mts_mto_rule/i18n/sk.po index 6f437a897..2a2940a51 100644 --- a/stock_mts_mto_rule/i18n/sk.po +++ b/stock_mts_mto_rule/i18n/sk.po @@ -19,25 +19,22 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -45,7 +42,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -53,44 +50,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index 80ea7936a..b7c27243e 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -20,25 +20,22 @@ msgstr "" "%100==4 ? 2 : 3);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" -msgstr "Za skladišče ni pravila 'po naročilu'" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" -msgstr "Za skladišče ni pravila 'na zalogo'" +#: selection:stock.rule,action:0 +msgid "Buy" +msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." -msgstr "Ni generične proge 'na zalogo' + 'po naročilu'" +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" +msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -49,7 +46,7 @@ msgstr "" "proizvod vzame iz zaloge." #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -57,44 +54,63 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "Pravilo 'Po naročilu'" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "Pravilo 'Po naročilu' + 'Na zalogo'" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "Pravilo 'Na zalogo'" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "Na zalogo + Po naročilu" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "Naredi po naročilu + Naredi na zalogo" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" -msgstr "Oskrbovalno pravilo" +#: selection:stock.rule,action:0 +msgid "Pull & Push" +msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +#, fuzzy +#| msgid "MTS Rule" +msgid "Stock Rule" +msgstr "Pravilo 'Na zalogo'" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "Uporabi pravila Po naročilu + Na zalogo" @@ -103,8 +119,17 @@ msgstr "Uporabi pravila Po naročilu + Na zalogo" msgid "Warehouse" msgstr "Skladišče" -#~ msgid "Choose between MTS and MTO" -#~ msgstr "Izbira med 'Na zalogo' in 'Po naročilu'" +#~ msgid "Can't find MTO Rule on the warehouse" +#~ msgstr "Za skladišče ni pravila 'po naročilu'" + +#~ msgid "Can't find MTS Rule on the warehouse" +#~ msgstr "Za skladišče ni pravila 'na zalogo'" + +#~ msgid "Can't find any generic MTS+MTO route." +#~ msgstr "Ni generične proge 'na zalogo' + 'po naročilu'" + +#~ msgid "Procurement Rule" +#~ msgstr "Oskrbovalno pravilo" #~ msgid "Mto+Mts Procurement" #~ msgstr "Oskrbovanja 'po naročilu'+'na zalogo'" diff --git a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot index d669ae7b1..d1ba61c09 100644 --- a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot +++ b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,73 +14,87 @@ msgstr "" "Plural-Forms: \n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "If this new route is selected on product form view, a purchase order will be created only if the virtual stock is less than 0 else, the product will be taken from stocks" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "Inconsistency between the source locations of the mts and mto rules linked to the procurement rule: %s! It should be the same." msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/tr_TR.po b/stock_mts_mto_rule/i18n/tr_TR.po index 765725614..50680e639 100644 --- a/stock_mts_mto_rule/i18n/tr_TR.po +++ b/stock_mts_mto_rule/i18n/tr_TR.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/vi_VN.po b/stock_mts_mto_rule/i18n/vi_VN.po index 74b2bbd2e..51375f100 100644 --- a/stock_mts_mto_rule/i18n/vi_VN.po +++ b/stock_mts_mto_rule/i18n/vi_VN.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/i18n/zh_CN.po b/stock_mts_mto_rule/i18n/zh_CN.po index af7ff4c0d..70bbc4606 100644 --- a/stock_mts_mto_rule/i18n/zh_CN.po +++ b/stock_mts_mto_rule/i18n/zh_CN.po @@ -20,25 +20,22 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:35 -#, python-format -msgid "Can't find MTO Rule on the warehouse" +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action +msgid "Action" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:42 -#, python-format -msgid "Can't find MTS Rule on the warehouse" +#: selection:stock.rule,action:0 +msgid "Buy" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:31 -#, python-format -msgid "Can't find any generic MTS+MTO route." +#: selection:stock.rule,action:0 +msgid "Choose between MTS and MTO" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " @@ -46,7 +43,7 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:27 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 #, python-format msgid "" "Inconsistency between the source locations of the mts and mto rules linked " @@ -54,44 +51,61 @@ msgid "" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mts_mto_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_procurement_rule_mts_rule_id +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/stock_warehouse.py:118 +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" msgstr "" #. module: stock_mts_mto_rule +#: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts +#, python-format msgid "Make To Order + Make To Stock" msgstr "" #. module: stock_mts_mto_rule -#: code:addons/stock_mts_mto_rule/model/procurement_rule.py:22 +#: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model,name:stock_mts_mto_rule.model_procurement_rule -msgid "Procurement Rule" +#: selection:stock.rule,action:0 +msgid "Pull & Push" msgstr "" #. module: stock_mts_mto_rule -#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse_mto_mts_management +#: selection:stock.rule,action:0 +msgid "Pull From" +msgstr "" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Push To" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model,name:stock_mts_mto_rule.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: stock_mts_mto_rule +#: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" msgstr "" diff --git a/stock_mts_mto_rule/model/__init__.py b/stock_mts_mto_rule/model/__init__.py deleted file mode 100644 index 727b200ed..000000000 --- a/stock_mts_mto_rule/model/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from . import procurement_rule -from . import stock_warehouse diff --git a/stock_mts_mto_rule/model/stock_warehouse.py b/stock_mts_mto_rule/model/stock_warehouse.py deleted file mode 100644 index 6e97d9c54..000000000 --- a/stock_mts_mto_rule/model/stock_warehouse.py +++ /dev/null @@ -1,139 +0,0 @@ -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models, api, fields, exceptions -from odoo.tools.translate import _ - - -class StockWarehouse(models.Model): - _inherit = 'stock.warehouse' - - mto_mts_management = fields.Boolean( - 'Use MTO+MTS rules', - help='If this new route is selected on product form view, a ' - 'purchase order will be created only if the virtual stock is ' - 'less than 0 else, the product will be taken from stocks') - mts_mto_rule_id = fields.Many2one('procurement.rule', - 'MTO+MTS rule') - - @api.multi - def _get_mts_mto_rule(self): - self.ensure_one() - route_model = self.env['stock.location.route'] - pull_model = self.env['procurement.rule'] - try: - mts_mto_route = self.env.ref( - 'stock_mts_mto_rule.route_mto_mts') - except: - mts_mto_route = route_model.search([ - ('name', 'like', 'Make To Order + Make To Stock') - ]) - if not mts_mto_route: - raise exceptions.Warning(_( - 'Can\'t find any generic MTS+MTO route.')) - - if not self.mto_pull_id: - raise exceptions.Warning(_( - 'Can\'t find MTO Rule on the warehouse')) - - mts_rules = pull_model.search( - [('location_src_id', '=', self.lot_stock_id.id), - ('route_id', '=', self.delivery_route_id.id)]) - if not mts_rules: - raise exceptions.Warning(_( - 'Can\'t find MTS Rule on the warehouse')) - return { - 'name': self._format_routename(route_type='mts_mto'), - 'route_id': mts_mto_route.id, - 'action': 'split_procurement', - 'mto_rule_id': self.mto_pull_id.id, - 'mts_rule_id': mts_rules[0].id, - 'warehouse_id': self.id, - 'location_id': self.mto_pull_id.location_id.id, - 'picking_type_id': self.mto_pull_id.picking_type_id.id, - } - - def _get_mto_pull_rules_values(self, route_values): - """ - Prevent changing standard MTO rules' action from "move" - """ - pull_rules_list = super(StockWarehouse, self).\ - _get_mto_pull_rules_values(route_values) - for pull_rule in pull_rules_list: - pull_rule['action'] = 'move' - - return pull_rules_list - - @api.multi - def create_routes(self): - pull_model = self.env['procurement.rule'] - res = super(StockWarehouse, self).create_routes() - if self.mto_mts_management: - mts_mto_pull_vals = self._get_mts_mto_rule() - mts_mto_pull = pull_model.create(mts_mto_pull_vals) - res['mts_mto_rule_id'] = mts_mto_pull.id - return res - - @api.multi - def write(self, vals): - pull_model = self.env['procurement.rule'] - if 'mto_mts_management' in vals: - if vals.get("mto_mts_management"): - for warehouse in self: - if not warehouse.mts_mto_rule_id: - rule_vals = warehouse._get_mts_mto_rule() - mts_mto_pull = pull_model.create(rule_vals) - vals['mts_mto_rule_id'] = mts_mto_pull.id - else: - for warehouse in self: - if warehouse.mts_mto_rule_id: - warehouse.mts_mto_rule_id.unlink() - res = super(StockWarehouse, self).write(vals) - if 'mto_mts_management' in vals: - self.with_context({'active_test': False})._update_routes() - return res - - @api.model - def get_all_routes_for_wh(self): - all_routes = super(StockWarehouse, self).get_all_routes_for_wh() - - if self.mto_mts_management and self.mts_mto_rule_id.route_id: - all_routes += self.mts_mto_rule_id.route_id - - return all_routes - - @api.multi - def _update_name_and_code(self, name, code): - res = super(StockWarehouse, self)._update_name_and_code(name, code) - if not name: - return res - for warehouse in self.filtered('mts_mto_rule_id'): - warehouse.mts_mto_rule_id.name = ( - warehouse.mts_mto_rule_id.name.replace( - warehouse.name, name, 1, - ) - ) - return res - - def _get_route_name(self, route_type): - names = {'mts_mto': _('MTS+MTO')} - if route_type in names: - return names[route_type] - - return super(StockWarehouse, self)._get_route_name(route_type) - - @api.multi - def _update_routes(self): - res = super(StockWarehouse, self)._update_routes() - for warehouse in self: - mts_mto_rule_id = warehouse.mts_mto_rule_id - if warehouse.delivery_steps and mts_mto_rule_id: - pull_model = self.env['procurement.rule'] - warehouse.mts_mto_rule_id.location_id = \ - warehouse.mto_pull_id.location_id - mts_rules = pull_model.search([ - ('location_src_id', '=', warehouse.lot_stock_id.id), - ('location_id', '=', warehouse.mto_pull_id.location_id.id), - ('route_id', '=', warehouse.delivery_route_id.id), - ]) - warehouse.mts_mto_rule_id.mts_rule_id = mts_rules[0].id - return res diff --git a/stock_mts_mto_rule/models/__init__.py b/stock_mts_mto_rule/models/__init__.py new file mode 100644 index 000000000..58f5bc0da --- /dev/null +++ b/stock_mts_mto_rule/models/__init__.py @@ -0,0 +1,2 @@ +from . import stock_rule +from . import stock_warehouse diff --git a/stock_mts_mto_rule/model/procurement_rule.py b/stock_mts_mto_rule/models/stock_rule.py similarity index 73% rename from stock_mts_mto_rule/model/procurement_rule.py rename to stock_mts_mto_rule/models/stock_rule.py index d4752e420..eea219dcc 100644 --- a/stock_mts_mto_rule/model/procurement_rule.py +++ b/stock_mts_mto_rule/models/stock_rule.py @@ -1,18 +1,19 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, api, fields, _ -from odoo.exceptions import UserError +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError +from odoo.tools import float_compare, float_is_zero -class ProcurementRule(models.Model): - _inherit = 'procurement.rule' +class StockRule(models.Model): + _inherit = 'stock.rule' action = fields.Selection( selection_add=[('split_procurement', 'Choose between MTS and MTO')]) mts_rule_id = fields.Many2one( - 'procurement.rule', string="MTS Rule") + 'stock.rule', string="MTS Rule") mto_rule_id = fields.Many2one( - 'procurement.rule', string="MTO Rule") + 'stock.rule', string="MTO Rule") @api.constrains('action', 'mts_rule_id', 'mto_rule_id') def _check_mts_mto_rule(self): @@ -21,25 +22,27 @@ class ProcurementRule(models.Model): if not rule.mts_rule_id or not rule.mto_rule_id: msg = _('No MTS or MTO rule configured on procurement ' 'rule: %s!') % (rule.name, ) - raise UserError(msg) + raise ValidationError(msg) if (rule.mts_rule_id.location_src_id.id != rule.mto_rule_id.location_src_id.id): msg = _('Inconsistency between the source locations of ' 'the mts and mto rules linked to the procurement ' 'rule: %s! It should be the same.') % (rule.name,) - raise UserError(msg) + raise ValidationError(msg) @api.multi def get_mto_qty_to_order(self, product, product_qty, product_uom, values): self.ensure_one() + precision = self.env['decimal.precision']\ + .precision_get('Product Unit of Measure') src_location_id = self.mts_rule_id.location_src_id.id product_location = product.with_context(location=src_location_id) virtual_available = product_location.virtual_available qty_available = product.uom_id._compute_quantity( virtual_available, product_uom) - - if qty_available > 0: - if qty_available >= product_qty: + if float_compare(qty_available, 0.0, precision_digits=precision) > 0: + if float_compare(qty_available, product_qty, + precision_digits=precision) >= 0: return 0.0 else: return product_qty - qty_available @@ -47,15 +50,17 @@ class ProcurementRule(models.Model): def _run_split_procurement(self, product_id, product_qty, product_uom, location_id, name, origin, values): - + precision = self.env['decimal.precision']\ + .precision_get('Product Unit of Measure') needed_qty = self.get_mto_qty_to_order(product_id, product_qty, product_uom, values) - if needed_qty == 0.0: + if float_is_zero(needed_qty, precision_digits=precision): getattr(self.mts_rule_id, '_run_%s' % self.mts_rule_id.action)( product_id, product_qty, product_uom, location_id, name, origin, values) - elif needed_qty == product_qty: + elif float_compare(needed_qty, product_qty, + precision_digits=precision) == 0.0: getattr(self.mto_rule_id, '_run_%s' % self.mto_rule_id.action)( product_id, product_qty, product_uom, location_id, name, origin, values) diff --git a/stock_mts_mto_rule/models/stock_warehouse.py b/stock_mts_mto_rule/models/stock_warehouse.py new file mode 100644 index 000000000..ed8377bc9 --- /dev/null +++ b/stock_mts_mto_rule/models/stock_warehouse.py @@ -0,0 +1,93 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models, _ + + +class StockWarehouse(models.Model): + _inherit = 'stock.warehouse' + + mto_mts_management = fields.Boolean( + 'Use MTO+MTS rules', + help='If this new route is selected on product form view, a ' + 'purchase order will be created only if the virtual stock is ' + 'less than 0 else, the product will be taken from stocks') + mts_mto_rule_id = fields.Many2one('stock.rule', + 'MTO+MTS rule') + + def _get_all_routes(self): + routes = super(StockWarehouse, self)._get_all_routes() + routes |= self.mapped('mts_mto_rule_id.route_id') + return routes + + def _update_name_and_code(self, new_name=False, new_code=False): + res = super(StockWarehouse, self)._update_name_and_code(new_name, + new_code) + if not new_name: + return res + for warehouse in self.filtered('mts_mto_rule_id'): + warehouse.mts_mto_rule_id.write({ + 'name': warehouse.mts_mto_rule_id.name.replace(warehouse.name, + new_name, 1), + }) + return res + + def _get_route_name(self, route_type): + if route_type == 'mts_mto': + return _('MTS+MTO') + return super(StockWarehouse, self)._get_route_name(route_type) + + def _get_global_route_rules_values(self): + rule = self.get_rules_dict()[self.id][self.delivery_steps] + rule = [r for r in rule if r.from_loc == self.lot_stock_id][0] + location_id = rule.from_loc + location_dest_id = rule.dest_loc + picking_type_id = rule.picking_type + res = super(StockWarehouse, self)._get_global_route_rules_values() + res.update({ + 'mts_mto_rule_id': { + 'depends': ['delivery_steps', 'mto_mts_management'], + 'create_values': { + 'action': 'pull', + 'procure_method': 'make_to_order', + 'company_id': self.company_id.id, + 'auto': 'manual', + 'propagate': True, + 'route_id': self._find_global_route( + 'stock_mts_mto_rule.route_mto_mts', + _('Make To Order + Make To Stock')).id, + }, + 'update_values': { + 'active': self.mto_mts_management, + 'name': self._format_rulename(location_id, + location_dest_id, + 'MTS+MTO'), + 'location_id': location_dest_id.id, + 'location_src_id': location_id.id, + 'picking_type_id': picking_type_id.id, + } + }, + }) + return res + + def _create_or_update_global_routes_rules(self): + res = super(StockWarehouse, self)\ + ._create_or_update_global_routes_rules() + + if (self.mto_mts_management and self.mts_mto_rule_id + and self.mts_mto_rule_id.action != 'split_procurement'): + # Cannot create or update with the 'split_procurement' action due + # to constraint and the fact that the constrained rule_ids may + # not exist during the initial (or really any) calls of + # _get_global_route_rules_values + rule = self.env['stock.rule'].search([ + ('location_id', '=', self.mts_mto_rule_id.location_id.id), + ('location_src_id', '=', + self.mts_mto_rule_id.location_src_id.id), + ('route_id', '=', self.delivery_route_id.id), + ], limit=1) + self.mts_mto_rule_id.write({ + 'action': 'split_procurement', + 'mts_rule_id': rule.id, + 'mto_rule_id': self.mto_pull_id.id, + }) + return res diff --git a/stock_mts_mto_rule/tests/__init__.py b/stock_mts_mto_rule/tests/__init__.py index 96aebab0d..51420794c 100644 --- a/stock_mts_mto_rule/tests/__init__.py +++ b/stock_mts_mto_rule/tests/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import test_mto_mts_route diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index faa5c8c98..6f07eb7d9 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import exceptions @@ -79,7 +78,7 @@ class TestMtoMtsRoute(TransactionCase): moves[0].procure_method) def test_mts_mto_rule_contrains(self): - rule = self.env['procurement.rule'].search( + rule = self.env['stock.rule'].search( [('action', '=', 'split_procurement')], limit=1) with self.assertRaises(exceptions.ValidationError): rule.write({'mts_rule_id': False}) @@ -88,30 +87,32 @@ class TestMtoMtsRoute(TransactionCase): def test_mts_mto_route_mto_removed(self): self.env.ref('stock_mts_mto_rule.route_mto_mts').unlink() - self.warehouse.mts_mto_rule_id = False - with self.assertRaises(exceptions.Warning): - self.warehouse.mto_mts_management = True + with self.assertRaises(exceptions.UserError): + # mts_mto_rule_id is checked as a global rule + self.warehouse.mts_mto_rule_id = False def test_mts_mto_route_mts_removed(self): self.warehouse.mto_mts_management = True - self.env['procurement.rule'].search([ + rules = self.env['stock.rule'].search([ ('location_src_id', '=', self.warehouse.lot_stock_id.id), ('route_id', '=', self.warehouse.delivery_route_id.id), - ]).unlink() + ]) + self.env.cr.execute( + 'UPDATE stock_move SET rule_id = NULL WHERE rule_id IN %s', + (tuple(rules.ids), )) self.warehouse.mts_mto_rule_id = False - with self.assertRaises(exceptions.Warning): - self.warehouse.mto_mts_management = True + self.warehouse.mto_mts_management = True + self.assertTrue(self.warehouse.mts_mto_rule_id) def test_mts_mto_route_mto_no_mts_rule(self): self.warehouse.mts_mto_rule_id = False self.warehouse.mto_pull_id = False - with self.assertRaises(exceptions.Warning): - self.warehouse.mto_mts_management = True + self.warehouse.mto_mts_management = True + self.assertTrue(self.warehouse.mts_mto_rule_id) def test_create_routes(self): - rule_obj = self.env['procurement.rule'] - created_routes = self.warehouse.create_routes() - mts_mto_route = rule_obj.browse(created_routes['mts_mto_rule_id']) + self.warehouse._create_or_update_route() + mts_mto_route = self.warehouse.mts_mto_rule_id self.assertEqual(mts_mto_route.warehouse_id, self.warehouse) self.assertEqual( mts_mto_route.location_id, self.warehouse.mto_pull_id.location_id) @@ -126,11 +127,10 @@ class TestMtoMtsRoute(TransactionCase): warehouse_rule = self.warehouse.mts_mto_rule_id self.assertTrue(self.warehouse.mts_mto_rule_id) self.warehouse.mto_mts_management = False - self.assertFalse(warehouse_rule.exists()) - self.assertFalse(self.warehouse.mts_mto_rule_id) + self.assertFalse(warehouse_rule.active) def test_get_all_routes_for_wh(self): - routes = self.warehouse.get_all_routes_for_wh() + routes = self.warehouse._get_all_routes() self.assertTrue(self.warehouse.mts_mto_rule_id) self.assertTrue(self.warehouse.mts_mto_rule_id.route_id in routes) @@ -146,7 +146,7 @@ class TestMtoMtsRoute(TransactionCase): super(TestMtoMtsRoute, self).setUp() self.move_obj = self.env['stock.move'] self.warehouse = self.env.ref('stock.warehouse0') - self.uom = self.env['product.uom'].browse(1) + self.uom = self.env['uom.uom'].browse(1) self.warehouse.mto_mts_management = True self.customer_loc = self.env.ref('stock.stock_location_customers') self.product = self.env.ref('product.product_product_4') @@ -169,11 +169,11 @@ class TestMtoMtsRoute(TransactionCase): 'location_id': self.env.ref('stock.stock_location_stock').id, 'location_src_id': self.env.ref( 'stock.stock_location_suppliers').id, - 'action': 'move', + 'action': 'pull', 'warehouse_id': self.warehouse.id, 'picking_type_id': self.env.ref('stock.picking_type_out').id, 'name': 'dummy rule', 'route_id': self.dummy_route.id, } - self.dummy_rule = self.env['procurement.rule'].create(rule_vals) + self.dummy_rule = self.env['stock.rule'].create(rule_vals) self.warehouse.write({'route_ids': [(4, self.dummy_route.id)]}) diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index 86ca018e3..91722d6d3 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -1,10 +1,10 @@ - - procurement.rule.mts.mto - procurement.rule - + + stock.location.route.form.mts.mto + stock.location.route + Date: Tue, 2 Jul 2019 07:52:05 +0000 Subject: [PATCH 29/36] Translated using Weblate (French) Currently translated at 11.8% (2 of 17 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_mts_mto_rule Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_mts_mto_rule/fr_FR/ --- stock_mts_mto_rule/i18n/cs_CZ.po | 5 +++++ stock_mts_mto_rule/i18n/de.po | 5 +++++ stock_mts_mto_rule/i18n/es.po | 5 +++++ stock_mts_mto_rule/i18n/es_MX.po | 5 +++++ stock_mts_mto_rule/i18n/fr.po | 5 +++++ stock_mts_mto_rule/i18n/fr_FR.po | 12 +++++++++--- stock_mts_mto_rule/i18n/hr.po | 5 +++++ stock_mts_mto_rule/i18n/it.po | 5 +++++ stock_mts_mto_rule/i18n/nl.po | 5 +++++ stock_mts_mto_rule/i18n/nl_NL.po | 5 +++++ stock_mts_mto_rule/i18n/pt_BR.po | 5 +++++ stock_mts_mto_rule/i18n/pt_PT.po | 5 +++++ stock_mts_mto_rule/i18n/ro.po | 5 +++++ stock_mts_mto_rule/i18n/sk.po | 5 +++++ stock_mts_mto_rule/i18n/sl.po | 5 +++++ stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot | 5 +++++ stock_mts_mto_rule/i18n/tr_TR.po | 5 +++++ stock_mts_mto_rule/i18n/vi_VN.po | 5 +++++ stock_mts_mto_rule/i18n/zh_CN.po | 5 +++++ 19 files changed, 99 insertions(+), 3 deletions(-) diff --git a/stock_mts_mto_rule/i18n/cs_CZ.po b/stock_mts_mto_rule/i18n/cs_CZ.po index f12fbcc9f..430d4b29f 100644 --- a/stock_mts_mto_rule/i18n/cs_CZ.po +++ b/stock_mts_mto_rule/i18n/cs_CZ.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index a16248eee..14102e359 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -80,6 +80,11 @@ msgstr "MTS+MTO" msgid "Make To Order + Make To Stock" msgstr "MTO Auftragsfertigung + MTS Lagerfertigung" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index 51963071d..eb66c07cd 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -81,6 +81,11 @@ msgstr "MTS+MTO" msgid "Make To Order + Make To Stock" msgstr "Bajo pedido + bajo existencias" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/es_MX.po b/stock_mts_mto_rule/i18n/es_MX.po index f570f064d..2af486809 100644 --- a/stock_mts_mto_rule/i18n/es_MX.po +++ b/stock_mts_mto_rule/i18n/es_MX.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index 9302faa70..557cb0249 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -83,6 +83,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/fr_FR.po b/stock_mts_mto_rule/i18n/fr_FR.po index d243f481b..bd78ad46e 100644 --- a/stock_mts_mto_rule/i18n/fr_FR.po +++ b/stock_mts_mto_rule/i18n/fr_FR.po @@ -9,15 +9,16 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-28 02:58+0000\n" -"PO-Revision-Date: 2017-07-28 02:58+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2019-07-02 10:43+0000\n" +"Last-Translator: Julien Thomazeau \n" "Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" "fr_FR/)\n" "Language: fr_FR\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.7.1\n" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action @@ -76,6 +77,11 @@ msgstr "" #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts #, python-format msgid "Make To Order + Make To Stock" +msgstr "Production à la demande + Production sur stock" + +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" msgstr "" #. module: stock_mts_mto_rule diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po index 2872e6a0c..038f6d805 100644 --- a/stock_mts_mto_rule/i18n/hr.po +++ b/stock_mts_mto_rule/i18n/hr.po @@ -79,6 +79,11 @@ msgstr "MTS+MTO" msgid "Make To Order + Make To Stock" msgstr "Make To Order + Make To Stock" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/it.po b/stock_mts_mto_rule/i18n/it.po index 3da138d0b..2eb148751 100644 --- a/stock_mts_mto_rule/i18n/it.po +++ b/stock_mts_mto_rule/i18n/it.po @@ -77,6 +77,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/nl.po b/stock_mts_mto_rule/i18n/nl.po index 38a4a00c2..59a956b11 100644 --- a/stock_mts_mto_rule/i18n/nl.po +++ b/stock_mts_mto_rule/i18n/nl.po @@ -77,6 +77,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/nl_NL.po b/stock_mts_mto_rule/i18n/nl_NL.po index 696c41af6..5c2d73406 100644 --- a/stock_mts_mto_rule/i18n/nl_NL.po +++ b/stock_mts_mto_rule/i18n/nl_NL.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "Op Order + Op Voorrad" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/pt_BR.po b/stock_mts_mto_rule/i18n/pt_BR.po index 8d6fec33e..f405726b8 100644 --- a/stock_mts_mto_rule/i18n/pt_BR.po +++ b/stock_mts_mto_rule/i18n/pt_BR.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/pt_PT.po b/stock_mts_mto_rule/i18n/pt_PT.po index e39386323..d3ddb70b0 100644 --- a/stock_mts_mto_rule/i18n/pt_PT.po +++ b/stock_mts_mto_rule/i18n/pt_PT.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/ro.po b/stock_mts_mto_rule/i18n/ro.po index 49edc765f..b593efc11 100644 --- a/stock_mts_mto_rule/i18n/ro.po +++ b/stock_mts_mto_rule/i18n/ro.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/sk.po b/stock_mts_mto_rule/i18n/sk.po index 2a2940a51..567a455f8 100644 --- a/stock_mts_mto_rule/i18n/sk.po +++ b/stock_mts_mto_rule/i18n/sk.po @@ -77,6 +77,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index b7c27243e..a8e52ded5 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -81,6 +81,11 @@ msgstr "Na zalogo + Po naročilu" msgid "Make To Order + Make To Stock" msgstr "Naredi po naročilu + Naredi na zalogo" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot index d1ba61c09..8b2a8120c 100644 --- a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot +++ b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot @@ -67,6 +67,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/tr_TR.po b/stock_mts_mto_rule/i18n/tr_TR.po index 50680e639..2a12da600 100644 --- a/stock_mts_mto_rule/i18n/tr_TR.po +++ b/stock_mts_mto_rule/i18n/tr_TR.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/vi_VN.po b/stock_mts_mto_rule/i18n/vi_VN.po index 51375f100..8d79ba27e 100644 --- a/stock_mts_mto_rule/i18n/vi_VN.po +++ b/stock_mts_mto_rule/i18n/vi_VN.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format diff --git a/stock_mts_mto_rule/i18n/zh_CN.po b/stock_mts_mto_rule/i18n/zh_CN.po index 70bbc4606..2e99fb4cf 100644 --- a/stock_mts_mto_rule/i18n/zh_CN.po +++ b/stock_mts_mto_rule/i18n/zh_CN.po @@ -78,6 +78,11 @@ msgstr "" msgid "Make To Order + Make To Stock" msgstr "" +#. module: stock_mts_mto_rule +#: selection:stock.rule,action:0 +msgid "Manufacture" +msgstr "" + #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format From 4734a023dd49e5d805c36c9edf6061b23232da94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 10 Oct 2019 15:28:06 +0000 Subject: [PATCH 30/36] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (18 of 18 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_mts_mto_rule Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_mts_mto_rule/zh_CN/ --- stock_mts_mto_rule/i18n/zh_CN.po | 41 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/stock_mts_mto_rule/i18n/zh_CN.po b/stock_mts_mto_rule/i18n/zh_CN.po index 2e99fb4cf..b6c30d41e 100644 --- a/stock_mts_mto_rule/i18n/zh_CN.po +++ b/stock_mts_mto_rule/i18n/zh_CN.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-28 02:58+0000\n" -"PO-Revision-Date: 2017-07-28 02:58+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2019-10-10 17:37+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" "Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" "zh_CN/)\n" "Language: zh_CN\n" @@ -18,21 +18,22 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action msgid "Action" -msgstr "" +msgstr "动作" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Buy" -msgstr "" +msgstr "购买" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Choose between MTS and MTO" -msgstr "" +msgstr "在MTS和MTO之间选择" #. module: stock_mts_mto_rule #: model:ir.model.fields,help:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management @@ -40,7 +41,7 @@ msgid "" "If this new route is selected on product form view, a purchase order will be " "created only if the virtual stock is less than 0 else, the product will be " "taken from stocks" -msgstr "" +msgstr "如果在产品表单视图中选择了此新路线,则仅当虚拟库存小于0时才创建采购订单,否则将从库存中提取产品" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 @@ -48,76 +49,76 @@ msgstr "" msgid "" "Inconsistency between the source locations of the mts and mto rules linked " "to the procurement rule: %s! It should be the same." -msgstr "" +msgstr "链接到采购规则的MTS和MTO规则的源位置不一致:%s!应该是一样的。" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mto_rule_id msgid "MTO Rule" -msgstr "" +msgstr "MTO规则" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mts_mto_rule_id msgid "MTO+MTS rule" -msgstr "" +msgstr "MTO+MTS 规则" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__mts_rule_id msgid "MTS Rule" -msgstr "" +msgstr "MTS规则" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:36 #, python-format msgid "MTS+MTO" -msgstr "" +msgstr "MTS+MTO" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_warehouse.py:57 #: model:stock.location.route,name:stock_mts_mto_rule.route_mto_mts #, python-format msgid "Make To Order + Make To Stock" -msgstr "" +msgstr "按订单生产+按库存生产" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Manufacture" -msgstr "" +msgstr "制造" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:23 #, python-format msgid "No MTS or MTO rule configured on procurement rule: %s!" -msgstr "" +msgstr "采购规则上未配置MTS或MTO规则:%s!" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Pull & Push" -msgstr "" +msgstr "推拉" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Pull From" -msgstr "" +msgstr "拉" #. module: stock_mts_mto_rule #: selection:stock.rule,action:0 msgid "Push To" -msgstr "" +msgstr "推" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule msgid "Stock Rule" -msgstr "" +msgstr "库存规则" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management msgid "Use MTO+MTS rules" -msgstr "" +msgstr "使用MTO+MTS规则" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_warehouse msgid "Warehouse" -msgstr "" +msgstr "仓库" #~ msgid "Procurement" #~ msgstr "补货" From 1edaf1103465ec60b5f71ec772b5cc169363e237 Mon Sep 17 00:00:00 2001 From: Andrii Skrypka Date: Fri, 22 Nov 2019 15:33:32 +0200 Subject: [PATCH 31/36] [FIX] stock_mts_mto_rule: add mts_rule_id and mto_rule_id on stock rule form view --- stock_mts_mto_rule/view/pull_rule.xml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index 91722d6d3..a3e5843e4 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -7,10 +7,26 @@ - - + + + + + + stock.rule.form.mts.mto + stock.rule + + + + + From feb004f90495122d3cfa6318f0c37e0f2a9cd5f1 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 28 Nov 2019 08:44:40 +0000 Subject: [PATCH 32/36] stock_mts_mto_rule 12.0.1.0.1 --- stock_mts_mto_rule/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 87660811a..833093068 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Stock MTS+MTO Rule', 'summary': 'Add a MTS+MTO route', - 'version': '12.0.1.0.0', + 'version': '12.0.1.0.1', 'development_status': 'Mature', 'category': 'Warehouse', 'website': 'https://github.com/OCA/stock-logistics-warehouse', From cf9f04189ceaa060209e76b5da1332b1f2ecb294 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 20 Feb 2020 08:34:14 +0100 Subject: [PATCH 33/36] [IMP] stock_mts_mto_rule: Make tests resilient Using an already created product can lead to incorrect tests on integrated environments where other modules modify this product. We create a new one for avoiding this side effect. --- stock_mts_mto_rule/tests/test_mto_mts_route.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index 6f07eb7d9..f40e2433d 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -149,7 +149,10 @@ class TestMtoMtsRoute(TransactionCase): self.uom = self.env['uom.uom'].browse(1) self.warehouse.mto_mts_management = True self.customer_loc = self.env.ref('stock.stock_location_customers') - self.product = self.env.ref('product.product_product_4') + self.product = self.env['product.product'].create({ + 'name': 'Test product', + 'type': 'product', + }) self.company_partner = self.env.ref('base.main_partner') self.group = self.env['procurement.group'].create({ 'name': 'test', From 2d88894a0a9d7a7505c771d058e665427578f5a0 Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 11 Aug 2020 09:08:04 +0000 Subject: [PATCH 34/36] Translated using Weblate (Slovenian) Currently translated at 55.6% (10 of 18 strings) Translation: stock-logistics-warehouse-12.0/stock-logistics-warehouse-12.0-stock_mts_mto_rule Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_mts_mto_rule/sl/ --- stock_mts_mto_rule/i18n/de.po | 1 - stock_mts_mto_rule/i18n/es.po | 1 - stock_mts_mto_rule/i18n/fr.po | 1 - stock_mts_mto_rule/i18n/hr.po | 1 - stock_mts_mto_rule/i18n/sl.po | 15 +++++++-------- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/stock_mts_mto_rule/i18n/de.po b/stock_mts_mto_rule/i18n/de.po index 14102e359..58cab11e1 100644 --- a/stock_mts_mto_rule/i18n/de.po +++ b/stock_mts_mto_rule/i18n/de.po @@ -109,7 +109,6 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule #, fuzzy -#| msgid "MTS Rule" msgid "Stock Rule" msgstr "MTS-Regel" diff --git a/stock_mts_mto_rule/i18n/es.po b/stock_mts_mto_rule/i18n/es.po index eb66c07cd..40bfae467 100644 --- a/stock_mts_mto_rule/i18n/es.po +++ b/stock_mts_mto_rule/i18n/es.po @@ -110,7 +110,6 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule #, fuzzy -#| msgid "MTS Rule" msgid "Stock Rule" msgstr "Regla \"bajo existencias\"" diff --git a/stock_mts_mto_rule/i18n/fr.po b/stock_mts_mto_rule/i18n/fr.po index 557cb0249..ad099c56c 100644 --- a/stock_mts_mto_rule/i18n/fr.po +++ b/stock_mts_mto_rule/i18n/fr.po @@ -112,7 +112,6 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule #, fuzzy -#| msgid "MTS Rule" msgid "Stock Rule" msgstr "MTS: Produit stocké" diff --git a/stock_mts_mto_rule/i18n/hr.po b/stock_mts_mto_rule/i18n/hr.po index 038f6d805..03157b471 100644 --- a/stock_mts_mto_rule/i18n/hr.po +++ b/stock_mts_mto_rule/i18n/hr.po @@ -108,7 +108,6 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule #, fuzzy -#| msgid "MTS Rule" msgid "Stock Rule" msgstr "MTS pravilo" diff --git a/stock_mts_mto_rule/i18n/sl.po b/stock_mts_mto_rule/i18n/sl.po index a8e52ded5..79d416dc4 100644 --- a/stock_mts_mto_rule/i18n/sl.po +++ b/stock_mts_mto_rule/i18n/sl.po @@ -9,15 +9,16 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-03-31 08:35+0000\n" -"PO-Revision-Date: 2017-03-31 08:35+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"PO-Revision-Date: 2020-08-11 10:59+0000\n" +"Last-Translator: Matjaz Mozetic \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" -"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" +"X-Generator: Weblate 3.10\n" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_rule__action @@ -43,7 +44,7 @@ msgid "" msgstr "" "Če je na prikazu obrazca proizvoda izbrana ta proga, se nabavni nalog " "ustvari le, če je navidezna zaloga manj od 0. V nasprotnem primeru se " -"proizvod vzame iz zaloge." +"proizvod vzame iz zaloge" #. module: stock_mts_mto_rule #: code:addons/stock_mts_mto_rule/models/stock_rule.py:28 @@ -109,10 +110,8 @@ msgstr "" #. module: stock_mts_mto_rule #: model:ir.model,name:stock_mts_mto_rule.model_stock_rule -#, fuzzy -#| msgid "MTS Rule" msgid "Stock Rule" -msgstr "Pravilo 'Na zalogo'" +msgstr "Pravilo zalog" #. module: stock_mts_mto_rule #: model:ir.model.fields,field_description:stock_mts_mto_rule.field_stock_warehouse__mto_mts_management From d3f2b082a4bd47322ec6d58781f2b4f2c149b29d Mon Sep 17 00:00:00 2001 From: Deivis Laya Date: Fri, 18 Sep 2020 22:27:05 +0000 Subject: [PATCH 35/36] [IMP] stock_mts_mto_rule: black, isort, prettier --- .../odoo/addons/stock_mts_mto_rule | 1 + setup/stock_mts_mto_rule/setup.py | 6 + stock_mts_mto_rule/__manifest__.py | 30 +-- stock_mts_mto_rule/data/stock_data.xml | 7 +- stock_mts_mto_rule/models/stock_rule.py | 92 ++++---- stock_mts_mto_rule/models/stock_warehouse.py | 123 +++++----- .../tests/test_mto_mts_route.py | 221 ++++++++++-------- stock_mts_mto_rule/view/pull_rule.xml | 29 ++- stock_mts_mto_rule/view/warehouse.xml | 6 +- 9 files changed, 287 insertions(+), 228 deletions(-) create mode 120000 setup/stock_mts_mto_rule/odoo/addons/stock_mts_mto_rule create mode 100644 setup/stock_mts_mto_rule/setup.py diff --git a/setup/stock_mts_mto_rule/odoo/addons/stock_mts_mto_rule b/setup/stock_mts_mto_rule/odoo/addons/stock_mts_mto_rule new file mode 120000 index 000000000..de51d31cf --- /dev/null +++ b/setup/stock_mts_mto_rule/odoo/addons/stock_mts_mto_rule @@ -0,0 +1 @@ +../../../../stock_mts_mto_rule \ No newline at end of file diff --git a/setup/stock_mts_mto_rule/setup.py b/setup/stock_mts_mto_rule/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/stock_mts_mto_rule/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 833093068..661ee8950 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -1,22 +1,16 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Stock MTS+MTO Rule', - 'summary': 'Add a MTS+MTO route', - 'version': '12.0.1.0.1', - 'development_status': 'Mature', - 'category': 'Warehouse', - 'website': 'https://github.com/OCA/stock-logistics-warehouse', - 'author': 'Akretion,Odoo Community Association (OCA)', - 'license': 'AGPL-3', - 'application': False, - 'installable': True, - 'depends': [ - 'stock', - ], - 'data': [ - 'data/stock_data.xml', - 'view/pull_rule.xml', - 'view/warehouse.xml', - ], + "name": "Stock MTS+MTO Rule", + "summary": "Add a MTS+MTO route", + "version": "12.0.1.0.1", + "development_status": "Mature", + "category": "Warehouse", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "author": "Akretion,Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": ["stock",], + "data": ["data/stock_data.xml", "view/pull_rule.xml", "view/warehouse.xml",], } diff --git a/stock_mts_mto_rule/data/stock_data.xml b/stock_mts_mto_rule/data/stock_data.xml index 7b7dfb257..28fb7eac3 100644 --- a/stock_mts_mto_rule/data/stock_data.xml +++ b/stock_mts_mto_rule/data/stock_data.xml @@ -1,14 +1,11 @@ - + - - Make To Order + Make To Stock 5 - + - diff --git a/stock_mts_mto_rule/models/stock_rule.py b/stock_mts_mto_rule/models/stock_rule.py index eea219dcc..6d86fcc05 100644 --- a/stock_mts_mto_rule/models/stock_rule.py +++ b/stock_mts_mto_rule/models/stock_rule.py @@ -1,75 +1,83 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models from odoo.exceptions import ValidationError from odoo.tools import float_compare, float_is_zero class StockRule(models.Model): - _inherit = 'stock.rule' + _inherit = "stock.rule" action = fields.Selection( - selection_add=[('split_procurement', 'Choose between MTS and MTO')]) - mts_rule_id = fields.Many2one( - 'stock.rule', string="MTS Rule") - mto_rule_id = fields.Many2one( - 'stock.rule', string="MTO Rule") + selection_add=[("split_procurement", "Choose between MTS and MTO")] + ) + mts_rule_id = fields.Many2one("stock.rule", string="MTS Rule") + mto_rule_id = fields.Many2one("stock.rule", string="MTO Rule") - @api.constrains('action', 'mts_rule_id', 'mto_rule_id') + @api.constrains("action", "mts_rule_id", "mto_rule_id") def _check_mts_mto_rule(self): for rule in self: - if rule.action == 'split_procurement': + if rule.action == "split_procurement": if not rule.mts_rule_id or not rule.mto_rule_id: - msg = _('No MTS or MTO rule configured on procurement ' - 'rule: %s!') % (rule.name, ) + msg = _( + "No MTS or MTO rule configured on procurement " "rule: %s!" + ) % (rule.name,) raise ValidationError(msg) - if (rule.mts_rule_id.location_src_id.id != - rule.mto_rule_id.location_src_id.id): - msg = _('Inconsistency between the source locations of ' - 'the mts and mto rules linked to the procurement ' - 'rule: %s! It should be the same.') % (rule.name,) + if ( + rule.mts_rule_id.location_src_id.id + != rule.mto_rule_id.location_src_id.id + ): + msg = _( + "Inconsistency between the source locations of " + "the mts and mto rules linked to the procurement " + "rule: %s! It should be the same." + ) % (rule.name,) raise ValidationError(msg) @api.multi def get_mto_qty_to_order(self, product, product_qty, product_uom, values): self.ensure_one() - precision = self.env['decimal.precision']\ - .precision_get('Product Unit of Measure') + precision = self.env["decimal.precision"].precision_get( + "Product Unit of Measure" + ) src_location_id = self.mts_rule_id.location_src_id.id product_location = product.with_context(location=src_location_id) virtual_available = product_location.virtual_available - qty_available = product.uom_id._compute_quantity( - virtual_available, product_uom) + qty_available = product.uom_id._compute_quantity(virtual_available, product_uom) if float_compare(qty_available, 0.0, precision_digits=precision) > 0: - if float_compare(qty_available, product_qty, - precision_digits=precision) >= 0: + if ( + float_compare(qty_available, product_qty, precision_digits=precision) + >= 0 + ): return 0.0 else: return product_qty - qty_available return product_qty - def _run_split_procurement(self, product_id, product_qty, product_uom, - location_id, name, origin, values): - precision = self.env['decimal.precision']\ - .precision_get('Product Unit of Measure') - needed_qty = self.get_mto_qty_to_order(product_id, product_qty, - product_uom, values) + def _run_split_procurement( + self, product_id, product_qty, product_uom, location_id, name, origin, values + ): + precision = self.env["decimal.precision"].precision_get( + "Product Unit of Measure" + ) + needed_qty = self.get_mto_qty_to_order( + product_id, product_qty, product_uom, values + ) if float_is_zero(needed_qty, precision_digits=precision): - getattr(self.mts_rule_id, '_run_%s' % self.mts_rule_id.action)( - product_id, product_qty, product_uom, location_id, name, - origin, values) - elif float_compare(needed_qty, product_qty, - precision_digits=precision) == 0.0: - getattr(self.mto_rule_id, '_run_%s' % self.mto_rule_id.action)( - product_id, product_qty, product_uom, location_id, name, - origin, values) + getattr(self.mts_rule_id, "_run_%s" % self.mts_rule_id.action)( + product_id, product_qty, product_uom, location_id, name, origin, values + ) + elif float_compare(needed_qty, product_qty, precision_digits=precision) == 0.0: + getattr(self.mto_rule_id, "_run_%s" % self.mto_rule_id.action)( + product_id, product_qty, product_uom, location_id, name, origin, values + ) else: mts_qty = product_qty - needed_qty - getattr(self.mts_rule_id, '_run_%s' % self.mts_rule_id.action)( - product_id, mts_qty, product_uom, location_id, name, origin, - values) - getattr(self.mto_rule_id, '_run_%s' % self.mto_rule_id.action)( - product_id, needed_qty, product_uom, location_id, name, - origin, values) + getattr(self.mts_rule_id, "_run_%s" % self.mts_rule_id.action)( + product_id, mts_qty, product_uom, location_id, name, origin, values + ) + getattr(self.mto_rule_id, "_run_%s" % self.mto_rule_id.action)( + product_id, needed_qty, product_uom, location_id, name, origin, values + ) return True diff --git a/stock_mts_mto_rule/models/stock_warehouse.py b/stock_mts_mto_rule/models/stock_warehouse.py index ed8377bc9..5b7bc40f5 100644 --- a/stock_mts_mto_rule/models/stock_warehouse.py +++ b/stock_mts_mto_rule/models/stock_warehouse.py @@ -1,39 +1,41 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models, _ +from odoo import _, fields, models class StockWarehouse(models.Model): - _inherit = 'stock.warehouse' + _inherit = "stock.warehouse" mto_mts_management = fields.Boolean( - 'Use MTO+MTS rules', - help='If this new route is selected on product form view, a ' - 'purchase order will be created only if the virtual stock is ' - 'less than 0 else, the product will be taken from stocks') - mts_mto_rule_id = fields.Many2one('stock.rule', - 'MTO+MTS rule') + "Use MTO+MTS rules", + help="If this new route is selected on product form view, a " + "purchase order will be created only if the virtual stock is " + "less than 0 else, the product will be taken from stocks", + ) + mts_mto_rule_id = fields.Many2one("stock.rule", "MTO+MTS rule") def _get_all_routes(self): routes = super(StockWarehouse, self)._get_all_routes() - routes |= self.mapped('mts_mto_rule_id.route_id') + routes |= self.mapped("mts_mto_rule_id.route_id") return routes def _update_name_and_code(self, new_name=False, new_code=False): - res = super(StockWarehouse, self)._update_name_and_code(new_name, - new_code) + res = super(StockWarehouse, self)._update_name_and_code(new_name, new_code) if not new_name: return res - for warehouse in self.filtered('mts_mto_rule_id'): - warehouse.mts_mto_rule_id.write({ - 'name': warehouse.mts_mto_rule_id.name.replace(warehouse.name, - new_name, 1), - }) + for warehouse in self.filtered("mts_mto_rule_id"): + warehouse.mts_mto_rule_id.write( + { + "name": warehouse.mts_mto_rule_id.name.replace( + warehouse.name, new_name, 1 + ), + } + ) return res def _get_route_name(self, route_type): - if route_type == 'mts_mto': - return _('MTS+MTO') + if route_type == "mts_mto": + return _("MTS+MTO") return super(StockWarehouse, self)._get_route_name(route_type) def _get_global_route_rules_values(self): @@ -43,51 +45,60 @@ class StockWarehouse(models.Model): location_dest_id = rule.dest_loc picking_type_id = rule.picking_type res = super(StockWarehouse, self)._get_global_route_rules_values() - res.update({ - 'mts_mto_rule_id': { - 'depends': ['delivery_steps', 'mto_mts_management'], - 'create_values': { - 'action': 'pull', - 'procure_method': 'make_to_order', - 'company_id': self.company_id.id, - 'auto': 'manual', - 'propagate': True, - 'route_id': self._find_global_route( - 'stock_mts_mto_rule.route_mto_mts', - _('Make To Order + Make To Stock')).id, + res.update( + { + "mts_mto_rule_id": { + "depends": ["delivery_steps", "mto_mts_management"], + "create_values": { + "action": "pull", + "procure_method": "make_to_order", + "company_id": self.company_id.id, + "auto": "manual", + "propagate": True, + "route_id": self._find_global_route( + "stock_mts_mto_rule.route_mto_mts", + _("Make To Order + Make To Stock"), + ).id, + }, + "update_values": { + "active": self.mto_mts_management, + "name": self._format_rulename( + location_id, location_dest_id, "MTS+MTO" + ), + "location_id": location_dest_id.id, + "location_src_id": location_id.id, + "picking_type_id": picking_type_id.id, + }, }, - 'update_values': { - 'active': self.mto_mts_management, - 'name': self._format_rulename(location_id, - location_dest_id, - 'MTS+MTO'), - 'location_id': location_dest_id.id, - 'location_src_id': location_id.id, - 'picking_type_id': picking_type_id.id, - } - }, - }) + } + ) return res def _create_or_update_global_routes_rules(self): - res = super(StockWarehouse, self)\ - ._create_or_update_global_routes_rules() + res = super(StockWarehouse, self)._create_or_update_global_routes_rules() - if (self.mto_mts_management and self.mts_mto_rule_id - and self.mts_mto_rule_id.action != 'split_procurement'): + if ( + self.mto_mts_management + and self.mts_mto_rule_id + and self.mts_mto_rule_id.action != "split_procurement" + ): # Cannot create or update with the 'split_procurement' action due # to constraint and the fact that the constrained rule_ids may # not exist during the initial (or really any) calls of # _get_global_route_rules_values - rule = self.env['stock.rule'].search([ - ('location_id', '=', self.mts_mto_rule_id.location_id.id), - ('location_src_id', '=', - self.mts_mto_rule_id.location_src_id.id), - ('route_id', '=', self.delivery_route_id.id), - ], limit=1) - self.mts_mto_rule_id.write({ - 'action': 'split_procurement', - 'mts_rule_id': rule.id, - 'mto_rule_id': self.mto_pull_id.id, - }) + rule = self.env["stock.rule"].search( + [ + ("location_id", "=", self.mts_mto_rule_id.location_id.id), + ("location_src_id", "=", self.mts_mto_rule_id.location_src_id.id), + ("route_id", "=", self.delivery_route_id.id), + ], + limit=1, + ) + self.mts_mto_rule_id.write( + { + "action": "split_procurement", + "mts_rule_id": rule.id, + "mto_rule_id": self.mto_pull_id.id, + } + ) return res diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index f40e2433d..13ae60a11 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -5,101 +5,146 @@ from odoo.tests.common import TransactionCase class TestMtoMtsRoute(TransactionCase): - def _create_quant(self, qty): - self.quant = self.env['stock.quant'].create({ - 'owner_id': self.company_partner.id, - 'location_id': self.env.ref('stock.stock_location_stock').id, - 'product_id': self.product.id, - 'quantity': qty, - }) + self.quant = self.env["stock.quant"].create( + { + "owner_id": self.company_partner.id, + "location_id": self.env.ref("stock.stock_location_stock").id, + "product_id": self.product.id, + "quantity": qty, + } + ) def test_standard_mto_route(self): - mto_route = self.env.ref('stock.route_warehouse0_mto') + mto_route = self.env.ref("stock.route_warehouse0_mto") self.product.route_ids = [(6, 0, [mto_route.id])] - self.group.run(self.product, 2.0, self.uom, self.customer_loc, - self.product.name, 'test', self.procurement_vals) - moves = self.move_obj.search([('group_id', '=', self.group.id)]) + self.group.run( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.procurement_vals, + ) + moves = self.move_obj.search([("group_id", "=", self.group.id)]) self.assertEqual(len(moves), 2) def test_standard_mts_route(self): - self.group.run(self.product, 2.0, self.uom, self.customer_loc, - self.product.name, 'test', self.procurement_vals) - moves = self.move_obj.search([('group_id', '=', self.group.id)]) + self.group.run( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.procurement_vals, + ) + moves = self.move_obj.search([("group_id", "=", self.group.id)]) self.assertEqual(len(moves), 1) def test_mts_mto_route_split(self): - mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] self._create_quant(1.0) - self.group.run(self.product, 2.0, self.uom, self.customer_loc, - self.product.name, 'test', self.procurement_vals) - moves = self.env['stock.move'].search( - [('group_id', '=', self.group.id)]) + self.group.run( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.procurement_vals, + ) + moves = self.env["stock.move"].search([("group_id", "=", self.group.id)]) self.assertEqual(3, len(moves)) - move_mts = self.env['stock.move'].search( - [('group_id', '=', self.group.id), - ('location_dest_id', '=', self.customer_loc.id), - ('procure_method', '=', 'make_to_stock')]) + move_mts = self.env["stock.move"].search( + [ + ("group_id", "=", self.group.id), + ("location_dest_id", "=", self.customer_loc.id), + ("procure_method", "=", "make_to_stock"), + ] + ) self.assertEqual(1, len(move_mts)) self.assertEqual(1.0, move_mts.product_uom_qty) - self.assertEqual('confirmed', move_mts.state) - move_mto = self.env['stock.move'].search( - [('group_id', '=', self.group.id), - ('location_dest_id', '=', self.customer_loc.id), - ('procure_method', '=', 'make_to_order')]) + self.assertEqual("confirmed", move_mts.state) + move_mto = self.env["stock.move"].search( + [ + ("group_id", "=", self.group.id), + ("location_dest_id", "=", self.customer_loc.id), + ("procure_method", "=", "make_to_order"), + ] + ) self.assertEqual(1, len(move_mto)) - self.assertEqual('waiting', move_mto.state) + self.assertEqual("waiting", move_mto.state) def test_mts_mto_route_mto_only(self): - mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.group.run(self.product, 2.0, self.uom, self.customer_loc, - self.product.name, 'test', self.procurement_vals) - moves = self.env['stock.move'].search( - [('group_id', '=', self.group.id), - ('location_dest_id', '=', self.customer_loc.id)]) + self.group.run( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.procurement_vals, + ) + moves = self.env["stock.move"].search( + [ + ("group_id", "=", self.group.id), + ("location_dest_id", "=", self.customer_loc.id), + ] + ) self.assertEqual(1, len(moves)) self.assertEqual(2.0, moves[0].product_uom_qty) - self.assertEqual('make_to_order', - moves[0].procure_method) + self.assertEqual("make_to_order", moves[0].procure_method) def test_mts_mto_route_mts_only(self): - mto_mts_route = self.env.ref('stock_mts_mto_rule.route_mto_mts') + mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] self._create_quant(3.0) - self.group.run(self.product, 2.0, self.uom, self.customer_loc, - self.product.name, 'test', self.procurement_vals) - moves = self.env['stock.move'].search( - [('group_id', '=', self.group.id)]) + self.group.run( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.procurement_vals, + ) + moves = self.env["stock.move"].search([("group_id", "=", self.group.id)]) self.assertEqual(1, len(moves)) self.assertEqual(2.0, moves[0].product_uom_qty) - self.assertEqual('make_to_stock', - moves[0].procure_method) + self.assertEqual("make_to_stock", moves[0].procure_method) def test_mts_mto_rule_contrains(self): - rule = self.env['stock.rule'].search( - [('action', '=', 'split_procurement')], limit=1) + rule = self.env["stock.rule"].search( + [("action", "=", "split_procurement")], limit=1 + ) with self.assertRaises(exceptions.ValidationError): - rule.write({'mts_rule_id': False}) + rule.write({"mts_rule_id": False}) with self.assertRaises(exceptions.ValidationError): - rule.write({'mts_rule_id': self.dummy_rule.id}) + rule.write({"mts_rule_id": self.dummy_rule.id}) def test_mts_mto_route_mto_removed(self): - self.env.ref('stock_mts_mto_rule.route_mto_mts').unlink() + self.env.ref("stock_mts_mto_rule.route_mto_mts").unlink() with self.assertRaises(exceptions.UserError): # mts_mto_rule_id is checked as a global rule self.warehouse.mts_mto_rule_id = False def test_mts_mto_route_mts_removed(self): self.warehouse.mto_mts_management = True - rules = self.env['stock.rule'].search([ - ('location_src_id', '=', self.warehouse.lot_stock_id.id), - ('route_id', '=', self.warehouse.delivery_route_id.id), - ]) + rules = self.env["stock.rule"].search( + [ + ("location_src_id", "=", self.warehouse.lot_stock_id.id), + ("route_id", "=", self.warehouse.delivery_route_id.id), + ] + ) self.env.cr.execute( - 'UPDATE stock_move SET rule_id = NULL WHERE rule_id IN %s', - (tuple(rules.ids), )) + "UPDATE stock_move SET rule_id = NULL WHERE rule_id IN %s", + (tuple(rules.ids),), + ) self.warehouse.mts_mto_rule_id = False self.warehouse.mto_mts_management = True self.assertTrue(self.warehouse.mts_mto_rule_id) @@ -115,13 +160,14 @@ class TestMtoMtsRoute(TransactionCase): mts_mto_route = self.warehouse.mts_mto_rule_id self.assertEqual(mts_mto_route.warehouse_id, self.warehouse) self.assertEqual( - mts_mto_route.location_id, self.warehouse.mto_pull_id.location_id) + mts_mto_route.location_id, self.warehouse.mto_pull_id.location_id + ) self.assertEqual( - mts_mto_route.picking_type_id, - self.warehouse.mto_pull_id.picking_type_id) + mts_mto_route.picking_type_id, self.warehouse.mto_pull_id.picking_type_id + ) self.assertEqual( - mts_mto_route.route_id, - self.env.ref('stock_mts_mto_rule.route_mto_mts')) + mts_mto_route.route_id, self.env.ref("stock_mts_mto_rule.route_mto_mts") + ) def test_remove_mts_mto_management(self): warehouse_rule = self.warehouse.mts_mto_rule_id @@ -136,47 +182,40 @@ class TestMtoMtsRoute(TransactionCase): def test_rename_warehouse(self): rule_name = self.warehouse.mts_mto_rule_id.name - new_warehouse_name = 'NewName' - new_rule_name = rule_name.replace( - self.warehouse.name, new_warehouse_name, 1) + new_warehouse_name = "NewName" + new_rule_name = rule_name.replace(self.warehouse.name, new_warehouse_name, 1) self.warehouse.name = new_warehouse_name self.assertEqual(new_rule_name, self.warehouse.mts_mto_rule_id.name) def setUp(self): super(TestMtoMtsRoute, self).setUp() - self.move_obj = self.env['stock.move'] - self.warehouse = self.env.ref('stock.warehouse0') - self.uom = self.env['uom.uom'].browse(1) + self.move_obj = self.env["stock.move"] + self.warehouse = self.env.ref("stock.warehouse0") + self.uom = self.env["uom.uom"].browse(1) self.warehouse.mto_mts_management = True - self.customer_loc = self.env.ref('stock.stock_location_customers') - self.product = self.env['product.product'].create({ - 'name': 'Test product', - 'type': 'product', - }) - self.company_partner = self.env.ref('base.main_partner') - self.group = self.env['procurement.group'].create({ - 'name': 'test', - }) - self.procurement_vals = { - 'warehouse_id': self.warehouse, 'group_id': self.group - } + self.customer_loc = self.env.ref("stock.stock_location_customers") + self.product = self.env["product.product"].create( + {"name": "Test product", "type": "product",} + ) + self.company_partner = self.env.ref("base.main_partner") + self.group = self.env["procurement.group"].create({"name": "test",}) + self.procurement_vals = {"warehouse_id": self.warehouse, "group_id": self.group} # Since mrp and purchase modules may not be installed, we need to # create a dummy step to show that mts, mto, and mts+mto flows work. # Else, if purchase/manufacture are not installed, the mto would fail. route_vals = { - 'warehouse_selectable': True, - 'name': 'dummy route', + "warehouse_selectable": True, + "name": "dummy route", } - self.dummy_route = self.env['stock.location.route'].create(route_vals) + self.dummy_route = self.env["stock.location.route"].create(route_vals) rule_vals = { - 'location_id': self.env.ref('stock.stock_location_stock').id, - 'location_src_id': self.env.ref( - 'stock.stock_location_suppliers').id, - 'action': 'pull', - 'warehouse_id': self.warehouse.id, - 'picking_type_id': self.env.ref('stock.picking_type_out').id, - 'name': 'dummy rule', - 'route_id': self.dummy_route.id, + "location_id": self.env.ref("stock.stock_location_stock").id, + "location_src_id": self.env.ref("stock.stock_location_suppliers").id, + "action": "pull", + "warehouse_id": self.warehouse.id, + "picking_type_id": self.env.ref("stock.picking_type_out").id, + "name": "dummy rule", + "route_id": self.dummy_route.id, } - self.dummy_rule = self.env['stock.rule'].create(rule_vals) - self.warehouse.write({'route_ids': [(4, self.dummy_route.id)]}) + self.dummy_rule = self.env["stock.rule"].create(rule_vals) + self.warehouse.write({"route_ids": [(4, self.dummy_route.id)]}) diff --git a/stock_mts_mto_rule/view/pull_rule.xml b/stock_mts_mto_rule/view/pull_rule.xml index a3e5843e4..3117d7ba7 100644 --- a/stock_mts_mto_rule/view/pull_rule.xml +++ b/stock_mts_mto_rule/view/pull_rule.xml @@ -1,36 +1,41 @@ - + - stock.location.route.form.mts.mto stock.location.route - - + + attrs="{'invisible': [('action', '!=', 'split_procurement')]}" + /> - stock.rule.form.mts.mto stock.rule - - + + attrs="{'invisible': [('action', '!=', 'split_procurement')]}" + /> - diff --git a/stock_mts_mto_rule/view/warehouse.xml b/stock_mts_mto_rule/view/warehouse.xml index a0368b30c..0abc6e5d8 100644 --- a/stock_mts_mto_rule/view/warehouse.xml +++ b/stock_mts_mto_rule/view/warehouse.xml @@ -1,15 +1,13 @@ - + - view_warehouse_inherited stock.warehouse - + - From 1213385e6c2c33a7fc288cdc8297fa8fe3f34cc0 Mon Sep 17 00:00:00 2001 From: Deivis Laya Date: Sat, 19 Sep 2020 18:34:23 +0000 Subject: [PATCH 36/36] [MIG] stock_mts_mto_rule: Migration to 13.0 --- stock_mts_mto_rule/README.rst | 2 +- stock_mts_mto_rule/__manifest__.py | 6 +- .../i18n/stock_mts_mto_rule.pot | 2 +- stock_mts_mto_rule/models/stock_rule.py | 73 ++++++++---- stock_mts_mto_rule/models/stock_warehouse.py | 4 +- .../tests/test_mto_mts_route.py | 111 +++++++++++------- 6 files changed, 123 insertions(+), 75 deletions(-) diff --git a/stock_mts_mto_rule/README.rst b/stock_mts_mto_rule/README.rst index 098c2209e..38fb4659a 100644 --- a/stock_mts_mto_rule/README.rst +++ b/stock_mts_mto_rule/README.rst @@ -47,7 +47,7 @@ You should not select both the mts+mto route and the mto route. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/12.0 + :target: https://runbot.odoo-community.org/runbot/153/13.0 Known issues ============ diff --git a/stock_mts_mto_rule/__manifest__.py b/stock_mts_mto_rule/__manifest__.py index 661ee8950..138d0b159 100644 --- a/stock_mts_mto_rule/__manifest__.py +++ b/stock_mts_mto_rule/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Stock MTS+MTO Rule", "summary": "Add a MTS+MTO route", - "version": "12.0.1.0.1", + "version": "13.0.1.0.1", "development_status": "Mature", "category": "Warehouse", "website": "https://github.com/OCA/stock-logistics-warehouse", @@ -11,6 +11,6 @@ "license": "AGPL-3", "application": False, "installable": True, - "depends": ["stock",], - "data": ["data/stock_data.xml", "view/pull_rule.xml", "view/warehouse.xml",], + "depends": ["stock"], + "data": ["data/stock_data.xml", "view/pull_rule.xml", "view/warehouse.xml"], } diff --git a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot index 8b2a8120c..8a75668c9 100644 --- a/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot +++ b/stock_mts_mto_rule/i18n/stock_mts_mto_rule.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" diff --git a/stock_mts_mto_rule/models/stock_rule.py b/stock_mts_mto_rule/models/stock_rule.py index 6d86fcc05..e122a0cb8 100644 --- a/stock_mts_mto_rule/models/stock_rule.py +++ b/stock_mts_mto_rule/models/stock_rule.py @@ -2,6 +2,7 @@ from odoo import _, api, fields, models from odoo.exceptions import ValidationError +from odoo.osv import expression from odoo.tools import float_compare, float_is_zero @@ -11,8 +12,8 @@ class StockRule(models.Model): action = fields.Selection( selection_add=[("split_procurement", "Choose between MTS and MTO")] ) - mts_rule_id = fields.Many2one("stock.rule", string="MTS Rule") - mto_rule_id = fields.Many2one("stock.rule", string="MTO Rule") + mts_rule_id = fields.Many2one("stock.rule", string="MTS Rule", check_company=True) + mto_rule_id = fields.Many2one("stock.rule", string="MTO Rule", check_company=True) @api.constrains("action", "mts_rule_id", "mto_rule_id") def _check_mts_mto_rule(self): @@ -34,7 +35,6 @@ class StockRule(models.Model): ) % (rule.name,) raise ValidationError(msg) - @api.multi def get_mto_qty_to_order(self, product, product_qty, product_uom, values): self.ensure_one() precision = self.env["decimal.precision"].precision_get( @@ -54,30 +54,53 @@ class StockRule(models.Model): return product_qty - qty_available return product_qty - def _run_split_procurement( - self, product_id, product_qty, product_uom, location_id, name, origin, values - ): + def _run_split_procurement(self, procurements): precision = self.env["decimal.precision"].precision_get( "Product Unit of Measure" ) - needed_qty = self.get_mto_qty_to_order( - product_id, product_qty, product_uom, values - ) + for procurement, rule in procurements: + domain = self.env["procurement.group"]._get_moves_to_assign_domain( + procurement.company_id.id + ) + needed_qty = rule.get_mto_qty_to_order( + procurement.product_id, + procurement.product_qty, + procurement.product_uom, + procurement.values, + ) + if float_is_zero(needed_qty, precision_digits=precision): + getattr(self.env["stock.rule"], "_run_%s" % rule.mts_rule_id.action)( + [(procurement, rule.mts_rule_id)] + ) + elif ( + float_compare( + needed_qty, procurement.product_qty, precision_digits=precision + ) + == 0.0 + ): + getattr(self.env["stock.rule"], "_run_%s" % rule.mto_rule_id.action)( + [(procurement, rule.mto_rule_id)] + ) + else: + mts_qty = procurement.product_qty - needed_qty + mts_procurement = procurement._replace(product_qty=mts_qty) + getattr(self.env["stock.rule"], "_run_%s" % rule.mts_rule_id.action)( + [(mts_procurement, rule.mts_rule_id)] + ) - if float_is_zero(needed_qty, precision_digits=precision): - getattr(self.mts_rule_id, "_run_%s" % self.mts_rule_id.action)( - product_id, product_qty, product_uom, location_id, name, origin, values - ) - elif float_compare(needed_qty, product_qty, precision_digits=precision) == 0.0: - getattr(self.mto_rule_id, "_run_%s" % self.mto_rule_id.action)( - product_id, product_qty, product_uom, location_id, name, origin, values - ) - else: - mts_qty = product_qty - needed_qty - getattr(self.mts_rule_id, "_run_%s" % self.mts_rule_id.action)( - product_id, mts_qty, product_uom, location_id, name, origin, values - ) - getattr(self.mto_rule_id, "_run_%s" % self.mto_rule_id.action)( - product_id, needed_qty, product_uom, location_id, name, origin, values - ) + # Search all confirmed stock_moves of mts_procuremet and assign them + # to adjust the product's free qty + group_id = mts_procurement.values.get("group_id") + group_domain = expression.AND( + [domain, [("group_id", "=", group_id.id)]] + ) + moves_to_assign = self.env["stock.move"].search( + group_domain, order="priority desc, date_expected asc" + ) + moves_to_assign._action_assign() + + mto_procurement = procurement._replace(product_qty=needed_qty) + getattr(self.env["stock.rule"], "_run_%s" % rule.mto_rule_id.action)( + [(mto_procurement, rule.mto_rule_id)] + ) return True diff --git a/stock_mts_mto_rule/models/stock_warehouse.py b/stock_mts_mto_rule/models/stock_warehouse.py index 5b7bc40f5..c63675fab 100644 --- a/stock_mts_mto_rule/models/stock_warehouse.py +++ b/stock_mts_mto_rule/models/stock_warehouse.py @@ -12,7 +12,7 @@ class StockWarehouse(models.Model): "purchase order will be created only if the virtual stock is " "less than 0 else, the product will be taken from stocks", ) - mts_mto_rule_id = fields.Many2one("stock.rule", "MTO+MTS rule") + mts_mto_rule_id = fields.Many2one("stock.rule", "MTO+MTS rule", check_company=True) def _get_all_routes(self): routes = super(StockWarehouse, self)._get_all_routes() @@ -54,7 +54,7 @@ class StockWarehouse(models.Model): "procure_method": "make_to_order", "company_id": self.company_id.id, "auto": "manual", - "propagate": True, + "propagate_cancel": True, "route_id": self._find_global_route( "stock_mts_mto_rule.route_mto_mts", _("Make To Order + Make To Stock"), diff --git a/stock_mts_mto_rule/tests/test_mto_mts_route.py b/stock_mts_mto_rule/tests/test_mto_mts_route.py index 13ae60a11..0f4609192 100644 --- a/stock_mts_mto_rule/tests/test_mto_mts_route.py +++ b/stock_mts_mto_rule/tests/test_mto_mts_route.py @@ -18,27 +18,37 @@ class TestMtoMtsRoute(TransactionCase): def test_standard_mto_route(self): mto_route = self.env.ref("stock.route_warehouse0_mto") self.product.route_ids = [(6, 0, [mto_route.id])] - self.group.run( - self.product, - 2.0, - self.uom, - self.customer_loc, - self.product.name, - "test", - self.procurement_vals, + self.env["procurement.group"].run( + [ + self.group.Procurement( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.warehouse.company_id, + self.procurement_vals, + ) + ] ) moves = self.move_obj.search([("group_id", "=", self.group.id)]) self.assertEqual(len(moves), 2) def test_standard_mts_route(self): - self.group.run( - self.product, - 2.0, - self.uom, - self.customer_loc, - self.product.name, - "test", - self.procurement_vals, + self.env["procurement.group"].run( + [ + self.group.Procurement( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.warehouse.company_id, + self.procurement_vals, + ) + ] ) moves = self.move_obj.search([("group_id", "=", self.group.id)]) self.assertEqual(len(moves), 1) @@ -47,14 +57,19 @@ class TestMtoMtsRoute(TransactionCase): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] self._create_quant(1.0) - self.group.run( - self.product, - 2.0, - self.uom, - self.customer_loc, - self.product.name, - "test", - self.procurement_vals, + self.env["procurement.group"].run( + [ + self.group.Procurement( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.warehouse.company_id, + self.procurement_vals, + ) + ] ) moves = self.env["stock.move"].search([("group_id", "=", self.group.id)]) self.assertEqual(3, len(moves)) @@ -67,7 +82,7 @@ class TestMtoMtsRoute(TransactionCase): ) self.assertEqual(1, len(move_mts)) self.assertEqual(1.0, move_mts.product_uom_qty) - self.assertEqual("confirmed", move_mts.state) + self.assertEqual("assigned", move_mts.state) move_mto = self.env["stock.move"].search( [ ("group_id", "=", self.group.id), @@ -81,14 +96,19 @@ class TestMtoMtsRoute(TransactionCase): def test_mts_mto_route_mto_only(self): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] - self.group.run( - self.product, - 2.0, - self.uom, - self.customer_loc, - self.product.name, - "test", - self.procurement_vals, + self.env["procurement.group"].run( + [ + self.group.Procurement( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.warehouse.company_id, + self.procurement_vals, + ) + ] ) moves = self.env["stock.move"].search( [ @@ -104,14 +124,19 @@ class TestMtoMtsRoute(TransactionCase): mto_mts_route = self.env.ref("stock_mts_mto_rule.route_mto_mts") self.product.route_ids = [(6, 0, [mto_mts_route.id])] self._create_quant(3.0) - self.group.run( - self.product, - 2.0, - self.uom, - self.customer_loc, - self.product.name, - "test", - self.procurement_vals, + self.env["procurement.group"].run( + [ + self.group.Procurement( + self.product, + 2.0, + self.uom, + self.customer_loc, + self.product.name, + "test", + self.warehouse.company_id, + self.procurement_vals, + ) + ] ) moves = self.env["stock.move"].search([("group_id", "=", self.group.id)]) self.assertEqual(1, len(moves)) @@ -195,10 +220,10 @@ class TestMtoMtsRoute(TransactionCase): self.warehouse.mto_mts_management = True self.customer_loc = self.env.ref("stock.stock_location_customers") self.product = self.env["product.product"].create( - {"name": "Test product", "type": "product",} + {"name": "Test product", "type": "product"} ) self.company_partner = self.env.ref("base.main_partner") - self.group = self.env["procurement.group"].create({"name": "test",}) + self.group = self.env["procurement.group"].create({"name": "test"}) self.procurement_vals = {"warehouse_id": self.warehouse, "group_id": self.group} # Since mrp and purchase modules may not be installed, we need to # create a dummy step to show that mts, mto, and mts+mto flows work.