Fixed translation of product units in documents

This commit is contained in:
Tim Otte 2020-08-04 11:02:16 +02:00
parent b36463a38a
commit 360afccecc
14 changed files with 15 additions and 2 deletions

View File

@ -927,6 +927,7 @@ class BOM extends CommonObject
global $conf, $langs;
$langs->load("mrp");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'standard';

View File

@ -3662,6 +3662,7 @@ class Propal extends CommonObject
global $conf, $langs;
$langs->load("propale");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'azur';

View File

@ -3859,6 +3859,7 @@ class Commande extends CommonOrder
global $conf, $langs;
$langs->load("orders");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'einstein';

View File

@ -4296,6 +4296,7 @@ class Facture extends CommonInvoice
global $conf, $langs;
$langs->load("bills");
$outputlangs->load("products");
if (!dol_strlen($modele))
{

View File

@ -2393,6 +2393,7 @@ class Contrat extends CommonObject
global $conf, $langs;
$langs->load("contracts");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'strato';

View File

@ -74,12 +74,12 @@ abstract class CommonObjectLine extends CommonObject
$label_type = 'short_label';
}
$sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$sql = 'select '.$label_type.',code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$resql = $this->db->query($sql);
if ($resql && $this->db->num_rows($resql) > 0)
{
$res = $this->db->fetch_array($resql);
$label = $res[$label_type];
$label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']);
$this->db->free($resql);
return $label;
} else {

View File

@ -2462,6 +2462,7 @@ class Expedition extends CommonObject
global $conf, $langs;
$langs->load("sendings");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'rouget';

View File

@ -2959,6 +2959,7 @@ class CommandeFournisseur extends CommonOrder
global $conf, $langs;
$langs->load("suppliers");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'muscadet';

View File

@ -2637,6 +2637,7 @@ class FactureFournisseur extends CommonInvoice
global $conf, $user, $langs;
$langs->load("suppliers");
$outputlangs->load("products");
// Set the model on the model name to use
if (empty($modele))

View File

@ -1035,6 +1035,7 @@ class Livraison extends CommonObject
global $conf, $user, $langs;
$langs->load("deliveries");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'typhon';

View File

@ -4426,6 +4426,7 @@ class Product extends CommonObject
global $conf, $user, $langs;
$langs->load("products");
$outputlangs->load("products");
// Positionne le modele sur le nom du modele a utiliser
if (!dol_strlen($modele)) {

View File

@ -856,6 +856,7 @@ class Entrepot extends CommonObject
global $conf, $user, $langs;
$langs->load("stocks");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'standard';

View File

@ -1167,6 +1167,7 @@ class MouvementStock extends CommonObject
global $conf, $user, $langs;
$langs->load("stocks");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'stdmovement';

View File

@ -2630,6 +2630,7 @@ class SupplierProposal extends CommonObject
global $conf, $langs;
$langs->load("supplier_proposal");
$outputlangs->load("products");
if (!dol_strlen($modele)) {
$modele = 'aurore';