Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur (aka Eldy) 2025-01-05 18:44:56 +01:00
commit 49f5eabc22
6 changed files with 13 additions and 4 deletions

View File

@ -32,7 +32,7 @@ jobs:
run: |
gh pr edit "$url" --add-assignee rycks --add-reviewer rycks
gh pr merge "$url" --merge --auto
continue-on-error: true
- name: Assign reviewer method 2
env:

View File

@ -3,8 +3,7 @@ on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
branches:
- "18.0"
push:
env:
ENVGHT: ${{ secrets.GITHUB_TOKEN }}

View File

@ -161,7 +161,7 @@ repos:
pass_filenames: false # Run on all files
- id: php-lint
exclude:
(?x)^(htdocs/includes/symfony/.*)$
(?x)^(htdocs/includes/symfony/var-dumper/Tests/.*)$
- id: php-stan
stages: [manual]
files: \.(php)$

View File

@ -39,6 +39,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
/**
* Class to manage order lines
*/

View File

@ -6664,6 +6664,12 @@ abstract class CommonObject
$new_array_options[$key] = null;
}
// If we create product combination, we have to clean unique extrafields to prevent duplicates.
// This behaviour can be prevented by external code by changing $this->context['createproductcombination'] value in hook
if (!empty($this->context['createproductcombination']) && $this->context['createproductcombination'] == 'createproductcombination' && !empty($attributeUnique)) {
$new_array_options[$key] = null;
}
// Similar code than into insertExtraFields
if ($attributeRequired) {
$v = $this->array_options[$key];

View File

@ -782,6 +782,9 @@ class ProductCombination
$newproduct = clone $product;
}
// To avoid warning with unique extrafields values
$newproduct->context['createproductcombination'] = 'createproductcombination';
//Final weight impact
$weight_impact = (float) $forced_weightvar; // If false, return 0