Merge pull request #14369 from Tim-Otte/fix-product-unit-translation
Fixed translation of product units in documents
This commit is contained in:
commit
e455f8afa6
@ -929,6 +929,7 @@ class BOM extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("mrp");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'standard';
|
||||
|
||||
@ -3664,6 +3664,7 @@ class Propal extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("propale");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'azur';
|
||||
|
||||
@ -3859,6 +3859,7 @@ class Commande extends CommonOrder
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("orders");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'einstein';
|
||||
|
||||
@ -4296,6 +4296,7 @@ class Facture extends CommonInvoice
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele))
|
||||
{
|
||||
|
||||
@ -2393,6 +2393,7 @@ class Contrat extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("contracts");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'strato';
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -2463,6 +2463,7 @@ class Expedition extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("sendings");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'rouget';
|
||||
|
||||
@ -2966,6 +2966,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("suppliers");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'muscadet';
|
||||
|
||||
@ -2641,6 +2641,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))
|
||||
|
||||
@ -1035,6 +1035,7 @@ class Livraison extends CommonObject
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$langs->load("deliveries");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'typhon';
|
||||
|
||||
@ -4428,6 +4428,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)) {
|
||||
|
||||
@ -859,6 +859,7 @@ class Entrepot extends CommonObject
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$langs->load("stocks");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'standard';
|
||||
|
||||
@ -1167,6 +1167,7 @@ class MouvementStock extends CommonObject
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$langs->load("stocks");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'stdmovement';
|
||||
|
||||
@ -2630,6 +2630,7 @@ class SupplierProposal extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("supplier_proposal");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'aurore';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user