Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INCOHERANT status for the same object in 2 class for Product supplier prices #32560

Open
thersane-john opened this issue Jan 7, 2025 · 1 comment
Labels
Bug This is a bug (something does not work as expected)

Comments

@thersane-john
Copy link
Contributor

Bug

ProductFournisseurPrice and ProductFournisseur use same table product_fournisseur_price but status are not identical :

for ProductFournisseurPrice :

	const STATUS_DRAFT = 0;
	const STATUS_VALIDATED = 1;
	const STATUS_CANCELED = 9;

for ProductFournisseur :

	const STATUS_OPEN = 1;
	const STATUS_CANCELED = 0;

The STATUS_CANCELED is not the same. I try to set it in base to 9 for testing. But using this status made a lot of errors in Dolibarr.

@eldy : Before creating a patch for V20, I would like to know if any updates are planned for these statuses. The goal is to patch in the "right direction," considering that this feature is marked as a work in progress.

Dolibarr Version

20.0

Environment PHP

No response

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

@thersane-john thersane-john added the Bug This is a bug (something does not work as expected) label Jan 7, 2025
@eldy
Copy link
Member

eldy commented Jan 7, 2025

Bug

ProductFournisseurPrice and ProductFournisseur use same table product_fournisseur_price but status are not identical :

for ProductFournisseurPrice :

	const STATUS_DRAFT = 0;
	const STATUS_VALIDATED = 1;
	const STATUS_CANCELED = 9;

for ProductFournisseur :

	const STATUS_OPEN = 1;
	const STATUS_CANCELED = 0;

The STATUS_CANCELED is not the same. I try to set it in base to 9 for testing. But using this status made a lot of errors in Dolibarr.

@eldy : Before creating a patch for V20, I would like to know if any updates are planned for these statuses. The goal is to patch in the "right direction," considering that this feature is marked as a work in progress.

Dolibarr Version

20.0

Environment PHP

No response

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

ProductFounisseur and ProductFournisseurPrice are not the same table.
ProductFournisseur is a Product, an extend of a Product, just to add some specific properties of a product for a supplier, but not the price that is anothet table. So class is related to table is llx_product.
ProductFournisseurPruce is the table of different prices for each supplier.
However, some specialized method are still into ProdutFournisseur instead of ProductFournisseurPrice because in the past only one classe did exists for the both need.

This is why const differs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants