diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index e23d2ce01a9..51484fcce24 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -491,7 +491,12 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
}
else
{
- $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
+ $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto));;
+ if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
+ $mesg .= '
Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
+ } else {
+ $mesg .= '
Unkown Error, please refers to your administrator';
+ }
}
$mesg .= '';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 8fe4c2c9cc9..30ae8ad9921 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2836,7 +2836,7 @@ abstract class CommonObject
{
// phpcs:enable
$positionfield = 'rang';
- if ($this->table_element == 'bom') $positionfield = 'position';
+ if ($this->table_element == 'bom_bom') $positionfield = 'position';
// Search the last rang with fk_parent_line
if ($fk_parent_line)