diff --git a/addons/product_expiry/models/production_lot.py b/addons/product_expiry/models/production_lot.py index 5ddaf4a5f60..bb40157dc76 100644 --- a/addons/product_expiry/models/production_lot.py +++ b/addons/product_expiry/models/production_lot.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime -from odoo import api, fields, models, _ +from odoo import api, fields, models, SUPERUSER_ID, _ class StockProductionLot(models.Model): @@ -81,7 +81,7 @@ class StockProductionLot(models.Model): ('mail_activity_type_id','=', mail_activity_type)])) for lot in lots: lot.activity_schedule('product_expiry.mail_activity_type_alert_date_reached', - user_id=lot.product_id.responsible_id.id, note=_("The alert date has been reached for this lot/serial number") + user_id=lot.product_id.responsible_id.id or SUPERUSER_ID, note=_("The alert date has been reached for this lot/serial number") ) class ProcurementGroup(models.Model): diff --git a/addons/stock/data/stock_data.xml b/addons/stock/data/stock_data.xml index be5f560d1a1..52ea5baf809 100644 --- a/addons/stock/data/stock_data.xml +++ b/addons/stock/data/stock_data.xml @@ -66,7 +66,7 @@ - Make To Order + Replenish on Order (MTO) 5 diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 2b3f9af2baa..2f16867a42c 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -402,7 +402,7 @@ class ProductTemplate(models.Model): _inherit = 'product.template' responsible_id = fields.Many2one( - 'res.users', string='Responsible', default=lambda self: self.env.uid, required=True, + 'res.users', string='Responsible', help="This user will be responsible of the next activities related to logistic operations for this product.") type = fields.Selection(selection_add=[('product', 'Storable Product')]) property_stock_production = fields.Many2one( @@ -443,7 +443,7 @@ class ProductTemplate(models.Model): route_ids = fields.Many2many( 'stock.location.route', 'stock_route_product', 'product_id', 'route_id', 'Routes', domain=[('product_selectable', '=', True)], - help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, MTO, etc.") + help="Depending on the modules installed, this will allow you to define the route of the product: whether it will be bought, manufactured, replenished on order, etc.") nbr_reordering_rules = fields.Integer('Reordering Rules', compute='_compute_nbr_reordering_rules') # TDE FIXME: really used ? reordering_min_qty = fields.Float(compute='_compute_nbr_reordering_rules') diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py index 5dc9132834c..21fbf20125c 100644 --- a/addons/stock/models/stock_rule.py +++ b/addons/stock/models/stock_rule.py @@ -7,7 +7,7 @@ from dateutil.relativedelta import relativedelta from odoo.tools.misc import split_every from psycopg2 import OperationalError -from odoo import api, fields, models, registry, _ +from odoo import api, fields, models, registry, SUPERUSER_ID, _ from odoo.osv import expression from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare, float_round @@ -245,7 +245,7 @@ class StockRule(models.Model): self.env['mail.activity'].create({ 'activity_type_id': activity_type_id, 'note': note, - 'user_id': product_id.responsible_id.id, + 'user_id': product_id.responsible_id.id or SUPERUSER_ID, 'res_id': product_id.product_tmpl_id.id, 'res_model_id': self.env.ref('product.model_product_template').id, }) diff --git a/odoo/addons/test_main_flows/static/src/js/tour.js b/odoo/addons/test_main_flows/static/src/js/tour.js index d79036346b2..4d29ed4e608 100644 --- a/odoo/addons/test_main_flows/static/src/js/tour.js +++ b/odoo/addons/test_main_flows/static/src/js/tour.js @@ -58,8 +58,8 @@ tour.register('main_flow_tour', { content: _t('Uncheck Buy'), position: 'right', }, { - trigger: '.o_field_widget[name=route_ids] .custom-checkbox > label:contains("Make To Order")', - content: _t('Uncheck Make To Order'), + trigger: '.o_field_widget[name=route_ids] .custom-checkbox > label:contains("Replenish on Order (MTO)")', + content: _t('Uncheck Replenish on Order (MTO)'), position: 'right', }, { trigger: '.o_notebook a:contains("General Information")', @@ -114,8 +114,8 @@ tour.register('main_flow_tour', { content: _t('Go to inventory tab'), position: 'top', }, { - trigger: '.o_field_widget[name=route_ids] .custom-checkbox > label:contains("Make To Order")', - content: _t('Check Make To Order'), + trigger: '.o_field_widget[name=route_ids] .custom-checkbox > label:contains("Replenish on Order (MTO)")', + content: _t('Check Replenish on Order (MTO)'), position: 'right', }, { trigger: '.o_notebook a:contains("Purchase")',