[IMP] stock, purchase: improve usererror messages.
This commit add some steps in description in order to correct the mistake.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Parameters">
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
<field name="orderpoints_only" groups="base.group_no_one"/>
|
||||
<footer>
|
||||
|
||||
Reference in New Issue
Block a user