Daaaaad Posted October 15, 2019 Share Posted October 15, 2019 Bonjour à tous 😀 Depuis la version 1.7.2, PrestaShop s'est doté d'un nouveau système de gestion de stock (http://build.prestashop.com/news/stock-management-in-prestashop-1-7-part-4-prestashop-erp/). Je suis cependant étonné de ne pas retrouver certaines notions de cette nouvelle manière de gérer les stocks via l'API/la webservice : Les notions principales ("physical_quantity" et "reserved_quantity" ) sont absentes 😔 Hors j'aurais aimé pouvoir les modifier lors de ma synchro ERP. Comment faire ? Cordialement, David. Link to comment Share on other sites More sharing options...
Eolia Posted October 16, 2019 Share Posted October 16, 2019 les stocks avancés n'existent plus en 1.7 donc votre requete API ne risque pas d'avoir de réponse sur des champs inexistants^^ Link to comment Share on other sites More sharing options...
Daaaaad Posted October 16, 2019 Author Share Posted October 16, 2019 Bonjour @Eolia, c'est justement les nouveaux champs de la nouvelle gestion de stock de PrestaShop 1.7.2+ que j'aimerais utiliser... Il y a bien un nouveau système de gestion de stock ➡️ http://build.prestashop.com/news/stock-management-in-prestashop-1-7/ Link to comment Share on other sites More sharing options...
Eolia Posted October 16, 2019 Share Posted October 16, 2019 ces champs n'ont jamais été dans StockAvailable mais dans Stock tout court Link to comment Share on other sites More sharing options...
Daaaaad Posted October 16, 2019 Author Share Posted October 16, 2019 @Eolia Il ne faut jamais dire jamais 😛 Link to comment Share on other sites More sharing options...
Eolia Posted October 16, 2019 Share Posted October 16, 2019 Ben si^^ l'api dépend de l'objectModel et donc de sa définition et non des champs de la base de données Donc StockAvailable: /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'stock_available', 'primary' => 'id_stock_available', 'fields' => array( 'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'quantity' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => true), 'depends_on_stock' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'out_of_stock' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => true), 'location' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'size' => 255), ), ); /** * @see ObjectModel::$webserviceParameters */ protected $webserviceParameters = array( 'fields' => array( 'id_product' => array('xlink_resource' => 'products'), 'id_product_attribute' => array('xlink_resource' => 'combinations'), 'id_shop' => array('xlink_resource' => 'shops'), 'id_shop_group' => array('xlink_resource' => 'shop_groups'), ), 'hidden_fields' => array( ), 'objectMethods' => array( 'add' => 'addWs', 'update' => 'updateWs', ), ); Vos champs n'y sont pas. Link to comment Share on other sites More sharing options...
Daaaaad Posted October 16, 2019 Author Share Posted October 16, 2019 Effectivement @Eolia, le modèle ne fait pas référence à ces colonnes 🤔 C'est étrange car elles sont bel et bien utilisées par PrestaShop : Penses-tu que ça soit pour assurer la rétrocompatibilité ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now