← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 891271] Re: update and create function broken on magento 1.6.1

 

Thanks for answer.

i note the "ol_catalog_product.create ".

But note that the update dont work from openerp itself. Nothing happend 
when we try updating a product with magentoerpconnect.


> Mohammed NAHHAS <mailto:891271@xxxxxxxxxxxxxxxxxx>
> 17 novembre 2011 14:11
> 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
>
> Thierry <mailto:891271@xxxxxxxxxxxxxxxxxx>
> 16 novembre 2011 19:00
> Public bug reported:
>
> 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
>
> ** Affects: magentoerpconnect
> Importance: Undecided
> Status: New
>


** Attachment added: "compose-unknown-contact.jpg"
   https://bugs.launchpad.net/bugs/891271/+attachment/2599643/+files/compose-unknown-contact.jpg

-- 
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


References