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

NEW : allow stock management by product #30230

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from

Conversation

thomas-Ngr
Copy link
Contributor

NEW : allow stock management by product

When using product stocks, users may want to have some products for which they don't want to manage stocks, for example in case of subcontracting.

This PR:

  • adds a field "Stockable product" on product card (editable on update, not on create)
  • sets this option to 1 by default
  • hides the "stocks" tabs if this option is not set
  • does not manage stock movements for a product if this option is not set.

Discussion started on #26184 and #26200

SQL Part : #26190

@thomas-Ngr thomas-Ngr marked this pull request as ready for review July 1, 2024 15:10
@eldy
Copy link
Member

eldy commented Jul 3, 2024

Change into language file htdocs/langs/fr_FR/products.lang is not allowed (only en_US is allowed for language files)

}

if ($p->stockable_product == Product::DISABLED_STOCK) {
$w = new Entrepot($db);
Copy link
Member

@eldy eldy Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If product is not stockable, we have no reason to manage some warehouses.
The "passing test" should be move by changing the test that is blocking later to take into account product status.

$w_Id = array_keys($Tw);
$stockLine[$i][$j]['qty'] = GETPOST($qty, 'int');

// lorsque que l'on a le stock désactivé sur un produit/service
Copy link
Member

@eldy eldy Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

French comment not allowed

/**
* 0=This service or product is not managed in stock, 1=This service or product is managed in stock
*
* @var boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@var int

*
* @var boolean
*/
public $stockable_product = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public $stockable_product = 1;

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants