[IMP] stock: usability improvement

Description of the issue/feature this PR addresses:
- Task : https://www.odoo.com/web#id=1891230&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720
- Pad : https://pad.odoo.com/p/r.c685147bff2284699d1933fb36e3fec3

Current behavior before PR:
- Usability MTO route

Desired behavior after PR is merged:
- Rename stock_location_route "Make to Order (MTO)" into "Replenish on Order (MTO)".
- The field responsible on the product should be empty by default and it shouldn't be required.
  If empty, the next activity should be assigned to the "system" (the admin)

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#27554
This commit is contained in:
Robot Odoo
2018-11-26 15:01:17 +01:00
committed by GitHub
5 changed files with 11 additions and 11 deletions
@@ -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):
+1 -1
View File
@@ -66,7 +66,7 @@
<!-- set a lower sequence on the mto route than on the resupply routes -->
<record id="route_warehouse0_mto" model='stock.location.route'>
<field name="name">Make To Order</field>
<field name="name">Replenish on Order (MTO)</field>
<field name="company_id"></field>
<field name="sequence">5</field>
</record>
+2 -2
View File
@@ -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')
+2 -2
View File
@@ -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,
})
@@ -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")',