c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #37731
[Bug 891271] Re: update and create function broken on magento 1.6.1
Hello,
The creation and update of SIMPLE products works on an install of
magento (v 1.6.1.0) using the last of version of the magento
OpenERPConnector.
Make sure you're calling ol_catalog_product.create (not
catalog_product.create)
Here's an example of creating SIMPLE products using SOAP :
$this->_magentoClient = new SoapClient($wsdl);
$this->_session = $this->_magentoClient->login($login, $pwd);
$sku = 'product_sku';
$set_id = 4; //Default Attribute Set
$product_data = array(
'name' => 'The name',
'short_description' => 'my short description',
'description' => 'my description',
'status' => 1,
'weight' => 0,
'price' => 12.05,
'tax_class_id' => 0,
'websites' => array(1),
'categories' => array(3,2), //my categories ids
);
/* Create SIMPLE product */
$product_id = $this->_magentoClient->call($this->_session, 'ol_catalog_product.create', array('simple', $set_id, $sku, $product_data ));
PS : this works only for SIMPLE products
Regards,
Mohammed
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/891271
Title:
update and create function broken on magento 1.6.1
Status in Magento OpenERP Connector:
New
Bug description:
Hello,
I install magento 1.6.1 and the latest version of the connector.
Note : i setup a dedicated magento with only the connector as extension to be sure.
When installed, it break the magento API due some broken part into the
extended API in creation and update of products.
Some part of my debug:
In creation mode, some part of product are available (sku, stock, website_id) but nothing in description, status, weight,...
So the product is not visible into the backend of magento.
I think there is a problem with this part into
Ol_Catalog/Products.php where attributes are not processed.
foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) {
if ($this->_isAllowedAttribute($attribute)
&& isset($productData[$attribute->getAttributeCode()])) {
$product->setData(
$attribute->getAttributeCode(),
$productData[$attribute->getAttributeCode()]
);
}
}
This part where attribute name is declare is processed :
if (isset($productData['website_ids']) && is_array($productData['website_ids'])) {
$product->setWebsiteIds($productData['website_ids']);
}
In update mode get same problem with the foreach.
Thanks for your help to solve this.
Regards,
Thierry
To manage notifications about this bug go to:
https://bugs.launchpad.net/magentoerpconnect/+bug/891271/+subscriptions
Follow ups
References