Dolibarr: BOM list doesnt display product Unit when global config: PRODUCT_USE_UNITS = 1

Created on 2 Feb 2020  路  12Comments  路  Source: Dolibarr/dolibarr

Bug

BOM lines of product items not showing UNIT when global config is set to PRODUCT_USE_UNITS = 1

Environment

  • Version: 11

Expected and actual behavior

data-product_type="" is empty and should be filled by the UNIT i.e. pieces or Kg.

Steps to reproduce the behavior

Enable PRODUCT_USE_UNITS = 1 in the other setup settings
Add a BOM
Add lines to the BOM

Bug Discussion

Most helpful comment

PRODUCT_USE_UNITS is currently a hidden option not supported. Why did you enabled this option. Can't you store the unit into the dedicated field (length, surface or volume field) ?

Hello @eldy why do you say it is unsupported ? this constant exists for some time now and is often in use. Is there a place where one can know if a constant is supported or not ?

All 12 comments

PRODUCT_USE_UNITS is currently a hidden option not supported. Why did you enabled this option. Can't you store the unit into the dedicated field (length, surface or volume field) ?

maybe some misunderstanding. I installed version 11 via an upgrade coming from version 10.6.

bom_car

as you can see I want to built a car; i need 4 wheels in pieces, i want to use 500kg of steel and we need 20 meter of electrical wire. the issue is that none of the Units is displaying. I assume when i can set the unit in the form their is no need to use a dedicated field.

To come back why i have enabled PRODUCT_USE_UNITS = 1, I am not sure because i have enabled it for some reason in the past but looking at the code in objectline_title.tpl.php

if ($conf->global->PRODUCT_USE_UNITS)
{
print ''.$langs->trans('Unit').'';
}

PRODUCT_USE_UNITS is currently a hidden option not supported. Why did you enabled this option. Can't you store the unit into the dedicated field (length, surface or volume field) ?

Hello @eldy why do you say it is unsupported ? this constant exists for some time now and is often in use. Is there a place where one can know if a constant is supported or not ?

i have fixed this previously, its just thhe class of productline that was wrong

i have fixed this previously, its just thhe class of productline that was wrong

Can you explain how you fixed this? That would be really helpfull

Hello @eldy why do you say it is unsupported ? this constant exists for some time now and is often in use. Is there a place where one can know if a constant is supported or not ?

If you can activate a constant through the home > setup pages, then it's an official feature. If you have to add it manually in home > setup > other, then it's what we call a hidden option. Hidden options are experimental features.

i have fixed this previously, its just thhe class of productline that was wrong

Can you explain how you fixed this? That would be really helpfull

have a look here : https://github.com/Dolibarr/dolibarr/pull/12576/files

i have fixed this previously, its just thhe class of productline that was wrong

Can you explain how you fixed this? That would be really helpfull

have a look here : https://github.com/Dolibarr/dolibarr/pull/12576/files

Yes this has already been fixed in version 11.0.1 my current install and it doesn't make any difference in regards to displaying the units.

Fix explained by @homer8173 did not fix the issue for me.
Regarding the PHP error stacktrace :
Uncaught Error: Call to undefined function measuringUnitString() in /var/www/html/core/class/html.form.class.php:2837, i just need to add the following line of code in file htdocs/fourn/facture/card.php :
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
And voil脿 !

@eldy can we reopen this issue? It is still not working.

The problem is that the llx_bom_bomline table does NOT have the column fk_unit. PR is coming

PRODUCT_USE_UNITS is currently a hidden option not supported. Why did you enabled this option. Can't you store the unit into the dedicated field (length, surface or volume field) ?

Hello @eldy why do you say it is unsupported ? this constant exists for some time now and is often in use. Is there a place where one can know if a constant is supported or not ?

Reason is that this option is not required to manage unit. You don't have to use this option to store the unit. The unit can be set currently into the product record with no need of any option. So you can set the unit of steel to be kg, the unit of electrical wire in meter, etc... Because this option is a duplicate of existing feature, it may be removed.

I dont really understand where it is possible to set a unit if PRODUCT_USE_UNITS is NOT set

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gnovaro picture gnovaro  路  5Comments

rdoursenaud picture rdoursenaud  路  4Comments

Nicolas90000 picture Nicolas90000  路  3Comments

truefriend-cz picture truefriend-cz  路  5Comments

aljawaid picture aljawaid  路  5Comments