// Fixed bugs when editing Warehouses & Suppliers for a product
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11222 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+10
-4
@@ -188,6 +188,12 @@ class ProductCore extends ObjectModel
|
|||||||
/*** @var array Tags */
|
/*** @var array Tags */
|
||||||
public $tags;
|
public $tags;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @since 1.5.0
|
||||||
|
* @var boolean Product stock management type
|
||||||
|
*/
|
||||||
|
public $advanced_stock_management;
|
||||||
|
|
||||||
public $isFullyLoaded = false;
|
public $isFullyLoaded = false;
|
||||||
|
|
||||||
public $cache_is_pack;
|
public $cache_is_pack;
|
||||||
@@ -4643,17 +4649,17 @@ class ProductCore extends ObjectModel
|
|||||||
Search::indexation(false, $this->id);
|
Search::indexation(false, $this->id);
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getRealQuantity($id_product, $id_product_attribute = 0, $id_warehouse = 0, $id_shop = null)
|
public static function getRealQuantity($id_product, $id_product_attribute = 0, $id_warehouse = 0, $id_shop = null)
|
||||||
{
|
{
|
||||||
static $manager = null;
|
static $manager = null;
|
||||||
|
|
||||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && is_null($manager))
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && is_null($manager))
|
||||||
$manager = StockManagerFactory::getManager();
|
$manager = StockManagerFactory::getManager();
|
||||||
|
|
||||||
if (is_null($id_shop))
|
if (is_null($id_shop))
|
||||||
$id_shop = Context::getContext()->shop->getID(true);
|
$id_shop = Context::getContext()->shop->getID(true);
|
||||||
|
|
||||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && StockAvailable::dependsOnStock($id_product, $id_shop))
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && StockAvailable::dependsOnStock($id_product, $id_shop))
|
||||||
return $manager->getProductRealQuantities($id_product, $id_product_attribute, $id_warehouse, true);
|
return $manager->getProductRealQuantities($id_product, $id_product_attribute, $id_warehouse, true);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -66,13 +66,12 @@ class ProductSupplierCore extends ObjectModel
|
|||||||
'table' => 'product_supplier',
|
'table' => 'product_supplier',
|
||||||
'primary' => 'id_product_supplier',
|
'primary' => 'id_product_supplier',
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'product_supplier_reference' => array('type' => self::TYPE_INT, 'validate' => 'isReference'),
|
'product_supplier_reference' => array('type' => self::TYPE_INT, 'validate' => 'isReference', 'size' => 32),
|
||||||
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
'product_supplier_price_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
'product_supplier_price_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
'supplier_reference' => array('type' => self::TYPE_STRING, 'size' => 32),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user