From f50d73237399ddfc9ec48ac55ebc32754ecf52bb Mon Sep 17 00:00:00 2001 From: amoyaux Date: Wed, 6 Sep 2017 11:26:09 +0200 Subject: [PATCH] [IMP] stock, purchase: improve usererror messages. This commit add some steps in description in order to correct the mistake. --- addons/mrp/models/procurement.py | 2 +- addons/purchase/models/purchase.py | 2 +- addons/stock/models/procurement.py | 2 +- addons/stock/wizard/stock_scheduler_compute_views.xml | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/mrp/models/procurement.py b/addons/mrp/models/procurement.py index 3bf96934b83..61c654c4dd8 100644 --- a/addons/mrp/models/procurement.py +++ b/addons/mrp/models/procurement.py @@ -17,7 +17,7 @@ class ProcurementRule(models.Model): ProductionSudo = Production.sudo().with_context(force_company=values['company_id'].id) bom = self._get_matching_bom(product_id, values) if not bom: - msg = _('No Bill of Material found for product %s.') % (product_id.display_name,) + msg = _('There is no Bill of Material found for the product %s. Please define a Bill of Material for this product.') % (product_id.display_name,) raise UserError(msg) # create the MO as SUPERUSER because the current user may not have the rights to do it (mto product launched by a sale for example) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index e40713bac40..351ca944d64 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -866,7 +866,7 @@ class ProcurementRule(models.Model): suppliers = product_id.seller_ids\ .filtered(lambda r: (not r.company_id or r.company_id == values['company_id']) and (not r.product_id or r.product_id == product_id)) if not suppliers: - msg = _('No vendor associated to product %s. Unable to generate the purchase order.') % (product_id.display_name,) + msg = _('There is no vendor associated to the product %s. Please define a vendor for this product.') % (product_id.display_name,) raise UserError(msg) supplier = self._make_po_select_supplier(values, suppliers) diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py index 57f969d8542..bcc9dcbd2c8 100644 --- a/addons/stock/models/procurement.py +++ b/addons/stock/models/procurement.py @@ -183,7 +183,7 @@ class ProcurementGroup(models.Model): rule = self._get_rule(product_id, location_id, values) if not rule: - raise UserError(_('No procurement rule found.')) + raise UserError(_('No procurement rule found. Please verify the configuration of your routes')) getattr(rule, '_run_%s' % rule.action)(product_id, product_qty, product_uom, location_id, name, origin, values) return True diff --git a/addons/stock/wizard/stock_scheduler_compute_views.xml b/addons/stock/wizard/stock_scheduler_compute_views.xml index ec8b5fe8884..ad8c64df78e 100644 --- a/addons/stock/wizard/stock_scheduler_compute_views.xml +++ b/addons/stock/wizard/stock_scheduler_compute_views.xml @@ -6,9 +6,8 @@

- This will run the schedulers. Which will try to reserve not available deliveries, - try to see if it can solve any exceptions in the stock flow that might have been solved - and will run the reordering rules. + When you run the schedulers, Odoo tries to reserve the available stock to fulfill the existing pickings + and verify if some reordering rules should be triggered.